Skip to content

Commit

Permalink
[WIP] Initial commit of Bluetooth RCP firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
puddly committed Jun 13, 2024
1 parent f8c797f commit 7faf17d
Show file tree
Hide file tree
Showing 39 changed files with 2,740 additions and 2 deletions.
291 changes: 291 additions & 0 deletions src/bt_rcp/.cproject

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions src/bt_rcp/app.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/***************************************************************************//**
* @file
* @brief Core application logic.
*******************************************************************************
* # License
* <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
*******************************************************************************
*
* SPDX-License-Identifier: Zlib
*
* The licensor of this software is Silicon Laboratories Inc.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
******************************************************************************/
#include "em_common.h"

/***************************************************************************//**
* Application Init.
******************************************************************************/
SL_WEAK void app_init(void)
{
/////////////////////////////////////////////////////////////////////////////
// Put your additional application init code here! //
// This is called once during start-up. //
/////////////////////////////////////////////////////////////////////////////
}

/**************************************************************************//**
* Application Process Action.
*****************************************************************************/
SL_WEAK void app_process_action(void)
{
/////////////////////////////////////////////////////////////////////////////
// Put your additional application code here! //
// This is called infinitely. //
// Do not call blocking functions from here! //
/////////////////////////////////////////////////////////////////////////////
}
44 changes: 44 additions & 0 deletions src/bt_rcp/app.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/***************************************************************************//**
* @file
* @brief Application interface provided to main().
*******************************************************************************
* # License
* <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
*******************************************************************************
*
* SPDX-License-Identifier: Zlib
*
* The licensor of this software is Silicon Laboratories Inc.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
******************************************************************************/

#ifndef APP_H
#define APP_H

/**************************************************************************//**
* Application Init.
*****************************************************************************/
void app_init(void);

/**************************************************************************//**
* Application Process Action.
*****************************************************************************/
void app_process_action(void);

#endif // APP_H
25 changes: 25 additions & 0 deletions src/bt_rcp/bt_rcp.pintool
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="ASCII"?>
<device:XMLDevice xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:device="http://www.silabs.com/ss/hwconfig/document/device.ecore" name="pin_tool.EFR32MG21A010F1024IM32" partId="mcu.arm.efr32.mg21.efr32mg21a010f1024im32" contextId="com.silabs.sdk.stack.super:4.4.2._-295637085">
<mode name="DefaultMode">
<property object="DefaultMode" propertyId="mode.diagramLocation" value="100, 100"/>
<property object="GPIO" propertyId="ABModule.selectedRequirement" value="gpio%T%SL_DEBUG%T%sl_debug_swo_config.h"/>
<property object="GPIO" propertyId="ABPeripheral.included" value="true"/>
<property object="PD04" propertyId="ABModule.selectedRequirement" value="gpio%T%SL_BOARD_ENABLE_VCOM%T%sl_board_control_config.h"/>
<property object="PD04" propertyId="pin.reserve" value="Reserved"/>
<property object="PORTIO" propertyId="portio.gpio.enable.swv" value="Enabled"/>
<property object="PORTIO" propertyId="portio.usart0.enable.cts" value="Enabled"/>
<property object="PORTIO" propertyId="portio.usart0.enable.rts" value="Enabled"/>
<property object="PORTIO" propertyId="portio.usart0.enable.rx" value="Enabled"/>
<property object="PORTIO" propertyId="portio.usart0.enable.tx" value="Enabled"/>
<property object="PORTIO" propertyId="portio.usart0.location.cts" value="35"/>
<property object="PORTIO" propertyId="portio.usart0.location.rts" value="34"/>
<property object="PORTIO" propertyId="portio.usart0.location.rx" value="6"/>
<property object="PORTIO" propertyId="portio.usart0.location.tx" value="5"/>
<property object="USART0" propertyId="ABModule.selectedRequirement" value="usart%T%SL_UARTDRV_USART_VCOM%T%sl_uartdrv_usart_vcom_config.h"/>
<property object="USART0" propertyId="ABPeripheral.included" value="true"/>
</mode>
<modeTransition>
<property object="RESET &#x2192; DefaultMode" propertyId="modeTransition.source" value="RESET"/>
<property object="RESET &#x2192; DefaultMode" propertyId="modeTransition.target" value="DefaultMode"/>
</modeTransition>
</device:XMLDevice>
64 changes: 64 additions & 0 deletions src/bt_rcp/bt_rcp.slcp
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Silicon Labs Project Configuration Tools: slcp, v0, Component selection file.
project_name: bt_rcp
label: bt_rcp
description: |
Radio Co-Processor (RCP) target application. Runs the Bluetooth Controller (i.e. the Link Layer only) and provides access to it using the standard HCI (Host-Controller Interface) over a UART connection.
category: Bluetooth Examples
filter:
- name: Device Type
value: [RCP]
- name: Project Difficulty
value: [Advanced]
- name: Wireless Technology
value: [Bluetooth]
package: Bluetooth
quality: production
readme:
- {path: readme.md}
source:
- {path: app.c}
- {path: main.c}
tag: ['hardware:rf:band:2400']
include:
- path: ''
file_list:
- {path: app.h}
sdk: {id: gecko_sdk, version: 4.4.2}
toolchain_settings: []
component:
- {id: EFR32MG21A010F1024IM32}
- {id: bluetooth_controller}
- {id: bluetooth_feature_connection}
- {id: bluetooth_feature_connection_phy_update}
- {id: bluetooth_feature_extended_advertiser}
- {id: bluetooth_feature_extended_scanner}
- {id: bluetooth_feature_legacy_advertiser}
- {id: bluetooth_feature_legacy_scanner}
- {id: bluetooth_feature_periodic_advertiser}
- {id: bluetooth_hci_uart}
- {id: board_control}
- {id: bootloader_interface}
- {id: brd4179b}
- {id: device_init}
- {id: sl_system}
- instance: [vcom]
id: uartdrv_usart
other_file:
- {path: image/readme_img0.png}
- {path: image/readme_img1.png}
- {path: image/readme_img2.png}
- {path: image/readme_img3.png}
- {path: image/readme_img4.png}
configuration:
- {name: SL_HEAP_SIZE, value: '11000'}
- {name: SL_BT_CONTROLLER_BUFFER_MEMORY, value: '7168'}
- {name: SL_BT_CONFIG_USER_ADVERTISERS, value: '2'}
- {name: SL_BOARD_ENABLE_VCOM, value: '1'}
- {name: SL_UARTDRV_USART_VCOM_FLOW_CONTROL_TYPE, value: uartdrvFlowControlNone}
- condition: [psa_crypto]
name: SL_PSA_KEY_USER_SLOT_COUNT
value: '0'
ui_hints:
highlight:
- {path: readme.md, focus: true}

16 changes: 16 additions & 0 deletions src/bt_rcp/bt_rcp.slps
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="ASCII"?>
<model:MDescriptors xmlns:model="http://www.silabs.com/ss/Studio.ecore">
<descriptors name="bt_rcp">
<properties key="projectCommon.sdkId" value="com.silabs.sdk.stack.super:4.4.2._-295637085"/>
<properties key="universalConfig.relativeWorkspacePath" value="../bt_rcp.slcw"/>
<properties key="universalConfig.generationDirectory" value=""/>
<properties key="universalConfig.toolchainCompatibility" value="iar gcc"/>
<properties key="universalConfig.incrementalOverwriteConfigs" value="false"/>
<properties key="projectCommon.boardIds" value="brd4001a:0.0.0.A01 brd4179b:0.0.0.A05"/>
<properties key="projectCommon.kitId" value=""/>
<properties key="projectCommon.partId" value="mcu.arm.efr32.mg21.efr32mg21a010f1024im32"/>
<properties key="projectCommon.toolchainId" value="com.silabs.ss.tool.ide.arm.toolchain.gnu.cdt:12.2.1.20221205"/>
<properties key="universalConfig.projectTypeIds" value="com.silabs.ss.framework.ide.project.core.cdtMbsProjectType"/>
<properties key="projectCommon.importModeId" value="LINK_LIBRARIES"/>
</descriptors>
</model:MDescriptors>
65 changes: 65 additions & 0 deletions src/bt_rcp/config/app_properties_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/***************************************************************************//**
* @file
* @brief Application Properties Header File
*******************************************************************************
* # License
* <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
*******************************************************************************
*
* SPDX-License-Identifier: Zlib
*
* The licensor of this software is Silicon Laboratories Inc.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
******************************************************************************/

#ifndef APP_PROPERTIES_CONFIG_H
#define APP_PROPERTIES_CONFIG_H

#include "sl_application_type.h"

// <<< Use Configuration Wizard in Context Menu >>>

// <h>App Properties settings

// Type of signature this application is signed with
// Default: APPLICATION_SIGNATURE_NONE(0)
#define SL_APPLICATION_SIGNATURE 0

// Location of the signature
// Default: 0xFFFFFFFF
#define SL_APPLICATION_SIGNATURE_LOCATION 0xFFFFFFFF

// Bitfield representing type of application
#define SL_APPLICATION_TYPE APPLICATION_TYPE

// <o SL_APPLICATION_VERSION> Version number for this application
// <0-4294967295:1>
// <i> Default: 1 [0-4294967295]
#define SL_APPLICATION_VERSION 1

// Capabilities of this application
// Default: 0
#define SL_APPLICATION_CAPABILITIES 0

//Product ID of the device for which the application is built
#define SL_APPLICATION_PRODUCT_ID { 0 }

// </h>

#endif // APP_PROPERTIES_CONFIG_H
48 changes: 48 additions & 0 deletions src/bt_rcp/config/btl_interface_cfg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/***************************************************************************//**
* @file
* @brief Configuration header of Bootloader Interface
*******************************************************************************
* # License
* <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
*******************************************************************************
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
* software is governed by the terms of Silicon Labs Master Software License
* Agreement (MSLA) available at
* www.silabs.com/about-us/legal/master-software-license-agreement. This
* software is distributed to you in Source Code format and is governed by the
* sections of the MSLA applicable to Source Code.
*
******************************************************************************/
#ifndef BTL_INTERFACE_CFG_H
#define BTL_INTERFACE_CFG_H

#if !defined(BOOTLOADER_APPLOADER)

#if defined(_SILICON_LABS_32B_SERIES_2_CONFIG_1)
#include "btl_interface_cfg_s2c1.h"
#endif

#if defined(_SILICON_LABS_32B_SERIES_2_CONFIG_2)
#include "btl_interface_cfg_s2c2.h"
#endif

#if defined(_SILICON_LABS_32B_SERIES_2_CONFIG_3)
#include "btl_interface_cfg_s2c3.h"
#endif

#if defined(_SILICON_LABS_32B_SERIES_2_CONFIG_4)
#include "btl_interface_cfg_s2c4.h"
#endif

#if defined(_SILICON_LABS_32B_SERIES_2_CONFIG_5)
#define BOOTLOADER_DISABLE_OLD_BOOTLOADER_MITIGATION 1
#endif

#if defined(_SILICON_LABS_32B_SERIES_2_CONFIG_8)
#define BOOTLOADER_DISABLE_OLD_BOOTLOADER_MITIGATION 1
#endif

#endif // !BOOTLOADER_APPLOADER

#endif // BTL_INTERFACE_CFG_H
Loading

0 comments on commit 7faf17d

Please sign in to comment.