SWCU193A April 2023 – August 2024 CC2340R2 , CC2340R5 , CC2340R5-Q1
The CCFG flash sector contains meta-information about or for the application:
Debug permissions and optional authorization options
For regular software application development, the TI supported SysConfig tool is used to create the contents of the CCFG.
This section covers only the main parts of the CCFG. For a detailed view of the CCFG structure please refer to the hw_ccfg.h file provided by the DriverLib part of the SimpleLink™ CC23xx Software Development Kit (SDK) or the SysConfig tool.
The C header file, hw_ccfg.h, provides a struct defining the complete CCFG layout.
Please note that minor updates of the CCFG field description (hw_fcfg.h) can occur as part of a Product SDK release.
The CCFG structure is split into sections, each having multiple fields. Table 9-3 presents a high level view of CCFG sections.
Most sections contain multiple fields. Only a subset of the fields are listed.
The CRCs use CRC-32, which has the following implementation:
0x04C11DB7.
0xFFFFFFFF.
There are four different CRCs used to validate the CCFG data. One of the CRCs, the user record CRC, is optional and is the last four bytes of the 128B user record. The data over which the CRC is calculated starts at “Data Start Offset” from Table 9-2 and ends at the "CRC Offset". CRC field width is 4 bytes.
CCFG Section | Data Start Offset | CRC Offset |
---|---|---|
.bootCfg | 0x00 | 0xC |
.hwOpts through .hwInitCopyList[] | 0x10 | 0x74C |
.userRecord | 0x750 | 0x7CC |
.debugCfg | 0x7D0 | 0x7FC |
When preparing the software image for production, review the following CCFG fields and set according to your system requirements
CCFG.permissions covers a number of restrictions on the flashing and debugging of the device. See Table 9-3 for details on each of the permission settings. See Chapter 8 for more detailed descriptions on boot behavior based on the CCFG configuration.
CCFG.flashProt covers the write/erase protection for the device. If certain areas of flash need to be restricted from erasing or writing then the appropriate fields are be written here. See Flash Read-Only Protection for details on which sectors are protected by these settings.
CCFG.debugCfg covers enabling debug features and the password protection of those features.
CCFG hierarchy/field | Description | |||
---|---|---|---|---|
.bootCfg | Contains function pointer that defines how to enter bootloader/application and also bootloader parameters. | |||
.pBldrVtor | Pointer to user bootloader vector table | |||
.bldrParam | Parameter passed to bootloader | |||
.pAppVtor | Pointer to application VTOR table | |||
.crc32 | CRC32 integrity checksum for CCFG | |||
.hwOpts[2] | Bitmask defining which peripherals/features and how much memory is accessible | |||
.permissions | Device permission fields. This is maximally-restrictive combined with similar fields in FCFG.permissions. | |||
... | Misc unused/reserved permissions | |||
.allowReturnToFactory | Allow Return-To-Factory procedure by SACI. Refer to Section 8.1.7 for details. Defined options are:
| |||
.allowToolsClientMode | Allow tools client mode to be enabled by SACI. Defined options are:
| |||
.allowChipErase | Allow chip erase by SACI or bootloader. Defined options are:
| |||
.allowFlashProgram | Allow flash program by SACI. Defined options are:
| |||
.allowFlashVerify | Allow flash verify by SACI. Defined options are:
| |||
... | Misc unused/reserved permissions | |||
.allowDebugPort | Allow enabling of SWD port. Defined options are:
| |||
.misc | Misc. boot-related fields | |||
.saciTimeoutExp | Configures the SACI timeout when there is a bootloader or application to boot into: SACI timeout is infinite when 0, else (2^saciTimeoutExp)*64 ms. (default: 0x4 = 1s) | |||
.saciTimeoutOverride | Determines if SACI timeout defined in FCFG is overridden by SACI timeout defined in CCFG | |||
.flashProt | Flash write/erase protection fields. Protection is applied before entering bootloader/application during boot | |||
.writeEraseProt | Write/erase protection fields | |||
.mainSectors0_31 | Bitmask for write/erase protection of individual sectors in sector range [0, 31]. 0 = protected (default: 1) | |||
mainSectors32_255 | Bitmask for write/erase protection of groups of 8 sectors. Bit i protects sectors [32+8i, 39+8i]. 0 = protected (default: 1) | |||
.auxSectors | Bitmasks for write/erase protection of auxilliary sectors | |||
.ccfgSector | Protect CCFG sector 0 = protected (default: 1) | |||
.fcfgSector | Protect FCFG sector 0 = protected (default: 0) | |||
... | Misc internal flash sector protections | |||
.hwInitCopyList[] | Remaining hardware trims applied during boot. Stored in a flexible copy list format. | |||
.userRecord | User record (programmable also through separate SACI command). | |||
.debugCfg | Bootloader configuration | |||
.authorization | Debug authorization requirements. Defined options are: CCFG_DBGAUTH_REQPWD: Require debug authentication (as per other fields in section) CCFG_DBGAUTH_DBGOPEN: Debug always allowed (AHB-AP opened upon bootloader/application entry). CCFG_DBGAUTH_DBGFORBID: Debug not allowed. | |||
.allowBldr | Whether debugging of bootloader is allowed or not. Defined options are: CCFG_DBGBLDR_ALLOW: Bootloader debugging allowed. CCFG_DBGBLDR_FORBID: bootloader debugging not allowed. | |||
.pwdId[8] | 64-bit customer-defined password ID readable through SACI command (can be used by user to calculate or look up debug password). | |||
.pwdHash[32] | 256 bit of SHA256 hash of user-supplied response to password ID (through SACI command) | |||
.crc32 | Integrity check of debugCfg section, Any integrity check error of debugCfg section is interpreted as debugCfg.authorization=Debug not allowed. |