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.

RTOS/CC2640R2F: How do I make changes to the CCFG parameters at runtime?

Part Number: CC2640R2F

Tool/software: TI-RTOS

Hello,

At compile time I have disabled bootloader access in my CCFG table by setting the appropriate macros in my ccfg.c file. However, I want to have the ability to change the CCFG table at runtime so that I can enable access to the bootloader and the bootloader backdoor at will, which will then allow me to perform a firmware upgrade. Finally, after the firmware upgrade completes I would like to disable bootloader access again until it's time to perform another firmware upgrade. I have a couple of questions:

  1. Assuming that sector 31 (i.e. the region of flash where CCFG resides) is not locked, is it possible to change the CCFG table at runtime?
    1. How do I overwrite the BL_CONFIG parameter of the CCFG table while keeping other parameters intact? I'm assuming I will need to make a copy of the CCFG table, erase the sector where it resides, and then rewrite the table with my modified BL_CONFIG parameter. Is there some sort of API available to avoid all of this? I think osal_snv_write only applies to the SNV region of flash.

Thanks,

Keron

  • Hello Keron,

    You can write individual flash words using HalFlashWrite however, you can only write a 1 to a 0 for any particular bit in a word. There is no dedicated CCFG write API, you will need to write these using the platform flash APIs.

    Erasing the CCFG at runtime for a deployed device is quite risky unless you have a means to reprogram the CC26xx locally from a SPI/UART interface. Strictly speaking, erasing the CCFG sector (flash page 31) and rebooting will place the device in ROM bootloader mode as IMAGE_VALID will be 1 (not valid).

    Best wishes
  • I would definitely avoid changing values in CCFG runtime. The recommendation is to lock this flash page during production programming. If you need to enable a boot loader dynamically I would take a look at our flash implementation which you will find on the SimpleLink GitHub page.

    Cheers,
    Fredrik
  • Thanks JXS. This info was helpful.

    Keron

  • Hi Fredrik,

    Thanks for your recommndation about locking the flash plage for production. I definitely would like to enable the bootloader dynamically using some sort of flash-based implementation. I went to the SimpleLink Github page under the ti-simplelink/ble_examples repo, but I can't find the bootloader implementation you are referring to. Is the bootloader you are referring to the same as the boot image manager (BIM) used in the OAD examples of the SDK?
  • Hi Keron,

    It seems to only be available on the ble_examples_2.2 branch: github.com/.../ble_examples-2.2 .

    Cheers,
    Fredrik