This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2340R5: CC2340R5 - ROM Serial Bootloader flashing.

Part Number: CC2340R5
Other Parts Discussed in Thread: CC2640

Tool/software:

Hi Experts,

I am currently working with the CC2340R5 BLE chip and implementing firmware flashing through the serial ROM bootloader via UART. The flashing process completes successfully, and the application runs as expected.

My procedure involves entering boot mode using the dedicated boot pin, followed by the typical sequence of commands: ping status, get ID status, and get part ID. After that, I issue the chip erase command, which executes successfully and erases the application sector as well as the CCFG sector. I then proceed to flash the application file.

since the chip erase command also erases the CCFG sector, which contains the bootloader configuration, any interruption during flashing causes the process to stop, and I am subsequently unable to re-enter the serial ROM bootloader mode.

I reviewed the Technical Reference Manual and found that CCFG and FCFG sectors can be protected using the following commands:
.flashProt.writeEraseProt.ccfgSector = 0 And.flashProt.writeEraseProt.fcfgSector = 0.  but it did not work.

However, I noticed that the CC2340 ROM bootloader does not support a sector erase command, only a chip erase command, which unfortunately erases the CCFG sector as well.

Could you please advise if there is a supported method or workaround to safeguard the CCFG sector during flashing? I want to ensure the application can be reflashes multiple times without losing the bootloader configuration or encountering an unrecoverable state caused by CCFG erasure.

Regards,

Muthuraj K

  • Hello Muthuraj,

    I hope you are doing well. Addressing your first question/concern "and I am subsequently unable to re-enter the serial ROM bootloader mode." what happens here is that if the CCFG is erased the device does not know its configuration, in this case what's likely happening its that its defaulting to the default bootloader IO pins and index (FCFG) as defined in the TRM rather than the ones you set. 

    Due to security reasons the serial ROM bootloader is an all or nothing approach, meaning we cannot sector erase we either erase the entire device or don't use the serial ROM bootloader. 

    Could you please advise if there is a supported method or workaround to safeguard the CCFG sector during flashing? I want to ensure the application can be reflashes multiple times without losing the bootloader configuration or encountering an unrecoverable state caused by CCFG erasure.

    An alternative to the default serial ROM bootloader is to use a custom bootloader, usually I would recommend starting out with MCUBoot and add some extra functions before MCUBoot itself takes over; as an example you can add functions to check a pin to enter your custom bootloader, enter a security key, sector erase, etc but these would have to be implemented by you. 

    Thanks,
    Alex F

  • Hi Alex,

    As you said in previous Use custom bootloader, Is there an example or recommended approach for developing a custom bootloader on the CC2340R5?

    When a custom bootloader is present, which memory sectors are designated for ROM erase, write, and verification of the application?

    The Technical Reference Manual (TRM) mentions a table for CCFG configuration. Could you advise on how to set and control the CCFG fields effectively?

    During UART reflashing, what power failure safe mode mechanisms are available on the CC2340?

    If such a power failure safe mode is not supported, would this pose a significant risk of module failure for end users migrating from CC2640 to CC2340?

    Regards,

    Muthuraj K

  • Hello Muthu raj,

    We provide an MCUBoot example already in the SDK, so I would recommend customers start from there. 

    (C:\ti\simplelink_lowpower_f3_sdk_9_10_00_83\examples\nortos\LP_EM_CC2340R5\mcuboot)l

    We control various aspects of the CCFG and the bootloader in syscfg, as an example below here is where we can change bootloader: 

    Thanks,
    Alex F