Skip to content
Permalink
Browse files

soc: cc13x2_cc26x2: support setting CCFG values via Kconfig

Several customer configuration (CCFG) settings are useful for
development and deployment. This commit adds support for setting CCFG
values via Kconfig. It follows TI's recommendation of setting CCFG
values and then including the TI provided CCFG. This commit includes
support for enabling the ROM bootloader and additional settings can be
added as needed.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
  • Loading branch information...
bwitherspoon authored and nashif committed May 14, 2019
1 parent eb73a32 commit e8ac49566029d45054411760a3c8daaaf2aaef83
@@ -13,6 +13,4 @@ zephyr_library_sources(
driverlib/aux_sysif.c
# Required for CPUdelay which is not in ROM
driverlib/cpu.c
# Required for default CCFG confguration
startup_files/ccfg.c
)
@@ -3,3 +3,4 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_sources(soc.c)
zephyr_sources(ccfg.c)
@@ -16,3 +16,38 @@ config SOC_CC1352R
bool "CC1352R"

endchoice

menu "Customer Configuration (CCFG)"
depends on SOC_SERIES_CC13X2_CC26X2

config CC13X2_CC26X2_BOOTLOADER_ENABLE
bool "ROM bootloader"
help
Enable the serial bootloader which resides in ROM on CC13xx / CC26xx
devices.

config CC13X2_CC26X2_BOOTLOADER_BACKDOOR_ENABLE
bool "ROM bootloader backdoor"
depends on CC13X2_CC26X2_BOOTLOADER_ENABLE
help
Enable the ROM bootloader backdoor which starts the bootloader if the
associated pin is at the correct logic level on reset.

config CC13X2_CC26X2_BOOTLOADER_BACKDOOR_PIN
int "ROM bootloader backdoor pin"
depends on CC13X2_CC26X2_BOOTLOADER_BACKDOOR_ENABLE
range 0 255
default 255
help
Set the pin that is level checked if the bootloader backdoor is
enabled.

config CC13X2_CC26X2_BOOTLOADER_BACKDOOR_LEVEL
int "ROM bootloader backdoor level"
depends on CC13X2_CC26X2_BOOTLOADER_BACKDOOR_ENABLE
range 0 1
default 0
help
Set the active level of the pin selected for the bootloader backdoor.

endmenu
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2019 Brett Witherspoon
*
* SPDX-License-Identifier: Apache-2.0
*/

#ifdef CONFIG_CC13X2_CC26X2_BOOTLOADER_ENABLE
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5
#else
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0x00
#endif /* CONFIG_CC13X2_CC26X2_BOOTLOADER_ENABLE */

#ifdef CONFIG_CC13X2_CC26X2_BOOTLOADER_BACKDOOR_ENABLE
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xC5
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER CONFIG_CC13X2_CC26X2_BOOTLOADER_BACKDOOR_PIN
#define SET_CCFG_BL_CONFIG_BL_LEVEL CONFIG_CC13X2_CC26X2_BOOTLOADER_BACKDOOR_LEVEL
#else
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0x00
#endif /* CONFIG_CC13X2_CC26X2_BOOTLOADER_BACKDOOR_ENABLE */

/* TI recommends setting CCFG values and then including the TI provided ccfg.c */
#include <startup_files/ccfg.c>

0 comments on commit e8ac495

Please sign in to comment.
You can’t perform that action at this time.