diff --git a/manifests/nabucasa/skyconnect_bt_rcp.yaml b/manifests/nabucasa/skyconnect_bt_rcp.yaml new file mode 100644 index 00000000..d2021dad --- /dev/null +++ b/manifests/nabucasa/skyconnect_bt_rcp.yaml @@ -0,0 +1,30 @@ +name: SkyConnect Bluetooth +device: EFR32MG21A020F512IM32 +base_project: src/bt_rcp +filename: "{manifest_name}_{sdk_version}" + +gbl: + fw_type: bt_rcp + baudrate: 115200 + +configuration: + SL_UARTDRV_USART_VCOM_BAUDRATE: 115200 + SL_UARTDRV_USART_VCOM_FLOW_CONTROL_TYPE: usartHwFlowControlCtsAndRts + +c_defines: + SL_UARTDRV_USART_VCOM_PERIPHERAL: USART0 + SL_UARTDRV_USART_VCOM_PERIPHERAL_NO: 0 + + SL_UARTDRV_USART_VCOM_TX_PORT: gpioPortA + SL_UARTDRV_USART_VCOM_TX_PIN: 6 + + SL_UARTDRV_USART_VCOM_RX_PORT: gpioPortA + SL_UARTDRV_USART_VCOM_RX_PIN: 5 + + SL_UARTDRV_USART_VCOM_CTS_PORT: gpioPortB + SL_UARTDRV_USART_VCOM_CTS_PIN: 1 + + SL_UARTDRV_USART_VCOM_RTS_PORT: gpioPortB + SL_UARTDRV_USART_VCOM_RTS_PIN: 0 + + SL_APPLICATION_PRODUCT_ID: '{0xE9, 0x92, 0x67, 0x94, 0xBB, 0x2C, 0x4E, 0xC8, 0x9F, 0x36, 0xD9, 0xC6, 0x79, 0x4A, 0x81, 0xFB}' diff --git a/manifests/nabucasa/yellow_bt_rcp.yaml b/manifests/nabucasa/yellow_bt_rcp.yaml new file mode 100644 index 00000000..87b8784e --- /dev/null +++ b/manifests/nabucasa/yellow_bt_rcp.yaml @@ -0,0 +1,36 @@ +name: Yellow Bluetooth +device: MGM210PA32JIA +base_project: src/bt_rcp +filename: "{manifest_name}_{sdk_version}" + +gbl: + fw_type: bt_rcp + baudrate: 115200 + +add_components: +- id: simple_led + instance: [board_activity] + +configuration: + SL_UARTDRV_USART_VCOM_BAUDRATE: 115200 + SL_UARTDRV_USART_VCOM_FLOW_CONTROL_TYPE: usartHwFlowControlCtsAndRts + +c_defines: + SL_UARTDRV_USART_VCOM_PERIPHERAL: USART0 + SL_UARTDRV_USART_VCOM_PERIPHERAL_NO: 0 + + SL_UARTDRV_USART_VCOM_TX_PORT: gpioPortA + SL_UARTDRV_USART_VCOM_TX_PIN: 5 + + SL_UARTDRV_USART_VCOM_RX_PORT: gpioPortA + SL_UARTDRV_USART_VCOM_RX_PIN: 6 + + SL_UARTDRV_USART_VCOM_CTS_PORT: gpioPortD + SL_UARTDRV_USART_VCOM_CTS_PIN: 2 + + SL_UARTDRV_USART_VCOM_RTS_PORT: gpioPortC + SL_UARTDRV_USART_VCOM_RTS_PIN: 1 + + SL_SIMPLE_LED_BOARD_ACTIVITY_POLARITY: SL_SIMPLE_LED_POLARITY_ACTIVE_LOW + SL_SIMPLE_LED_BOARD_ACTIVITY_PORT: gpioPortB + SL_SIMPLE_LED_BOARD_ACTIVITY_PIN: 1 diff --git a/src/bt_rcp/.cproject b/src/bt_rcp/.cproject new file mode 100644 index 00000000..83ee5e50 --- /dev/null +++ b/src/bt_rcp/.cproject @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/bt_rcp/app.c b/src/bt_rcp/app.c new file mode 100644 index 00000000..fae3f416 --- /dev/null +++ b/src/bt_rcp/app.c @@ -0,0 +1,53 @@ +/***************************************************************************//** + * @file + * @brief Core application logic. + ******************************************************************************* + * # License + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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! // + ///////////////////////////////////////////////////////////////////////////// +} diff --git a/src/bt_rcp/app.h b/src/bt_rcp/app.h new file mode 100644 index 00000000..852857a9 --- /dev/null +++ b/src/bt_rcp/app.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief Application interface provided to main(). + ******************************************************************************* + * # License + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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 diff --git a/src/bt_rcp/bt_rcp.pintool b/src/bt_rcp/bt_rcp.pintool new file mode 100644 index 00000000..e9278f30 --- /dev/null +++ b/src/bt_rcp/bt_rcp.pintool @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/bt_rcp/bt_rcp.slcp b/src/bt_rcp/bt_rcp.slcp new file mode 100644 index 00000000..6e8a4f1e --- /dev/null +++ b/src/bt_rcp/bt_rcp.slcp @@ -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} + diff --git a/src/bt_rcp/bt_rcp.slps b/src/bt_rcp/bt_rcp.slps new file mode 100644 index 00000000..779b132c --- /dev/null +++ b/src/bt_rcp/bt_rcp.slps @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/bt_rcp/config/app_properties_config.h b/src/bt_rcp/config/app_properties_config.h new file mode 100644 index 00000000..6951a569 --- /dev/null +++ b/src/bt_rcp/config/app_properties_config.h @@ -0,0 +1,65 @@ +/***************************************************************************//** + * @file + * @brief Application Properties Header File + ******************************************************************************* + * # License + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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 >>> + +// 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 + +// Version number for this application +// <0-4294967295:1> +// 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 } + +// + +#endif // APP_PROPERTIES_CONFIG_H \ No newline at end of file diff --git a/src/bt_rcp/config/btl_interface_cfg.h b/src/bt_rcp/config/btl_interface_cfg.h new file mode 100644 index 00000000..13e09116 --- /dev/null +++ b/src/bt_rcp/config/btl_interface_cfg.h @@ -0,0 +1,48 @@ +/***************************************************************************//** + * @file + * @brief Configuration header of Bootloader Interface + ******************************************************************************* + * # License + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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 \ No newline at end of file diff --git a/src/bt_rcp/config/btl_interface_cfg_s2c1.h b/src/bt_rcp/config/btl_interface_cfg_s2c1.h new file mode 100644 index 00000000..7f703143 --- /dev/null +++ b/src/bt_rcp/config/btl_interface_cfg_s2c1.h @@ -0,0 +1,281 @@ +/***************************************************************************//** + * @file + * @brief Configuration header of Bootloader Interface + ******************************************************************************* + * # License + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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_S2C1_H +#define BTL_INTERFACE_CFG_S2C1_H + +// <<< Use Configuration Wizard in Context Menu >>> +// Bootloader Interface Trust Zone Security State Configuration + +// Disable multi tiered fallback logic +// The fault handling logic as well as the USART auto-detection logic will be disabled. +// The re-configuration of SMU will be handled by querying the running bootloader +// for the peripheral list. Querying the peripheral list is supported from the bootloader +// version 2.0.0. Check for the BOOTLOADER_CAPABILITY_PERIPHERAL_LIST capability to +// see if the running bootloader supports querying the peripheral list. +#define BOOTLOADER_DISABLE_OLD_BOOTLOADER_MITIGATION 0 + +// Disable peripheral access fault handling +// The fault handling triggered by an erroneous access of peripherals will be disabled. +// +// This should be disabled iff all the peripherals that are in use by the bootloader +// have been properly configured by the "Manually override security state of peripherals" option. +#define BOOTLOADER_DISABLE_NVM3_FAULT_HANDLING 0 + +// Manually override the security state of peripherals in use by the bootloader +// Default: 0. +// Manually override the security state of peripherals. Choose the peripherals touched +// by the customized code to have a valid secure access state before interacting with the bootloader +// In practice, this means that the chosen peripherals will be available at the secure address, +// which is accessible by the bootloader. Once the application is entered back the secure access state +// is changed back to the original state. +// +// The USART auto-detection logic that detects which, if any, USART is in use by the bootloader +// will be disabled. Make sure to choose the correct USART used by the bootloader. +#define BOOTLOADER_MANUAL_OVERRIDE_SECURITY_STATE 0 +// EMU +// Update secure access state of EMU before calling into bootloader +#define BOOTLOADER_PPUSATD0_EMU 0 + +// CMU +// Update secure access state of CMU before calling into bootloader +#define BOOTLOADER_PPUSATD0_CMU 0 + +// HFXO0 +// Update secure access state of HFXO0 before calling into bootloader +#define BOOTLOADER_PPUSATD0_HFXO0 0 + +// HFRCO0 +// Update secure access state of HFRCO0 before calling into bootloader +#define BOOTLOADER_PPUSATD0_HFRCO0 0 + +// FSRCO +// Update secure access state of FSRCO before calling into bootloader +#define BOOTLOADER_PPUSATD0_FSRCO 0 + +// DPLL0 +// Update secure access state of DPLL0 before calling into bootloader +#define BOOTLOADER_PPUSATD0_DPLL0 0 + +// LFXO +// Update secure access state of LFXO before calling into bootloader +#define BOOTLOADER_PPUSATD0_LFXO 0 + +// LFRCO +// Update secure access state of LFRCO before calling into bootloader +#define BOOTLOADER_PPUSATD0_LFRCO 0 + +// ULFRCO +// Update secure access state of ULFRCO before calling into bootloader +#define BOOTLOADER_PPUSATD0_ULFRCO 0 + +// MSC +// Update secure access state of MSC before calling into bootloader +#define BOOTLOADER_PPUSATD0_MSC 0 + +// ICACHE0 +// Update secure access state of ICACHE0 before calling into bootloader +#define BOOTLOADER_PPUSATD0_ICACHE0 0 + +// PRS +// Update secure access state of PRS before calling into bootloader +#define BOOTLOADER_PPUSATD0_PRS 0 + +// GPIO +// Update secure access state of GPIO before calling into bootloader +#define BOOTLOADER_PPUSATD0_GPIO 0 + +// LDMA +// Update secure access state of LDMA before calling into bootloader +#define BOOTLOADER_PPUSATD0_LDMA 0 + +// LDMAXBAR +// Update secure access state of LDMAXBAR before calling into bootloader +#define BOOTLOADER_PPUSATD0_LDMAXBAR 0 + +// TIMER0 +// Update secure access state of TIMER0 before calling into bootloader +#define BOOTLOADER_PPUSATD0_TIMER0 0 + +// TIMER1 +// Update secure access state of TIMER1 before calling into bootloader +#define BOOTLOADER_PPUSATD0_TIMER1 0 + +// TIMER2 +// Update secure access state of TIMER2 before calling into bootloader +#define BOOTLOADER_PPUSATD0_TIMER2 0 + +// TIMER3 +// Update secure access state of TIMER3 before calling into bootloader +#define BOOTLOADER_PPUSATD0_TIMER3 0 + +// USART0 +// Update secure access state of USART0 before calling into bootloader +#define BOOTLOADER_PPUSATD0_USART0 0 + +// USART1 +// Update secure access state of USART1 before calling into bootloader +#define BOOTLOADER_PPUSATD0_USART1 0 + +// USART2 +// Update secure access state of USART2 before calling into bootloader +#define BOOTLOADER_PPUSATD0_USART2 0 + +// BURTC +// Update secure access state of BURTC before calling into bootloader +#define BOOTLOADER_PPUSATD0_BURTC 0 + +// I2C1 +// Update secure access state of I2C1 before calling into bootloader +#define BOOTLOADER_PPUSATD0_I2C1 0 + +// CHIPTESTCTRL +// Update secure access state of CHIPTESTCTRL before calling into bootloader +#define BOOTLOADER_PPUSATD0_CHIPTESTCTRL 0 + +// LVGD +// Update secure access state of LVGD before calling into bootloader +#define BOOTLOADER_PPUSATD0_LVGD 0 + +// SYSCFG +// Update secure access state of SYSCFG before calling into bootloader +#define BOOTLOADER_PPUSATD0_SYSCFG 0 + +// BURAM +// Update secure access state of BURAM before calling into bootloader +#define BOOTLOADER_PPUSATD0_BURAM 0 + +// IFADCDEBUG +// Update secure access state of IFADCDEBUG before calling into bootloader +#define BOOTLOADER_PPUSATD0_IFADCDEBUG 0 + +// GPCRC +// Update secure access state of GPCRC before calling into bootloader +#define BOOTLOADER_PPUSATD0_GPCRC 0 + +// RTCC +// Update secure access state of RTCC before calling into bootloader +#define BOOTLOADER_PPUSATD0_RTCC 0 + +// LETIMER0 +// Update secure access state of LETIMER0 before calling into bootloader +#define BOOTLOADER_PPUSATD1_LETIMER0 0 + +// IADC0 +// Update secure access state of IADC0 before calling into bootloader +#define BOOTLOADER_PPUSATD1_IADC0 0 + +// ACMP0 +// Update secure access state of ACMP0 before calling into bootloader +#define BOOTLOADER_PPUSATD1_ACMP0 0 + +// ACMP1 +// Update secure access state of ACMP1 before calling into bootloader +#define BOOTLOADER_PPUSATD1_ACMP1 0 + +// I2C0 +// Update secure access state of I2C0 before calling into bootloader +#define BOOTLOADER_PPUSATD1_I2C0 0 + +// HFRCOEM23 +// Update secure access state of HFRCOEM23 before calling into bootloader +#define BOOTLOADER_PPUSATD1_HFRCOEM23 0 + +// WDOG0 +// Update secure access state of WDOG0 before calling into bootloader +#define BOOTLOADER_PPUSATD1_WDOG0 0 + +// WDOG1 +// Update secure access state of WDOG1 before calling into bootloader +#define BOOTLOADER_PPUSATD1_WDOG1 0 + +// AMUXCP0 +// Update secure access state of AMUXCP0 before calling into bootloader +#define BOOTLOADER_PPUSATD1_AMUXCP0 0 + +// RADIOAES +// Update secure access state of RADIOAES before calling into bootloader +#define BOOTLOADER_PPUSATD1_RADIOAES 0 + +// BUFC +// Update secure access state of BUFC before calling into bootloader +#define BOOTLOADER_PPUSATD1_BUFC 0 + +// SMU +// Update secure access state of SMU before calling into bootloader +#define BOOTLOADER_PPUSATD1_SMU 0 + +// AHBRADIO +// Update secure access state of AHBRADIO before calling into bootloader +#define BOOTLOADER_PPUSATD1_AHBRADIO 0 + +// SEMAILBOX +// Update secure access state of SEMAILBOX before calling into bootloader +#define BOOTLOADER_PPUSATD1_SEMAILBOX 0 +// + +// +// <<< end of configuration section >>> + +#if BOOTLOADER_MANUAL_OVERRIDE_SECURITY_STATE == 1 +#define BOOTLOADER_PPUSATD0_MASK ((BOOTLOADER_PPUSATD0_EMU << _SMU_PPUSATD0_EMU_SHIFT) \ + | (BOOTLOADER_PPUSATD0_CMU << _SMU_PPUSATD0_CMU_SHIFT) \ + | (BOOTLOADER_PPUSATD0_HFXO0 << _SMU_PPUSATD0_HFXO0_SHIFT) \ + | (BOOTLOADER_PPUSATD0_HFRCO0 << _SMU_PPUSATD0_HFRCO0_SHIFT) \ + | (BOOTLOADER_PPUSATD0_FSRCO << _SMU_PPUSATD0_FSRCO_SHIFT) \ + | (BOOTLOADER_PPUSATD0_DPLL0 << _SMU_PPUSATD0_DPLL0_SHIFT) \ + | (BOOTLOADER_PPUSATD0_LFXO << _SMU_PPUSATD0_LFXO_SHIFT) \ + | (BOOTLOADER_PPUSATD0_LFRCO << _SMU_PPUSATD0_LFRCO_SHIFT) \ + | (BOOTLOADER_PPUSATD0_ULFRCO << _SMU_PPUSATD0_ULFRCO_SHIFT) \ + | (BOOTLOADER_PPUSATD0_MSC << _SMU_PPUSATD0_MSC_SHIFT) \ + | (BOOTLOADER_PPUSATD0_ICACHE0 << _SMU_PPUSATD0_ICACHE0_SHIFT) \ + | (BOOTLOADER_PPUSATD0_PRS << _SMU_PPUSATD0_PRS_SHIFT) \ + | (BOOTLOADER_PPUSATD0_GPIO << _SMU_PPUSATD0_GPIO_SHIFT) \ + | (BOOTLOADER_PPUSATD0_LDMA << _SMU_PPUSATD0_LDMA_SHIFT) \ + | (BOOTLOADER_PPUSATD0_LDMAXBAR << _SMU_PPUSATD0_LDMAXBAR_SHIFT) \ + | (BOOTLOADER_PPUSATD0_TIMER0 << _SMU_PPUSATD0_TIMER0_SHIFT) \ + | (BOOTLOADER_PPUSATD0_TIMER1 << _SMU_PPUSATD0_TIMER1_SHIFT) \ + | (BOOTLOADER_PPUSATD0_TIMER2 << _SMU_PPUSATD0_TIMER2_SHIFT) \ + | (BOOTLOADER_PPUSATD0_TIMER3 << _SMU_PPUSATD0_TIMER3_SHIFT) \ + | (BOOTLOADER_PPUSATD0_USART0 << _SMU_PPUSATD0_USART0_SHIFT) \ + | (BOOTLOADER_PPUSATD0_USART1 << _SMU_PPUSATD0_USART1_SHIFT) \ + | (BOOTLOADER_PPUSATD0_USART2 << _SMU_PPUSATD0_USART2_SHIFT) \ + | (BOOTLOADER_PPUSATD0_BURTC << _SMU_PPUSATD0_BURTC_SHIFT) \ + | (BOOTLOADER_PPUSATD0_I2C1 << _SMU_PPUSATD0_I2C1_SHIFT) \ + | (BOOTLOADER_PPUSATD0_CHIPTESTCTRL << _SMU_PPUSATD0_CHIPTESTCTRL_SHIFT) \ + | (BOOTLOADER_PPUSATD0_LVGD << _SMU_PPUSATD0_LVGD_SHIFT) \ + | (BOOTLOADER_PPUSATD0_SYSCFG << _SMU_PPUSATD0_SYSCFG_SHIFT) \ + | (BOOTLOADER_PPUSATD0_BURAM << _SMU_PPUSATD0_BURAM_SHIFT) \ + | (BOOTLOADER_PPUSATD0_IFADCDEBUG << _SMU_PPUSATD0_IFADCDEBUG_SHIFT) \ + | (BOOTLOADER_PPUSATD0_GPCRC << _SMU_PPUSATD0_GPCRC_SHIFT) \ + | (BOOTLOADER_PPUSATD0_RTCC << _SMU_PPUSATD0_RTCC_SHIFT)) +#define BOOTLOADER_PPUSATD1_MASK ((BOOTLOADER_PPUSATD1_LETIMER0 << _SMU_PPUSATD1_LETIMER0_SHIFT) \ + | (BOOTLOADER_PPUSATD1_IADC0 << _SMU_PPUSATD1_IADC0_SHIFT) \ + | (BOOTLOADER_PPUSATD1_ACMP0 << _SMU_PPUSATD1_ACMP0_SHIFT) \ + | (BOOTLOADER_PPUSATD1_ACMP1 << _SMU_PPUSATD1_ACMP1_SHIFT) \ + | (BOOTLOADER_PPUSATD1_I2C0 << _SMU_PPUSATD1_I2C0_SHIFT) \ + | (BOOTLOADER_PPUSATD1_HFRCOEM23 << _SMU_PPUSATD1_HFRCOEM23_SHIFT) \ + | (BOOTLOADER_PPUSATD1_WDOG0 << _SMU_PPUSATD1_WDOG0_SHIFT) \ + | (BOOTLOADER_PPUSATD1_WDOG1 << _SMU_PPUSATD1_WDOG1_SHIFT) \ + | (BOOTLOADER_PPUSATD1_AMUXCP0 << _SMU_PPUSATD1_AMUXCP0_SHIFT) \ + | (BOOTLOADER_PPUSATD1_RADIOAES << _SMU_PPUSATD1_RADIOAES_SHIFT) \ + | (BOOTLOADER_PPUSATD1_BUFC << _SMU_PPUSATD1_BUFC_SHIFT) \ + | (BOOTLOADER_PPUSATD1_SMU << _SMU_PPUSATD1_SMU_SHIFT) \ + | (BOOTLOADER_PPUSATD1_AHBRADIO << _SMU_PPUSATD1_AHBRADIO_SHIFT) \ + | (BOOTLOADER_PPUSATD1_SEMAILBOX << _SMU_PPUSATD1_SEMAILBOX_SHIFT)) +#endif // BOOTLOADER_MANUAL_OVERRIDE_SECURITY_STATE + +#endif // BTL_INTERFACE_CFG_S2C1_H \ No newline at end of file diff --git a/src/bt_rcp/config/dmadrv_config.h b/src/bt_rcp/config/dmadrv_config.h new file mode 100644 index 00000000..be24f49d --- /dev/null +++ b/src/bt_rcp/config/dmadrv_config.h @@ -0,0 +1,26 @@ +#ifndef DMADRV_CONFIG_H +#define DMADRV_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// DMA interrupt priority <0-15> +// Priority of the DMA interrupt. Smaller number equals higher priority. +// Default: 8 +#define EMDRV_DMADRV_DMA_IRQ_PRIORITY 8 + +// Number of available channels <1-8> +// Number of DMA channels supported by the driver. A lower channel count +// will reduce RAM memory footprint. The default is to support all channels +// on the device. +// Default: 8 +#define EMDRV_DMADRV_DMA_CH_COUNT 8 + +// Number of fixed priority channels +// This will configure channels [0, CH_PRIORITY - 1] as fixed priority, +// and channels [CH_PRIORITY, CH_COUNT] as round-robin. +// Default: 0 +#define EMDRV_DMADRV_DMA_CH_PRIORITY 0 + +// <<< end of configuration section >>> + +#endif // DMADRV_CONFIG_H \ No newline at end of file diff --git a/src/bt_rcp/config/emlib_core_debug_config.h b/src/bt_rcp/config/emlib_core_debug_config.h new file mode 100644 index 00000000..e4a01682 --- /dev/null +++ b/src/bt_rcp/config/emlib_core_debug_config.h @@ -0,0 +1,45 @@ +/***************************************************************************//** + * @file + * @brief emlib_core Configuration + ******************************************************************************* + * # License + * Copyright 2019 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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 EM_CORE_DEBUG_CONFIG_H +#define EM_CORE_DEBUG_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Core Configuration + +// Enables measuring of interrupt disable time for debugging purposes. +// Default: 0 +#define SL_EMLIB_CORE_ENABLE_INTERRUPT_DISABLED_TIMING 0 + +// + +// <<< end of configuration section >>> +#endif // EM_CORE_CONFIG_H \ No newline at end of file diff --git a/src/bt_rcp/config/pin_config.h b/src/bt_rcp/config/pin_config.h new file mode 100644 index 00000000..e07ce3c5 --- /dev/null +++ b/src/bt_rcp/config/pin_config.h @@ -0,0 +1,157 @@ +#ifndef PIN_CONFIG_H +#define PIN_CONFIG_H + +// $[CMU] +// [CMU]$ + +// $[LFXO] +// [LFXO]$ + +// $[PRS.ASYNCH0] +// [PRS.ASYNCH0]$ + +// $[PRS.ASYNCH1] +// [PRS.ASYNCH1]$ + +// $[PRS.ASYNCH2] +// [PRS.ASYNCH2]$ + +// $[PRS.ASYNCH3] +// [PRS.ASYNCH3]$ + +// $[PRS.ASYNCH4] +// [PRS.ASYNCH4]$ + +// $[PRS.ASYNCH5] +// [PRS.ASYNCH5]$ + +// $[PRS.ASYNCH6] +// [PRS.ASYNCH6]$ + +// $[PRS.ASYNCH7] +// [PRS.ASYNCH7]$ + +// $[PRS.ASYNCH8] +// [PRS.ASYNCH8]$ + +// $[PRS.ASYNCH9] +// [PRS.ASYNCH9]$ + +// $[PRS.ASYNCH10] +// [PRS.ASYNCH10]$ + +// $[PRS.ASYNCH11] +// [PRS.ASYNCH11]$ + +// $[PRS.SYNCH0] +// [PRS.SYNCH0]$ + +// $[PRS.SYNCH1] +// [PRS.SYNCH1]$ + +// $[PRS.SYNCH2] +// [PRS.SYNCH2]$ + +// $[PRS.SYNCH3] +// [PRS.SYNCH3]$ + +// $[GPIO] +// GPIO SWV on PA03 +#ifndef GPIO_SWV_PORT +#define GPIO_SWV_PORT gpioPortA +#endif +#ifndef GPIO_SWV_PIN +#define GPIO_SWV_PIN 3 +#endif + +// [GPIO]$ + +// $[TIMER0] +// [TIMER0]$ + +// $[TIMER1] +// [TIMER1]$ + +// $[TIMER2] +// [TIMER2]$ + +// $[TIMER3] +// [TIMER3]$ + +// $[USART0] +// USART0 CTS on PC03 +#ifndef USART0_CTS_PORT +#define USART0_CTS_PORT gpioPortC +#endif +#ifndef USART0_CTS_PIN +#define USART0_CTS_PIN 3 +#endif + +// USART0 RTS on PC02 +#ifndef USART0_RTS_PORT +#define USART0_RTS_PORT gpioPortC +#endif +#ifndef USART0_RTS_PIN +#define USART0_RTS_PIN 2 +#endif + +// USART0 RX on PA06 +#ifndef USART0_RX_PORT +#define USART0_RX_PORT gpioPortA +#endif +#ifndef USART0_RX_PIN +#define USART0_RX_PIN 6 +#endif + +// USART0 TX on PA05 +#ifndef USART0_TX_PORT +#define USART0_TX_PORT gpioPortA +#endif +#ifndef USART0_TX_PIN +#define USART0_TX_PIN 5 +#endif + +// [USART0]$ + +// $[USART1] +// [USART1]$ + +// $[USART2] +// [USART2]$ + +// $[I2C1] +// [I2C1]$ + +// $[LETIMER0] +// [LETIMER0]$ + +// $[IADC0] +// [IADC0]$ + +// $[ACMP0] +// [ACMP0]$ + +// $[ACMP1] +// [ACMP1]$ + +// $[I2C0] +// [I2C0]$ + +// $[PTI] +// [PTI]$ + +// $[MODEM] +// [MODEM]$ + +// $[CUSTOM_PIN_NAME] +#ifndef _PORT +#define _PORT gpioPortA +#endif +#ifndef _PIN +#define _PIN 0 +#endif + +// [CUSTOM_PIN_NAME]$ + +#endif // PIN_CONFIG_H + diff --git a/src/bt_rcp/config/psa_crypto_config.h b/src/bt_rcp/config/psa_crypto_config.h new file mode 100644 index 00000000..2fcf4a02 --- /dev/null +++ b/src/bt_rcp/config/psa_crypto_config.h @@ -0,0 +1,170 @@ +#ifndef PSA_CRYPTO_CONFIG_H +#define PSA_CRYPTO_CONFIG_H + +// ----------------------------------------------------------------------------- +// User exposed config options + +// <<< Use Configuration Wizard in Context Menu >>> + +// Key management configuration + +// PSA User Maximum Open Keys Count <0-128> +// Maximum amount of keys that the user application will have open +// simultaneously. In context of PSA Crypto, an open key means any key +// either stored in RAM (lifetime set to PSA_KEY_LIFETIME_VOLATILE), or +// used as part of a cryptographic operation. +// When using a key for a multi-part (setup/update/finish) operation, a key +// is considered to be open from the moment the operation is successfully +// setup, until it finishes or aborts. +// When an application tries to open more keys than this value accounts for, +// the PSA API may return PSA_ERROR_INSUFFICIENT_MEMORY. Keep in mind that +// other software included in the application (e.g. wireless protocol stacks) +// also can have a need to have open keys in PSA Crypto. This could lead to +// a race condition when the application key slot count is set too low for +// the actual usage of the application, as a software stack may not fail +// gracefully in case an application opens more than its declared amount of +// keys, thereby precluding the stack from functioning. +// Default: 4 +#define SL_PSA_KEY_USER_SLOT_COUNT 0 + +// PSA Maximum User Persistent Keys Count <0-1024> +// Maximum amount of keys (or other files) that can be stored persistently +// by the application through the PSA interface, when persistent storage +// support for PSA Crypto is included in the project. +// Due to caching logic, this setting does have an impact on static RAM usage. +// Note that this number is added to the potential requirements from other +// software components in the project, such that the total amount of keys +// which can be stored through the ITS backend can be higher than what is +// configured here. +// +// WARNING: When changing this setting on an application that is already +// deployed, and thus will get the change through an application upgrade, +// care should be taken to ensure that the setting is only ever increased, +// and never decreased. Decreasing this setting might cause previously +// stored keys/files to become inaccessible. +// +// It is not possible to change this setting when using V3 ITS Driver. +// The file-storage indexing is dependent on the maximum number of files, +// and if SL_PSA_ITS_USER_MAX_FILES is changed, ITS should be cleared and +// all files need to be stored again. +// Default: 128 +#define SL_PSA_ITS_USER_MAX_FILES (128) + +// Enable V1 Format Support For ITS Files <0-1> +// Devices that used PSA ITS together with gecko_sdk_3.1.x or earlier +// might have keys (or other files) stored in V1 format. +// If no v1 files are used, its support can be disabled for space +// optimization. +// Default: 0 +#define SL_PSA_ITS_SUPPORT_V1_DRIVER 0 + +// Enable V2 ITS Driver Support <0-1> +// Devices that have used GSDK 4.1.x and earlier, and used ITS have the keys +// (or other files) stored using different address range. Enabling this +// config option adds upgrade code which converts V2 (and V1 if +// supported) format ITS keys/files to the latest V3 format. Update is +// fully automatic, needs to be run once and require extra flash space of +// approximately the size of the largest key. +// V1 ITS driver support can be disabled if the device has never used ITS +// driver before in GSDK 4.1.x and earlier, or the keys has been already +// migrated. +// Default: 0 +#define SL_PSA_ITS_SUPPORT_V2_DRIVER 0 + +// Enable support for V3 ITS Driver <0-1> +// Devices that have used GSDK 4.1.x and earlier, and used ITS have the keys +// (or other files) stored using different address range. In rare case +// that those devices have full nvm3 and not enough space for the +// upgrade, (that requires an extra space to store largest key in memory +// twice), this config option can disable v3 driver and use v2 one. +// To upgrade the device, make space for the upgrade, and enable v3 driver again. +// +// WARNING: When using V3 driver, it is not possible to increase or decrease +// the value of SL_PSA_ITS_USER_MAX_FILES. If the change of +// SL_PSA_ITS_USER_MAX_FILES is required, ITS should be cleared and +// all files need to be stored again. +// Default: 1 +#define SL_PSA_ITS_SUPPORT_V3_DRIVER 1 + +// Built-in AES Key Mode of Operation +// CTR Mode +// CFB Mode +// OFB Mode +// ECB Mode +// CBC Mode (no padding) +// CBC Mode (PKCS#7 padding) +// PSA Crypto only allows one specific usage algorithm per built-in key ID. +// Default: PSA_ALG_CTR +#define SL_SE_BUILTIN_KEY_AES128_ALG_CONFIG (PSA_ALG_CTR) + +#ifndef SL_CRYPTOACC_BUILTIN_KEY_PUF_ALG +// Built-in PUF Key Algorithm +// PBKDF2 (CMAC-AES-128-PRF) +// CMAC +// PSA Crypto only allows one specific usage algorithm per built-in key ID. +// It is recommended to only use the PUF key for deriving further key +// material. +// Default: PSA_ALG_PBKDF2_AES_CMAC_PRF_128 +#define SL_CRYPTOACC_BUILTIN_KEY_PUF_ALG (PSA_ALG_PBKDF2_AES_CMAC_PRF_128) +#endif // SL_CRYPTOACC_BUILTIN_KEY_PUF_ALG + +// + +// Power optimization configuration + +// Store already-generated random bytes before putting the device to sleep +// Using the hardware TRNG (for example through psa_generate_random()) will +// consume a non-negligible amount of power. A start-up routine must pass +// and a relatively large minimum amount of random bytes will be generated. +// Use cases where the device is frequently entering EM2/EM3 and thereafter +// consumes a small amount of data from the TRNG may benefit from buffering +// the existing random bytes before putting the device to sleep. These +// buffered bytes are then consumed until exhaustion before the TRNG needs +// to be initialized and used again. +// +// NOTE: this configuration option is only applicable for devices with a +// Virtual Secure Engine (VSE), and requires the 'Power Manager' component +// to be included in the project. +// +// Default: 0 +#define SL_VSE_BUFFER_TRNG_DATA_DURING_SLEEP (0) + +// Number of random words to buffer before putting the device to sleep <1-63> +// This option can be used to decrease the amount of random words that +// (if enabled) are buffered before the device enters EM2/EM3. Lowering this +// number will result in less static RAM usage, but also means that the TRNG +// potentially has to be initialized more times--leading to increased power +// consumption. By default this option in configured to buffer as much TRNG +// data as possible (limited by the depth of the TRNG FIFO). +// +// NOTE: this configuration option is only applicable when +// SL_VSE_BUFFER_TRNG_DATA_DURING_SLEEP is enabled. +// +// Default: 63 +#define SL_VSE_MAX_TRNG_WORDS_BUFFERED_DURING_SLEEP (63) +// + +// + +// <<< end of configuration section >>> + +// ----------------------------------------------------------------------------- +// Sub-files + +#if defined(SLI_PSA_CONFIG_AUTOGEN_OVERRIDE_FILE) + #include SLI_PSA_CONFIG_AUTOGEN_OVERRIDE_FILE +#else + #include "sli_psa_config_autogen.h" +#endif + +#if defined(TFM_CONFIG_SL_SECURE_LIBRARY) + #include "sli_psa_tfm_translation.h" +#endif + +#if SL_MBEDTLS_DRIVERS_ENABLED + #include "sli_psa_acceleration.h" +#endif + +#include "sli_psa_builtin_config_autogen.h" + +#endif // PSA_CRYPTO_CONFIG_H \ No newline at end of file diff --git a/src/bt_rcp/config/sl_bluetooth_advertiser_config.h b/src/bt_rcp/config/sl_bluetooth_advertiser_config.h new file mode 100644 index 00000000..cc9450a0 --- /dev/null +++ b/src/bt_rcp/config/sl_bluetooth_advertiser_config.h @@ -0,0 +1,45 @@ +/***************************************************************************//** + * @file + * @brief Bluetooth Advertiser configuration + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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 SL_BT_ADVERTISER_CONFIG_H +#define SL_BT_ADVERTISER_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> +// Max number of advertising sets reserved for user <0-255> +// Default: 1 +// Define the number of advertising sets that the application needs to use concurrently. Note that all types of advertising uses the same pool of advertising sets, but periodic advertising has extra configuration to define the number of advertising sets that are capable of periodic advertising. +// +// Specifically, if the component "bluetooth_feature_periodic_advertiser" is used, its configuration SL_BT_CONFIG_MAX_PERIODIC_ADVERTISERS specifies how many of the SL_BT_CONFIG_USER_ADVERTISERS advertising sets are capable of periodic advertising. Similarly, if the component bluetooth_feature_pawr_advertiser is used, its configuration SL_BT_CONFIG_MAX_PAWR_ADVERTISERS specifies how many of the periodic advertising sets are capable of Periodic Advertising with Responses. +// +// The configuration values must satisfy the condition SL_BT_CONFIG_USER_ADVERTISERS >= SL_BT_CONFIG_MAX_PERIODIC_ADVERTISERS >= SL_BT_CONFIG_MAX_PAWR_ADVERTISERS. +#define SL_BT_CONFIG_USER_ADVERTISERS 2 +// <<< end of configuration section >>> + +#endif \ No newline at end of file diff --git a/src/bt_rcp/config/sl_bluetooth_connection_config.h b/src/bt_rcp/config/sl_bluetooth_connection_config.h new file mode 100644 index 00000000..78e66cdc --- /dev/null +++ b/src/bt_rcp/config/sl_bluetooth_connection_config.h @@ -0,0 +1,48 @@ +/***************************************************************************//** + * @file + * @brief Bluetooth Connection configuration + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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 SL_BT_CONNECTION_CONFIG_H +#define SL_BT_CONNECTION_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> +// Max number of connections reserved for user <0-32> +// Default: 4 +// Define the number of connections the application needs. +#define SL_BT_CONFIG_MAX_CONNECTIONS (4) + +// Preferred maximum TX payload octets <27-251> +// Default: 251 +// Define the preferred maximum TX payload octets that will be used on connections. +// This value is set to the controller as the default suggested data length when +// Bluetooth stack is started. +#define SL_BT_CONFIG_CONNECTION_DATA_LENGTH (251) + +// <<< end of configuration section >>> +#endif \ No newline at end of file diff --git a/src/bt_rcp/config/sl_board_control_config.h b/src/bt_rcp/config/sl_board_control_config.h new file mode 100644 index 00000000..4b062b7c --- /dev/null +++ b/src/bt_rcp/config/sl_board_control_config.h @@ -0,0 +1,56 @@ +/***************************************************************************//** + * @file + * @brief Board Control + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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 SL_BOARD_CONTROL_CONFIG_H +#define SL_BOARD_CONTROL_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Enable Virtual COM UART +// Default: 0 +#define SL_BOARD_ENABLE_VCOM 1 + +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// SL_BOARD_ENABLE_VCOM +// $[GPIO_SL_BOARD_ENABLE_VCOM] +#ifndef SL_BOARD_ENABLE_VCOM_PORT +#define SL_BOARD_ENABLE_VCOM_PORT gpioPortD +#endif +#ifndef SL_BOARD_ENABLE_VCOM_PIN +#define SL_BOARD_ENABLE_VCOM_PIN 4 +#endif +// [GPIO_SL_BOARD_ENABLE_VCOM]$ + +// <<< sl:end pin_tool >>> + +#endif // SL_BOARD_CONTROL_CONFIG_H \ No newline at end of file diff --git a/src/bt_rcp/config/sl_bt_periodic_advertiser_config.h b/src/bt_rcp/config/sl_bt_periodic_advertiser_config.h new file mode 100644 index 00000000..73d7df54 --- /dev/null +++ b/src/bt_rcp/config/sl_bt_periodic_advertiser_config.h @@ -0,0 +1,47 @@ +/***************************************************************************//** + * @file + * @brief Bluetooth Periodic Advertiser configuration + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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 SL_BT_PERIODIC_ADVERTISER_CONFIG_H +#define SL_BT_PERIODIC_ADVERTISER_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Bluetooth Periodic Advertiser Configuration + +// Max number of advertising sets that support periodic advertising <0-255> +// Default: 1 +// Define the number of periodic advertising sets that the application needs to use concurrently. This number must not exceed the total number of advertising sets configured by SL_BT_CONFIG_USER_ADVERTISERS in the component "bluetooth_feature_advertiser". +#define SL_BT_CONFIG_MAX_PERIODIC_ADVERTISERS (1) + +// End Bluetooth Periodic Advertiser Configuration + +// <<< end of configuration section >>> + +#endif // SL_BT_PERIODIC_ADVERTISER_CONFIG_H \ No newline at end of file diff --git a/src/bt_rcp/config/sl_btctrl_config.h b/src/bt_rcp/config/sl_btctrl_config.h new file mode 100644 index 00000000..55254f75 --- /dev/null +++ b/src/bt_rcp/config/sl_btctrl_config.h @@ -0,0 +1,37 @@ +#ifndef SL_BTCTRL_CONFIG_H +#define SL_BTCTRL_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Bluetooth Controller Configuration + +// Bluetooth Controller Buffer Memory +// Default: SL_BT_CONTROLLER_BUFFER_MEMORY +// Define the Amount of memory to allocate for tx/rx buffers in Bluetooth Controller +#define SL_BT_CONTROLLER_BUFFER_MEMORY 7168 + +// Bluetooth Controller ACL data packets that can be stored +// Default: SL_BT_CONTROLLER_LE_BUFFER_SIZE_MAX +// Define the total number of the maximum sized ACL data packets that can be received from the host +#define SL_BT_CONTROLLER_LE_BUFFER_SIZE_MAX (3) + +// Total transmitted packets threshold for all connections to send the Number Of Completed Packets HCI event to the host <1-255> +// Default: 4 +// Define the number of transmitted air interface ACL packets to trigger the Number Of Completed Packets HCI event. +#define SL_BT_CONTROLLER_COMPLETED_PACKETS_THRESHOLD (4) + +// Number of connection events to send the Number Of Completed Packets HCI event to the host <1-255> +// Default: 3 +// Define the maximum number of connection events since the previous Number Of Completed Packets HCI event to trigger reporting of any unreported completed ACL packets. +#define SL_BT_CONTROLLER_COMPLETED_PACKETS_EVENTS_TIMEOUT (3) + +// Maximum number of queued advertisement reports <1-255> +// Default: 10 +// Define the maximum number of queued advertisement reports. Additional advertisement reports are dropped. +#define SL_BT_CONFIG_MAX_QUEUED_ADV_REPORTS (10) + +// Bluetooth Controller Configuration + +// <<< end of configuration section >>> + +#endif // SL_BTCTRL_CONFIG_H \ No newline at end of file diff --git a/src/bt_rcp/config/sl_debug_swo_config.h b/src/bt_rcp/config/sl_debug_swo_config.h new file mode 100644 index 00000000..f22934ac --- /dev/null +++ b/src/bt_rcp/config/sl_debug_swo_config.h @@ -0,0 +1,106 @@ +/***************************************************************************//** + * @file + * @brief SWO configuration + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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 SL_DEBUG_SWO_CONFIG_H +#define SL_DEBUG_SWO_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// SWO Configuration + +// SWO Frequency +// Must be 875 kHz for communication with Silicon Labs debuggers +// Default: 875000 +#define SL_DEBUG_SWO_FREQ 875000 + +// Enable interrupt event trace +// Default: 0 +#define SL_DEBUG_SWO_SAMPLE_IRQ 0 + +// Enable Program Counter samples +// Default: 0 +#define SL_DEBUG_SWO_SAMPLE_PC 0 + +// SWO debug sample intervals +// <64=> 64 +// <128=> 128 +// <192=> 192 +// <256=> 256 +// <320=> 320 +// <384=> 384 +// <448=> 448 +// <512=> 512 +// <576=> 576 +// <640=> 640 +// <704=> 704 +// <768=> 768 +// <832=> 832 +// <896=> 896 +// <960=> 960 +// <1024=> 1024 +// <2048=> 2048 +// <3072=> 3072 +// <4096=> 4096 +// <5102=> 5102 +// <6144=> 6144 +// <7168=> 7168 +// <8192=> 8192 +// <9216=> 9216 +// <10240=> 10240 +// <11264=> 11264 +// <12288=> 12288 +// <13312=> 13312 +// <14336=> 14336 +// <15360=> 15360 +// Must be 64, 128, 192, [ n * 64 ], 1024, 2048, 3072, [ n * 1024 ] , 15360 +// Default: 15360 +#define SL_DEBUG_SWO_SAMPLE_INTERVAL 15360 +// + +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> +// SL_DEBUG +// $[GPIO_SL_DEBUG] +#ifndef SL_DEBUG_PERIPHERAL +#define SL_DEBUG_PERIPHERAL GPIO +#endif + +// GPIO SWV on PA03 +#ifndef SL_DEBUG_SWV_PORT +#define SL_DEBUG_SWV_PORT gpioPortA +#endif +#ifndef SL_DEBUG_SWV_PIN +#define SL_DEBUG_SWV_PIN 3 +#endif +// [GPIO_SL_DEBUG]$ +// <<< sl:end pin_tool >>> + +#endif // SL_DEBUG_SWO_CONFIG_H \ No newline at end of file diff --git a/src/bt_rcp/config/sl_device_init_emu_config.h b/src/bt_rcp/config/sl_device_init_emu_config.h new file mode 100644 index 00000000..f23d055b --- /dev/null +++ b/src/bt_rcp/config/sl_device_init_emu_config.h @@ -0,0 +1,53 @@ +/***************************************************************************//** + * @file + * @brief DEVICE_INIT_EMU Config + ******************************************************************************* + * # License + * Copyright 2019 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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 SL_DEVICE_INIT_EMU_CONFIG_H +#define SL_DEVICE_INIT_EMU_CONFIG_H + +#include "em_emu.h" + +// <<< Use Configuration Wizard in Context Menu >>> + +// Allow debugger to remain connected in EM2 +// Force PD0B to stay on on EM2 entry. This allows the debugger to remain connected in EM2 and EM3. +// Enabling debug connectivity results in an increased power consumption in EM2/EM3. +// Default: 1 +#define SL_DEVICE_INIT_EMU_EM2_DEBUG_ENABLE 1 + +// EM4 pin retention mode +// No Retention: Pads enter reset state when entering EM4. +// Retention through EM4: Pads enter reset state when exiting EM4. +// Retention through EM4 and wakeup. +// Default: emuPinRetentionDisable +#define SL_DEVICE_INIT_EMU_EM4_PIN_RETENTION_MODE emuPinRetentionDisable + +// <<< end of configuration section >>> + +#endif // SL_DEVICE_INIT_EMU_CONFIG_H \ No newline at end of file diff --git a/src/bt_rcp/config/sl_device_init_hfrco_config.h b/src/bt_rcp/config/sl_device_init_hfrco_config.h new file mode 100644 index 00000000..532885ae --- /dev/null +++ b/src/bt_rcp/config/sl_device_init_hfrco_config.h @@ -0,0 +1,57 @@ +/***************************************************************************//** + * @file + * @brief DEVICE_INIT_HFRCO Config + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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 SL_DEVICE_INIT_HFRCO_CONFIG_H +#define SL_DEVICE_INIT_HFRCO_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Frequency Band +// RC Oscillator Frequency Band +// 1 MHz +// 2 MHz +// 4 MHz +// 7 MHz +// 13 MHz +// 16 MHz +// 19 MHz +// 26 MHz +// 32 MHz +// 38 MHz +// 48 MHz +// 56 MHz +// 64 MHz +// 80 MHz +// Default: cmuHFRCODPLLFreq_80M0Hz +#define SL_DEVICE_INIT_HFRCO_BAND cmuHFRCODPLLFreq_80M0Hz + +// <<< end of configuration section >>> + +#endif // SL_DEVICE_INIT_HFRCO_CONFIG_H \ No newline at end of file diff --git a/src/bt_rcp/config/sl_device_init_hfxo_config.h b/src/bt_rcp/config/sl_device_init_hfxo_config.h new file mode 100644 index 00000000..917e60a6 --- /dev/null +++ b/src/bt_rcp/config/sl_device_init_hfxo_config.h @@ -0,0 +1,57 @@ +/***************************************************************************//** + * @file + * @brief DEVICE_INIT_HFXO Config + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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 SL_DEVICE_INIT_HFXO_CONFIG_H +#define SL_DEVICE_INIT_HFXO_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Mode +// +// Crystal oscillator +// External sine wave +// Default: cmuHfxoOscMode_Crystal +#define SL_DEVICE_INIT_HFXO_MODE cmuHfxoOscMode_Crystal + +// Frequency <38000000-40000000> +// Default: 38400000 +#define SL_DEVICE_INIT_HFXO_FREQ 38400000 + +// HFXO precision in PPM <0-65535> +// Default: 50 +#define SL_DEVICE_INIT_HFXO_PRECISION 50 + +// CTUNE <0-255> +// Default: 140 +#define SL_DEVICE_INIT_HFXO_CTUNE 133 + +// <<< end of configuration section >>> + +#endif // SL_DEVICE_INIT_HFXO_CONFIG_H \ No newline at end of file diff --git a/src/bt_rcp/config/sl_device_init_lfxo_config.h b/src/bt_rcp/config/sl_device_init_lfxo_config.h new file mode 100644 index 00000000..29371b6c --- /dev/null +++ b/src/bt_rcp/config/sl_device_init_lfxo_config.h @@ -0,0 +1,88 @@ +/***************************************************************************//** + * @file + * @brief DEVICE_INIT_LFXO Config + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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 SL_DEVICE_INIT_LFXO_CONFIG_H +#define SL_DEVICE_INIT_LFXO_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Mode +// +// Crystal oscillator +// AC-coupled buffer +// External digital clock +// Default: cmuLfxoOscMode_Crystal +#define SL_DEVICE_INIT_LFXO_MODE cmuLfxoOscMode_Crystal + +// CTUNE <0-127> +// Default: 63 +#define SL_DEVICE_INIT_LFXO_CTUNE 79 + +// LFXO precision in PPM <0-65535> +// Default: 50 +#define SL_DEVICE_INIT_LFXO_PRECISION 50 + +// Startup Timeout Delay +// +// 2 cycles +// 256 cycles +// 1K cycles +// 2K cycles +// 4K cycles +// 8K cycles +// 16K cycles +// 32K cycles +// Default: cmuLfxoStartupDelay_4KCycles +#define SL_DEVICE_INIT_LFXO_TIMEOUT cmuLfxoStartupDelay_4KCycles +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> +// SL_DEVICE_INIT_LFXO +// $[LFXO_SL_DEVICE_INIT_LFXO] +#define SL_DEVICE_INIT_LFXO_PERIPHERAL LFXO + +// LFXO LFXTAL_O on PD00 +#define SL_DEVICE_INIT_LFXO_LFXTAL_O_PORT gpioPortD +#define SL_DEVICE_INIT_LFXO_LFXTAL_O_PIN 0 + +// LFXO LFXTAL_I on PD01 +#define SL_DEVICE_INIT_LFXO_LFXTAL_I_PORT gpioPortD +#define SL_DEVICE_INIT_LFXO_LFXTAL_I_PIN 1 + + +// [LFXO_SL_DEVICE_INIT_LFXO]$ + +// $[LFXO_EXTERNAL_DIGITAL_CLOCK] +#define SL_DEVICE_INIT_LFXO_LF_EXTCLK_PORT gpioPortD +#define SL_DEVICE_INIT_LFXO_LF_EXTCLK_PIN 1 +// [LFXO_EXTERNAL_DIGITAL_CLOCK]$ +// <<< sl:end pin_tool >>> + +#endif // SL_DEVICE_INIT_LFXO_CONFIG_H \ No newline at end of file diff --git a/src/bt_rcp/config/sl_mbedtls_config.h b/src/bt_rcp/config/sl_mbedtls_config.h new file mode 100644 index 00000000..5ebefc9a --- /dev/null +++ b/src/bt_rcp/config/sl_mbedtls_config.h @@ -0,0 +1,118 @@ +#ifndef SL_MBEDTLS_CONFIG_H +#define SL_MBEDTLS_CONFIG_H + +// ----------------------------------------------------------------------------- +// User exposed config options + +// <<< Use Configuration Wizard in Context Menu >>> + +// TLS/DTLS configuration + +// Complete list of ciphersuites to use, in order of preference. +// Default: MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 +// Complete list of ciphersuites to use, in order of preference. +// The value of this configuration should be updated for the application needs. +#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 + +// Maximum TLS/DTLS fragment length in bytes (input). +// Default: 768 +// The size configured here determines the size of the internal I/O +// buffer used in mbedTLS when receiving data. +#define SL_MBEDTLS_SSL_IN_CONTENT_LEN 768 + +// Maximum TLS/DTLS fragment length in bytes (output). +// Default: 768 +// The size configured here determines the size of the internal I/O +// buffer used in mbedTLS when sending data. +#define SL_MBEDTLS_SSL_OUT_CONTENT_LEN 768 + +// Enable support for RFC 6066 max_fragment_length extension in SSL. +// Default: 1 +// Enable support for RFC 6066 max_fragment_length extension in SSL. +#define SL_MBEDTLS_SSL_MAX_FRAGMENT_LENGTH 1 + +// Enable support for exporting key block and master secret. +// Default: 1 +// Enable support for exporting key block and master secret. +// This is required for certain users of TLS, e.g. EAP-TLS. +#define SL_MBEDTLS_SSL_EXPORT_KEYS 1 + +// Enable the PSK based ciphersuite modes in SSL / TLS. +// Default: 0 +// Enable the PSK based ciphersuite modes in SSL / TLS. +#define SL_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED 0 + +// Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS. +// Default: 0 +// Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS. +#define SL_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED 0 + +// Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS. +// Default: 0 +// Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS. +#define SL_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED 0 + +// Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS. +// Default: 0 +// Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS. +#define SL_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED 0 + +// Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS. +// Default: 0 +// Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS. +#define SL_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED 0 + +// Enable parsing of the compressed curves. +// Default: 0 +// Enable parsing of the compressed curves. +#define SL_MBEDTLS_ECP_ENABLE_COMPRESSED_CURVE_PARSING 0 + +// + +// RSA configuration + +// Disable use of the Chinese Remainder Theorem for RSA. +// Default: 0 +// Disable use of the Chinese Remainder Theorem for RSA private key +// computations. +#define SL_MBEDTLS_RSA_NO_CRT 0 + +// + +// Miscellaneous configuration + +// Enable Silicon Labs' Mbed TLS- and PSA Crypto drivers. +// Default: 1 +// Enable drivers for hardware acceleration (Mbed TLS and PSA Crypto) and +// secure key handling (PSA Crypto). +#define SL_MBEDTLS_DRIVERS_ENABLED 1 + +// + +// <<< end of configuration section >>> + +// ----------------------------------------------------------------------------- +// Sub-files + +#if defined(SLI_MBEDTLS_CONFIG_AUTOGEN_OVERRIDE_FILE) + #include SLI_MBEDTLS_CONFIG_AUTOGEN_OVERRIDE_FILE +#else + #include "sli_mbedtls_config_autogen.h" +#endif + +#include "sli_mbedtls_omnipresent.h" + +#if SL_MBEDTLS_DRIVERS_ENABLED + #include "sli_mbedtls_acceleration.h" +#endif + +#include "sl_mbedtls_device_config.h" + +// Include transformation logic to apply CMSIS-config configuration options to +// the correct Mbed TLS / PSA Crypto options. +#include "sli_mbedtls_config_transform_autogen.h" + +// Included for backward compatibility reasons. +#include "mbedtls/build_info.h" + +#endif // SL_MBEDTLS_CONFIG_H \ No newline at end of file diff --git a/src/bt_rcp/config/sl_mbedtls_device_config.h b/src/bt_rcp/config/sl_mbedtls_device_config.h new file mode 100644 index 00000000..e286a0d9 --- /dev/null +++ b/src/bt_rcp/config/sl_mbedtls_device_config.h @@ -0,0 +1,72 @@ +#ifndef SL_MBEDTLS_DEVICE_CONFIG_H +#define SL_MBEDTLS_DEVICE_CONFIG_H + +// ----------------------------------------------------------------------------- +// User exposed config options + +// <<< Use Configuration Wizard in Context Menu >>> + +// Secure Engine (SE) version configuration + +// Support SE firmware versions older than 1.2.2 <0-1> +// Enable software fallback for ECDH and ECC public key validation on xG21 +// devices running SE firmware versions lower than 1.2.2. +// +// Due to other stability concerns, it is strongly recommended to upgrade +// these devices to the latest firmware revision instead of turning on +// software fallback support. +// +// Not having fallback support will make ECDH operations, as well as PSA +// Crypto public key import, return an error code on affected devices. +// +// Default: 0 +#define SL_SE_SUPPORT_FW_PRIOR_TO_1_2_2 0 + +// Assume an SE firmware version newer than 1.2.2 <0-1> +// For enhanced performance: if it is guaranteed that all devices on which +// this library will run are updated to at least SE FW 1.2.2, then turning +// on this option will remove certain fallback checks, thereby reducing the +// amount of processing required for ECDH and public key verification +// operations. +// Default: 0 +#define SL_SE_ASSUME_FW_AT_LEAST_1_2_2 0 + +// Assume an SE firmware version that is unaffected by Ed25519 errata <0-1> +// For minimal code size and performance savings: if it is guaranteed that +// none of the devices running this library has SE FWs in the range +// [1.2.2, 1.2.8], then enabling this option will disable runtime version +// checks. +// Default: 0 +#define SL_SE_ASSUME_FW_UNAFFECTED_BY_ED25519_ERRATA 0 + +// + +// <<< end of configuration section >>> + +// ----------------------------------------------------------------------------- +// Additional SE version related logic (DO NOT MODIFY) + +// SL_SE_ASSUME_FW_AT_LEAST_1_2_10 is no longer in use, however, it is kept here +// for backwards compatibility. */ +#if defined(SL_SE_ASSUME_FW_AT_LEAST_1_2_10) + #undef SL_SE_ASSUME_FW_AT_LEAST_1_2_2 + #define SL_SE_ASSUME_FW_AT_LEAST_1_2_2 1 + #undef SL_SE_ASSUME_FW_UNAFFECTED_BY_ED25519_ERRATA + #define SL_SE_ASSUME_FW_UNAFFECTED_BY_ED25519_ERRATA 1 +#endif + +// SLI_SE_SUPPORT_FW_PRIOR_TO_1_2_2 is no longer in use, however, it is kept +// here for backwards compatibility. */ +#if defined(SLI_SE_SUPPORT_FW_PRIOR_TO_1_2_2) + #undef SL_SE_SUPPORT_FW_PRIOR_TO_1_2_2 + #define SL_SE_SUPPORT_FW_PRIOR_TO_1_2_2 1 +#endif + +// SLI_SE_ASSUME_FW_AT_LEAST_1_2_2 is no longer in use, however, it is kept +// here for backwards compatibility. */ +#if defined(SLI_SE_ASSUME_FW_AT_LEAST_1_2_2) + #undef SL_SE_ASSUME_FW_AT_LEAST_1_2_2 + #define SL_SE_ASSUME_FW_AT_LEAST_1_2_2 1 +#endif + +#endif // SL_MBEDTLS_DEVICE_CONFIG_H \ No newline at end of file diff --git a/src/bt_rcp/config/sl_memory_config.h b/src/bt_rcp/config/sl_memory_config.h new file mode 100644 index 00000000..75b482ee --- /dev/null +++ b/src/bt_rcp/config/sl_memory_config.h @@ -0,0 +1,28 @@ +#ifndef SL_MEMORY_CONFIG_H +#define SL_MEMORY_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> +// Memory configuration + +// Stack size for the application. +// Default: 4096 +// The stack size configured here will be used by the stack that the +// application uses when coming out of a reset. +#ifndef SL_STACK_SIZE + #define SL_STACK_SIZE 4096 +#endif + +// Minimum heap size for the application. +// Default: 2048 +// Note that this value will configure the c heap which is normally used by +// malloc() and free() from the c library. The value defines a minimum heap +// size that is guaranteed to be available. The available heap may be larger +// to make use of any memory that would otherwise remain unused. +#ifndef SL_HEAP_SIZE + #define SL_HEAP_SIZE 11000 +#endif + +// +// <<< end of configuration section >>> + +#endif diff --git a/src/bt_rcp/config/sl_rail_util_pa_config.h b/src/bt_rcp/config/sl_rail_util_pa_config.h new file mode 100644 index 00000000..84b836c2 --- /dev/null +++ b/src/bt_rcp/config/sl_rail_util_pa_config.h @@ -0,0 +1,81 @@ +/***************************************************************************//** + * @file + * @brief Power Amplifier configuration file. + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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 SL_RAIL_UTIL_PA_CONFIG_H +#define SL_RAIL_UTIL_PA_CONFIG_H + +#include "rail_types.h" + +// <<< Use Configuration Wizard in Context Menu >>> + +// PA Configuration +// Initial PA Power (deci-dBm, 100 = 10.0 dBm) +// Default: 100 +#define SL_RAIL_UTIL_PA_POWER_DECI_DBM 100 +// PA Ramp Time (microseconds) +// <0-65535:1> +// Default: 10 +#define SL_RAIL_UTIL_PA_RAMP_TIME_US 10 +// Milli-volts on PA supply pin (PA_VDD) +// <0-65535:1> +// Default: 3300 +#define SL_RAIL_UTIL_PA_VOLTAGE_MV 1800 +// 2.4 GHz PA Selection +// Highest Possible +// High Power (chip-specific) +// Medium Power (chip-specific) +// Low Power +// Disable +// Default: RAIL_TX_POWER_MODE_2P4GIG_HIGHEST +#define SL_RAIL_UTIL_PA_SELECTION_2P4GHZ RAIL_TX_POWER_MODE_2P4GIG_HIGHEST +// Sub-1 GHz PA Selection +// Disable +// Default: RAIL_TX_POWER_MODE_NONE +#define SL_RAIL_UTIL_PA_SELECTION_SUBGHZ RAIL_TX_POWER_MODE_NONE +// + +// PA Curve Configuration +// Header file containing custom PA curves +// Default: "pa_curves_efr32.h" +#define SL_RAIL_UTIL_PA_CURVE_HEADER "pa_curves_efr32.h" +// Header file containing PA curve types +// Default: "pa_curve_types_efr32.h" +#define SL_RAIL_UTIL_PA_CURVE_TYPES "pa_curve_types_efr32.h" +// + +// PA Calibration Configuration +// Apply PA Calibration Factory Offset +// Default: 1 +#define SL_RAIL_UTIL_PA_CALIBRATION_ENABLE 1 +// + +// <<< end of configuration section >>> + +#endif // SL_RAIL_UTIL_PA_CONFIG_H \ No newline at end of file diff --git a/src/bt_rcp/config/sl_rail_util_rf_path_config.h b/src/bt_rcp/config/sl_rail_util_rf_path_config.h new file mode 100644 index 00000000..464e91c3 --- /dev/null +++ b/src/bt_rcp/config/sl_rail_util_rf_path_config.h @@ -0,0 +1,48 @@ +/***************************************************************************//** + * @file + * @brief + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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 SL_RAIL_UTIL_RF_PATH_CONFIG_H +#define SL_RAIL_UTIL_RF_PATH_CONFIG_H + +#include "rail_types.h" + +// <<< Use Configuration Wizard in Context Menu >>> + +// Chip-internal RF Path Configuration +// RF Path Mode +// Path 0 +// Path 1 +// Default: RAIL_ANTENNA_1 +#define SL_RAIL_UTIL_RF_PATH_INT_RF_PATH_MODE RAIL_ANTENNA_1 +// + +// <<< end of configuration section >>> + +#endif // SL_RAIL_UTIL_RF_PATH_CONFIG_H \ No newline at end of file diff --git a/src/bt_rcp/config/sl_sleeptimer_config.h b/src/bt_rcp/config/sl_sleeptimer_config.h new file mode 100644 index 00000000..bba646d6 --- /dev/null +++ b/src/bt_rcp/config/sl_sleeptimer_config.h @@ -0,0 +1,82 @@ +/***************************************************************************//** + * @file + * @brief Sleep Timer configuration file. + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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. + * + ******************************************************************************/ + +// <<< Use Configuration Wizard in Context Menu >>> + +#ifndef SL_SLEEPTIMER_CONFIG_H +#define SL_SLEEPTIMER_CONFIG_H + +#define SL_SLEEPTIMER_PERIPHERAL_DEFAULT 0 +#define SL_SLEEPTIMER_PERIPHERAL_RTCC 1 +#define SL_SLEEPTIMER_PERIPHERAL_PRORTC 2 +#define SL_SLEEPTIMER_PERIPHERAL_RTC 3 +#define SL_SLEEPTIMER_PERIPHERAL_SYSRTC 4 +#define SL_SLEEPTIMER_PERIPHERAL_BURTC 5 +#define SL_SLEEPTIMER_PERIPHERAL_WTIMER 6 +#define SL_SLEEPTIMER_PERIPHERAL_TIMER 7 + +// Timer Peripheral Used by Sleeptimer +// Default (auto select) +// RTCC +// Radio internal RTC (PRORTC) +// RTC +// SYSRTC +// Back-Up RTC (BURTC) +// WTIMER +// TIMER +// Selection of the Timer Peripheral Used by the Sleeptimer +#define SL_SLEEPTIMER_PERIPHERAL SL_SLEEPTIMER_PERIPHERAL_DEFAULT + +// TIMER/WTIMER Instance Used by Sleeptimer (not applicable for other peripherals) +// Make sure TIMER instance size is 32bits. Check datasheet for 32bits TIMERs. +// Default: 0 +#define SL_SLEEPTIMER_TIMER_INSTANCE 0 + +// Enable wallclock functionality +// Enable or disable wallclock functionalities (get_time, get_date, etc). +// Default: 0 +#define SL_SLEEPTIMER_WALLCLOCK_CONFIG 0 + +// Timer frequency divider (not applicable for WTIMER/TIMER) +// WTIMER/TIMER peripherals are always prescaled to 1024. +// Default: 1 +#define SL_SLEEPTIMER_FREQ_DIVIDER 1 + +// If Radio internal RTC (PRORTC) HAL is used, determines if it owns the IRQ handler. Enable, if no wireless stack is used. +// Default: 0 +#define SL_SLEEPTIMER_PRORTC_HAL_OWNS_IRQ_HANDLER 0 + +// Enable DEBUGRUN functionality on hardware RTC. +// Default: 0 +#define SL_SLEEPTIMER_DEBUGRUN 0 + +#endif /* SLEEPTIMER_CONFIG_H */ + +// <<< end of configuration section >>> \ No newline at end of file diff --git a/src/bt_rcp/config/sl_uartdrv_usart_vcom_config.h b/src/bt_rcp/config/sl_uartdrv_usart_vcom_config.h new file mode 100644 index 00000000..bbc144e8 --- /dev/null +++ b/src/bt_rcp/config/sl_uartdrv_usart_vcom_config.h @@ -0,0 +1,133 @@ +/***************************************************************************//** + * @file + * @brief UARTDRV_USART Config + ******************************************************************************* + * # License + * Copyright 2019 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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 SL_UARTDRV_USART_VCOM_CONFIG_H +#define SL_UARTDRV_USART_VCOM_CONFIG_H + +#include "em_usart.h" +// <<< Use Configuration Wizard in Context Menu >>> + +// UART settings +// Baud rate +// Default: 115200 +#define SL_UARTDRV_USART_VCOM_BAUDRATE 115200 + +// Parity mode to use +// No Parity +// Even parity +// Odd parity +// Default: usartNoParity +#define SL_UARTDRV_USART_VCOM_PARITY usartNoParity + +// Number of stop bits to use. +// 0.5 stop bits +// 1 stop bits +// 1.5 stop bits +// 2 stop bits +// Default: usartStopbits1 +#define SL_UARTDRV_USART_VCOM_STOP_BITS usartStopbits1 + +// Flow control method +// None +// Software XON/XOFF +// nRTS/nCTS hardware handshake +// UART peripheral controls nRTS/nCTS +// Default: uartdrvFlowControlHwUart +#define SL_UARTDRV_USART_VCOM_FLOW_CONTROL_TYPE uartdrvFlowControlNone + +// Oversampling selection +// 16x oversampling +// 8x oversampling +// 6x oversampling +// 4x oversampling +// Default: usartOVS16 +#define SL_UARTDRV_USART_VCOM_OVERSAMPLING usartOVS4 + +// Majority vote disable for 16x, 8x and 6x oversampling modes +// True +// False +#define SL_UARTDRV_USART_VCOM_MVDIS false + +// Size of the receive operation queue +// Default: 6 +#define SL_UARTDRV_USART_VCOM_RX_BUFFER_SIZE 6 + +// Size of the transmit operation queue +// Default: 6 +#define SL_UARTDRV_USART_VCOM_TX_BUFFER_SIZE 6 + +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> +// SL_UARTDRV_USART_VCOM +// $[USART_SL_UARTDRV_USART_VCOM] +#ifndef SL_UARTDRV_USART_VCOM_PERIPHERAL +#define SL_UARTDRV_USART_VCOM_PERIPHERAL USART0 +#endif +#ifndef SL_UARTDRV_USART_VCOM_PERIPHERAL_NO +#define SL_UARTDRV_USART_VCOM_PERIPHERAL_NO 0 +#endif + +// USART0 TX on PA05 +#ifndef SL_UARTDRV_USART_VCOM_TX_PORT +#define SL_UARTDRV_USART_VCOM_TX_PORT gpioPortA +#endif +#ifndef SL_UARTDRV_USART_VCOM_TX_PIN +#define SL_UARTDRV_USART_VCOM_TX_PIN 5 +#endif + +// USART0 RX on PA06 +#ifndef SL_UARTDRV_USART_VCOM_RX_PORT +#define SL_UARTDRV_USART_VCOM_RX_PORT gpioPortA +#endif +#ifndef SL_UARTDRV_USART_VCOM_RX_PIN +#define SL_UARTDRV_USART_VCOM_RX_PIN 6 +#endif + +// USART0 CTS on PC03 +#ifndef SL_UARTDRV_USART_VCOM_CTS_PORT +#define SL_UARTDRV_USART_VCOM_CTS_PORT gpioPortC +#endif +#ifndef SL_UARTDRV_USART_VCOM_CTS_PIN +#define SL_UARTDRV_USART_VCOM_CTS_PIN 3 +#endif + +// USART0 RTS on PC02 +#ifndef SL_UARTDRV_USART_VCOM_RTS_PORT +#define SL_UARTDRV_USART_VCOM_RTS_PORT gpioPortC +#endif +#ifndef SL_UARTDRV_USART_VCOM_RTS_PIN +#define SL_UARTDRV_USART_VCOM_RTS_PIN 2 +#endif +// [USART_SL_UARTDRV_USART_VCOM]$ +// <<< sl:end pin_tool >>> + +#endif // SL_UARTDRV_USART_VCOM_CONFIG_H \ No newline at end of file diff --git a/src/bt_rcp/config/uartdrv_config.h b/src/bt_rcp/config/uartdrv_config.h new file mode 100644 index 00000000..e82ed6a4 --- /dev/null +++ b/src/bt_rcp/config/uartdrv_config.h @@ -0,0 +1,114 @@ +/***************************************************************************//** + * @file + * @brief UARTDRV configuration file. + ******************************************************************************* + * # License + * Copyright 2018 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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 __SILICON_LABS_UARTDRV_CONFIG_H__ +#define __SILICON_LABS_UARTDRV_CONFIG_H__ + +/***************************************************************************//** + * @addtogroup uartdrv + * @{ + ******************************************************************************/ +/// Size of the receive operation queue. +/// @details +/// The maximum number of receive operations that can be queued up for one +/// driver instance before @ref UARTDRV_Receive() returns +/// @ref ECODE_EMDRV_UARTDRV_QUEUE_FULL. +/// @note +/// This macro is not used by the UARTDRV itself, but is intended to be used +/// with the @ref DEFINE_BUF_QUEUE macro by the user of the driver to allocate +/// instances of the @ref UARTDRV_Buffer_FifoQueue_t struct. +#if !defined(EMDRV_UARTDRV_MAX_CONCURRENT_RX_BUFS) +#define EMDRV_UARTDRV_MAX_CONCURRENT_RX_BUFS 6 +#endif + +/// Size of the transmit operation queue. +/// @details +/// The maximum number of transmit operations that can be queued up for one +/// driver instance before @ref UARTDRV_Transmit() returns +/// @ref ECODE_EMDRV_UARTDRV_QUEUE_FULL. +/// @note +/// This macro is not used by the UARTDRV itself, but is intended to be used +/// with the @ref DEFINE_BUF_QUEUE macro by the user of the driver to allocate +/// instances of the @ref UARTDRV_Buffer_FifoQueue_t struct. +#if !defined(EMDRV_UARTDRV_MAX_CONCURRENT_TX_BUFS) +#define EMDRV_UARTDRV_MAX_CONCURRENT_TX_BUFS 6 +#endif + +// <<< Use Configuration Wizard in Context Menu >>> +// UARTDRV Settings + +/// Set to 1 to include flow control support +#if !defined(EMDRV_UARTDRV_FLOW_CONTROL_ENABLE) +// Flow control support +// <1=> Enable +// <0=> Disable +// Default: 1 +#define EMDRV_UARTDRV_FLOW_CONTROL_ENABLE 1 +#endif + +/// Maximum number of driver instances. +#if !defined(EMDRV_UARTDRV_MAX_DRIVER_INSTANCES) +// Maximum number of driver instances +// This maximum only applies when UARTDRV_FLOW_CONTROL_ENABLE = 1 +// Default: 4 +#define EMDRV_UARTDRV_MAX_DRIVER_INSTANCES 4 +#endif + +/// UART software flow control code: request peer to start TX +#if !defined(UARTDRV_FC_SW_XON) +// UART software flow control code: request peer to start TX +// Default: 0x11 +#define UARTDRV_FC_SW_XON 0x11 +#endif + +/// UART software flow control code: request peer to stop TX +#if !defined(UARTDRV_FC_SW_XOFF) +// UART software flow control code: request peer to stop TX +// Default: 0x13 +#define UARTDRV_FC_SW_XOFF 0x13 +#endif + +/// UART enable reception when sleeping. +#if !defined(UARTDRV_RESTRICT_ENERGY_MODE_TO_ALLOW_RECEPTION) +// Enable reception when sleeping +// Enable reception when sleeping will use the power manager and add EM1 +// requirement during receive operations that use DMA. +// <1=> Enable +// <0=> Disable +// Default: 1 +#define UARTDRV_RESTRICT_ENERGY_MODE_TO_ALLOW_RECEPTION 1 +#endif + +// + +// <<< end of configuration section >>> + +/** @} (end addtogroup uartdrv) */ + +#endif /* __SILICON_LABS_UARTDRV_CONFIG_H__ */ \ No newline at end of file diff --git a/src/bt_rcp/gbl_metadata.yaml b/src/bt_rcp/gbl_metadata.yaml new file mode 100644 index 00000000..0cf09113 --- /dev/null +++ b/src/bt_rcp/gbl_metadata.yaml @@ -0,0 +1,2 @@ +baudrate: 115200 +fw_type: bt_rcp diff --git a/src/bt_rcp/image/readme_img0.png b/src/bt_rcp/image/readme_img0.png new file mode 100644 index 00000000..d0b0c020 Binary files /dev/null and b/src/bt_rcp/image/readme_img0.png differ diff --git a/src/bt_rcp/image/readme_img1.png b/src/bt_rcp/image/readme_img1.png new file mode 100644 index 00000000..b7bd4530 Binary files /dev/null and b/src/bt_rcp/image/readme_img1.png differ diff --git a/src/bt_rcp/image/readme_img2.png b/src/bt_rcp/image/readme_img2.png new file mode 100644 index 00000000..be675a03 Binary files /dev/null and b/src/bt_rcp/image/readme_img2.png differ diff --git a/src/bt_rcp/image/readme_img3.png b/src/bt_rcp/image/readme_img3.png new file mode 100644 index 00000000..81fc1128 Binary files /dev/null and b/src/bt_rcp/image/readme_img3.png differ diff --git a/src/bt_rcp/image/readme_img4.png b/src/bt_rcp/image/readme_img4.png new file mode 100644 index 00000000..76291ef1 Binary files /dev/null and b/src/bt_rcp/image/readme_img4.png differ diff --git a/src/bt_rcp/main.c b/src/bt_rcp/main.c new file mode 100644 index 00000000..b874b151 --- /dev/null +++ b/src/bt_rcp/main.c @@ -0,0 +1,71 @@ +/***************************************************************************//** + * @file + * @brief main() function. + ******************************************************************************* + * # License + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * 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 "sl_component_catalog.h" +#include "sl_system_init.h" +#include "app.h" +#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) +#include "sl_power_manager.h" +#endif +#if defined(SL_CATALOG_KERNEL_PRESENT) +#include "sl_system_kernel.h" +#else // SL_CATALOG_KERNEL_PRESENT +#include "sl_system_process_action.h" +#endif // SL_CATALOG_KERNEL_PRESENT + +int main(void) +{ + // Initialize Silicon Labs device, system, service(s) and protocol stack(s). + // Note that if the kernel is present, processing task(s) will be created by + // this call. + sl_system_init(); + + // Initialize the application. For example, create periodic timer(s) or + // task(s) if the kernel is present. + app_init(); + +#if defined(SL_CATALOG_KERNEL_PRESENT) + // Start the kernel. Task(s) created in app_init() will start running. + sl_system_kernel_start(); +#else // SL_CATALOG_KERNEL_PRESENT + while (1) { + // Do not remove this call: Silicon Labs components process action routine + // must be called from the super loop. + sl_system_process_action(); + + // Application process. + app_process_action(); + +#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) + // Let the CPU go to sleep if the system allows it. + sl_power_manager_sleep(); +#endif + } +#endif // SL_CATALOG_KERNEL_PRESENT +} diff --git a/src/bt_rcp/readme.md b/src/bt_rcp/readme.md new file mode 100644 index 00000000..c68576d5 --- /dev/null +++ b/src/bt_rcp/readme.md @@ -0,0 +1,107 @@ +# RCP + +The RCP (Radio Co-Processor)) example application runs the Bluetooth Controller (radio + Link Layer) and implements the controller part of the HCI, as defined in the *Bluetooth Core Specification, Vol 4: Host Controller Interface*. The HCI is a standardized way for Bluetooth host and controller to communicate with each other. Because the interface is standard, the host and controller can be from different vendors. Currently, Silicon Labs Bluetooth Controller supports UART (Universal Asynchronous Receiver-Transmitter) as the HCI transport layer. + +> Note: this example expects a specific Gecko Bootloader to be present on your device. For details see the Troubleshooting section. + +## Getting Started + +To get started with Silicon Labs Bluetooth and Simplicity Studio, see [QSG169: Bluetooth SDK v3.x Quick Start Guide](https://www.silabs.com/documents/public/quick-start-guides/qsg169-bluetooth-sdk-v3x-quick-start-guide.pdf). + +## HCI Protocol + +The HCI layer provides set of commands and events and ACL data packets. The Host sends commands to the controller. The commands are used to start advertising or scanning, establish a connection to another Bluetooth device, read status information from the controller, and so on. + +Events are sent from the Controller side to the Host. Events are used as a response to commands or to indicate various events in the controller such as scanning reports, establishing or closing a connection, and various failures. + +Silicon Labs Bluetooth LE Controller runs on EFR32 Radio Co-Processors. External Bluetooth Host stacks communicates with the controller over the HCI, also called RCP mode, as shown in the following figure. + +![](image/readme_img1.png) + +For more details, see [AN1328: Enabling a Radio Co-Processor using the Bluetooth HCI Function](https://www.silabs.com/documents/public/application-notes/an1328-enabling-rcp-using-bt-hci.pdf) + +## Supported Modes + +ACL (Asynchronous Connection Less) data packets deliver user application data between the host and the controller in both directions. + +The Silicon Labs Bluetooth LE Controller does not support SCO (Synchronous Connection Oriented) and ISOC (Isochronous Channels) modes. Also, the related HCI messages are not supported. + +The Bluetooth specification defines Low Energy (LE), BR/EDR (classic), and AMP (alternate MAC and PHY) controllers. Note that Silicon Labs only supports the LE controller. + +## Communication Interface + +The application uses UART as the HCI Transport layer. By default, UART is configured as follows: + - Hardware flow control: disabled + - Speed: 115200 kbps + - Data bits: 8 + - Parity bit: N + - Stop bits: 1 + +The default configuration can be changed with the **vcom** component. For more details about the customization of the project, see [AN1328: Enabling a Radio Co-Processor using the Bluetooth HCI Function](https://www.silabs.com/documents/public/application-notes/an1328-enabling-rcp-using-bt-hci.pdf). + +## Usage + +Because HCI is a standardized interface, it can be used with any Host that implements the HCI via UART. For example, it can be used with the BlueZ stack included in Linux systems. Connect your device flashed with the RCP firmware to your system. Then, attach it as a HCI device with the command *btattach*: + +![](image/readme_img2.png) + +Now, it can be controlled with any tool that uses HCI commands, e.g., *bluetoothctl* : + +![](image/readme_img3.png) + +![](image/readme_img4.png) + +## Troubleshooting + +### Bootloader Issues + +Note that Example Projects do not include a bootloader. However, Bluetooth-based Example Projects expect a bootloader to be present on the device in order to support device firmware upgrade (DFU). To get your application to work, you should either +- flash the proper bootloader or +- remove the DFU functionality from the project. + +**If you do not wish to add a bootloader**, then remove the DFU functionality by uninstalling the *Bootloader Application Interface* software component -- and all of its dependants. This will automatically put your application code to the start address of the flash, which means that a bootloader is no longer needed, but also that you will not be able to upgrade your firmware. + +**If you want to add a bootloader**, then either +- Create a bootloader project, build it and flash it to your device. Note that different projects expect different bootloaders: + - for NCP and RCP projects create a *BGAPI UART DFU* type bootloader + - for SoC projects on Series 1 devices create a *Bluetooth in-place OTA DFU* type bootloader or any *Internal Storage* type bootloader + - for SoC projects on Series 2 devices create a *Bluetooth Apploader OTA DFU* type bootloader + +- or run a precompiled Demo on your device from the Launcher view before flashing your application. Precompiled demos flash both bootloader and application images to the device. Flashing your own application image after the demo will overwrite the demo application but leave the bootloader in place. + - For NCP and RCP projects, flash the *Bluetooth - NCP* demo. + - For SoC projects, flash the *Bluetooth - SoC Thermometer* demo. + +**Important Notes:** +- when you flash your application image to the device, use the *.hex* or *.s37* output file. Flashing *.bin* files may overwrite (erase) the bootloader. + +- On Series 1 devices (EFR32xG1x), both first stage and second stage bootloaders have to be flashed. This can be done at once by flashing the *-combined.s37* file found in the bootloader project after building the project. + +- On Series 2 devices SoC example projects require a *Bluetooth Apploader OTA DFU* type bootloader by default. This bootloader needs a lot of flash space and does not fit into the regular bootloader area, hence the application start address must be shifted. This shift is automatically done by the *Apploader Support for Applications* software component, which is installed by default. If you want to use any other bootloader type, you should remove this software component in order to shift the application start address back to the end of the regular bootloader area. Note, that in this case you cannot do OTA DFU with Apploader, but you can still implement application-level OTA DFU by installing the *Application OTA DFU* software component instead of *In-place OTA DFU*. + +For more information on bootloaders, see [UG103.6: Bootloader Fundamentals](https://www.silabs.com/documents/public/user-guides/ug103-06-fundamentals-bootloading.pdf) and [UG489: Silicon Labs Gecko Bootloader User's Guide for GSDK 4.0 and Higher](https://cn.silabs.com/documents/public/user-guides/ug489-gecko-bootloader-user-guide-gsdk-4.pdf). + + +### Programming the Radio Board + +Before programming the radio board mounted on the mainboard, make sure the power supply switch is in the AEM position (right side) as shown below. + +![Radio board power supply switch](image/readme_img0.png) + + +## Resources + +[Bluetooth Documentation](https://docs.silabs.com/bluetooth/latest/) + +[UG103.14: Bluetooth LE Fundamentals](https://www.silabs.com/documents/public/user-guides/ug103-14-fundamentals-ble.pdf) + +[QSG169: Bluetooth SDK v3.x Quick Start Guide](https://www.silabs.com/documents/public/quick-start-guides/qsg169-bluetooth-sdk-v3x-quick-start-guide.pdf) + +[UG434: Silicon Labs Bluetooth ® C Application Developer's Guide for SDK v3.x](https://www.silabs.com/documents/public/user-guides/ug434-bluetooth-c-soc-dev-guide-sdk-v3x.pdf) + +[Bluetooth Training](https://www.silabs.com/support/training/bluetooth) + + + +## Report Bugs & Get Support + +You are always encouraged and welcome to report any issues you found via [Silicon Labs Community](https://www.silabs.com/community). \ No newline at end of file diff --git a/src/ncp-uart-hw/.cproject b/src/ncp-uart-hw/.cproject index 6f295900..cc151c60 100644 --- a/src/ncp-uart-hw/.cproject +++ b/src/ncp-uart-hw/.cproject @@ -23,7 +23,7 @@ - + @@ -195,6 +195,7 @@ + + + + +