SWCU193 April 2023 CC2340R2 , CC2340R5 , CC2340R5-Q1
An 8-bit value BOOTSTA is updated in the PMCTL.BOOTSTA register during boot to inform about which stage of boot is ongoing or to report errors. A bootloader can use the same mechanism and the mechanism is even available for user application. BOOTSTA can be read from PMCTL.BOOTSTA using CPU or an external debug probe can read BOOTSTA through SWD:CFGAP.DEVICESTATUS.BOOTSTA.
The BOOTSTA[7:6] bits are sticky, meaning the bits cannot be cleared once set:
BOOTSTA[7:6] | Description |
---|---|
0b00 | In boot flow, prior to bootloader invocation. BOOTSTA[5:0] indicates phase of boot or failures (highest numerical values) |
0b01 | In bootloader. BOOTSTA[5:0] indicates phase of bootloader or failures (highest numerical values) |
0b11 | Post bootloader boot flow or in application. Some of the lower values of BOOTSTA[5:0] and highest values of BOOTSTA[5:0] are reserved for reporting boot flow phase or failures. The remaining values can be used by an application to report its state in a similar way, and are accessible from SWD:CFGAP even if debugging is not allowed. |
The BOOTSTA values used by boot flow and the ROM serial bootloader are given in Table 8-2.
BOOTSTA | Set by |
Name (waiting for external action) (failure reported; reset device) |
Description |
---|---|---|---|
0x00 | Hardware | BOOT_RESET | Initial value after system reset |
0x01 | Boot flow | BOOT_COLD_BOOT | Determined that this is not a standby exit scenario and normal boot process starts |
0x02 | Boot flow | BOOT_SRAM_REP_DONE | SRAM repair has completed; continuing with remaining critical trimming |
0x03 | Boot flow | BOOT_GENERAL_TRIMS | Critical trimming (flash, oscillators, references, power management) completed, starting general trimming |
0x04-0x01F | - | Reserved | |
0x20 | Boot flow | BOOT_ENTERED_SACI | SACI entered (SWD secure access point command interface). If SACI timeout is configured the timer has started running |
0x21-0x35 | - | Reserved | |
0x36 | Boot flow | BOOT_WAIT_SWD_DISCONNECT | SACI reset command issued with option waitForSwdDisconnect set has been issued. In busy loop until SWD disconnect sequence received by Icemelter |
0x37 | Boot flow | BOOT_EXITED_SACI | Exit from SACI (due to timeout or SACI exit command) |
0x38 | Boot flow | BOOT_WAITLOOP_DBGPROBE | TI Internal Test Mode |
0x3E | Boot flow | BOOT_FAIL_SRAM_REPAIR | SRAM repair failed: device cannot boot. Remain in infinite loop until reset |
0x3F | Boot flow | BOOT_FAULT_HANDLER | Uncaught/unspecified error during boot: device cannot boot. Remain in infinite loop until reset |
0x40-0x7F | - | Cannot be used | |
0x80 | Boot flow | BLDR_MODE_ENTRY | Entering bootloader mode; checking which bootloader, if any, to invoke next |
0x81 | Boot flow | BLDR_WAITLOOP_DBGPROBE | Debug of bootloader allowed; busy loop to allow external probe to set breakpoints before single-stepping or running CPU |
0x82-0xB9 | - | Reserved | |
0xBA | Serial ROM bootloader | BLDR_STARTED | Serial ROM bootloader entered |
0xBB | Serial ROM bootloader | BLDR_CMD_IDLE | Serial boot ROM has triggered and then either UART or SPI interface was selected (through interface activity); currently bootloader is waiting for a command over selected interface. |
0xBC | Serial ROM bootloader | BLDR_CMD_PROCESSING | Serial boot ROM has triggered and then either UART or SPI interface was selected (through interface activity); currently bootloader is in the process of receiving or processing a command |
0xBD | Serial ROM bootloader | BLDR_FAIL_EXECUTION_CONTEXT | Failure: serial ROM bootloader entry function was invoked from the application rather than from the boot flow. Remain in infinite loop until reset |
0xBE | Serial ROM bootloader | BLDR_FAIL_APPTRANSFER | Failure (should never happen): no valid application for bootloader to transfer to. Remain in infinite loop until reset |
0xBF | Serial ROM bootloader | BLDR_FAULT_HANDLER | Uncaught/unspecified error during bootlloader execution. Remain in infinite loop until reset |
0xC0 | Boot flow | APP_MODE_ENTRY | Entering application mode. Exited bootloader if one was invoked. AHB-AP accessible from external debug probe if debug is open or has been authenticated |
0xC1 | Boot flow | APP_WAITLOOP_DBGPROBE | Debug of application allowed; busy loop to allow external probe to set breakpoints before single-stepping or running CPU |
0xC2 | Boot flow | BLDR_START_INIT | Boot complete: set immediately before jumping to application entry point |
0xC3-0xFC | - | Available for application usage | Suggest 0xC3 set at the very beginning of application startup code |
0xFD | Boot flow | APP_FAIL_NOAPP | Failure: (should never happen) bootloader exited and there is no valid application to boot into. Remain in infinite loop until reset |
0xFE | Boot flow | APP_FAIL_APPTRANSFER | Failure: application returned. Should never happen as link register is set to 0xFFFF_FFFF before application entry function is called. A return from application will thus result in a fault (which may or may not be handled by the application) |
0xFF | Boot flow | APP_FAULT_HANDLER | Uncaught/unspecified error during transition to application (typically incorrect vector table address provided in CCFG.bootCfg.pAppVtor or incorrect vector table contents). |