cpu/cc26xx_cc13xx: add & link CCFG configuration #14219
cpu/cc26xx_cc13xx: add & link CCFG configuration #14219benpicco merged 3 commits intoRIOT-OS:masterfrom
Conversation
4a713ff to
752707e
Compare
|
I'll see if I can go without vendor code and reuse CCFG code on |
576a229 to
d13bec0
Compare
4cf274a to
fb22c6f
Compare
|
I tried another approach at solving this. Uses Kconfig to let the user select if they want to update the CCFG. Building with "Update CCFG"Without "Update CCFG". Notice that .ccfg section doesn't existThe only thing left is testing and review of the code, I'll test for possible errors as I need to be careful with this, as a bad configuration can brick the Launchpads as happened before to me 😓 . |
|
Update: tested and works like a charm :) This is the comparision of three hex dumps of the ccfg section, first one with bootloader backdoor enabled (:tada: cc2538-bsl may be useable as a flash option in the near future), second one without anything, the default, and the third with bootloader backdoor + VDDR high which is needed for +14 dBm PA on CC13xx devices. This also should work on |
| #define SET_MODE_CONF_1_ALT_DCDC_IPEAK 0x2 /**< 32 mA */ | ||
| #define SET_MODE_CONF_XOSC_FREQ 0x3 /**< 24 MHz xtal */ |
There was a problem hiding this comment.
Should the board config be able to overwrite those?
There was a problem hiding this comment.
Not really, AFAIK most of the boards using cc26x0/cc13x0 provide the option to select a 48 MHz crystal, however I haven't seen any out there, and on the guide for crystal selection only makes mention on 24 MHz crystal for cc26x0/cc13x0 CPUs, it's the same for cc26x2/cc13x2 as only 48 MHz crystals are used.
However, should I add a #ifndef guard for future proofing 👀 ?
There was a problem hiding this comment.
If other frequencies are possible, we should allow for custom boards to use them.
Adding an #ifndef won’t hurt.
| #define SET_MODE_CONF_1_ALT_DCDC_IPEAK 0x2 /**< 12 mA */ | ||
| #define SET_MODE_CONF_XOSC_FREQ 0x2 /**< 48 MHz xtal */ |
| #endif | ||
|
|
||
| #ifndef SET_MODE_CONF_VDDS_BOD_LEVEL | ||
| #define SET_MODE_CONF_VDDS_BOD_LEVEL 0x1 /**< 1.8 V or 1.65 V */ |
There was a problem hiding this comment.
Which is which? (0 -> 1.65V, 1 -> 1.8V? Or the other way round?)
|
Comments addressed, added documentation to individual settings. Fixed a bug on .ccfg section on cc2650-launchpad at the correct address |
718e026 to
72e7936
Compare
|
Comments addressed, fixed a couple nits on cc26x0 such as the ROM length and disabling options on CCFG/Kconfig that aren't available for that family. |
This add a custom ldscript for cc26xx_cc13xx CPUs, which allows linking CCFG configuration, usage of GPRAM, etc. Signed-off-by: Jean Pierre Dudey <[email protected]>
This adds almost all registers necessary to flash create the CCFG configuration. Signed-off-by: Jean Pierre Dudey <[email protected]>
> Allows flahsing CCFG configuration using Kconfig, formely "make menuconfig". > Supports cc26x0, cc26x2_cc13x2. > Can be used to enable bootloader backdoor, to use cc2538-bsl flashing script. > Not all options are in Kconfig, most important ones, others can be added in further commits. > On cc13xx targets the VDDR high option can be enabled using Kconfig. > With this, RIOT can flash blank chips and the firmware will run just fine. Signed-off-by: Jean Pierre Dudey <[email protected]>
72e7936 to
447cdeb
Compare
benpicco
left a comment
There was a problem hiding this comment.
Looks good to me.
Writing the config section is disabled by default, so this should do no harm.

Contribution description
The CCFG is the Customer Configuration, this enables us to change it at compile time.
cc26x2_cc13x2processors, describing the memory regions correctly.352Kto360360bytes (351.9140625Kor0x57FA8) which is the real size.FORCE_VDDR_HHconfiguration option. Enables the usage of +14 dBm PA at the cost of higher current consumption. Disabled by default.More options when needed (such as the bootloader) can added.
The
cc26x2_cc13x2based boards pass thecortexm_common_ldscripttest, should I whitelist them?Testing procedure
CFLAGS="-DCONFIG_CC26XX_CC13XX_UPDATE_CCFG=1" make flash BOARD=cc1312-launchpadmake menuconfigand selecting the option to update the CCFG.Issues/PRs references
See also #13635