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.

LP-EM-CC2340R5: How to Enable Flash Memory Protection

Part Number: LP-EM-CC2340R5
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

I've defined a NVS section starting at flash address 0x7A000 with a region size of one sector - 0x800 bytes. Reading and writing this sector via the NVS driver is no problem, but I'd like to preserve the contents of this sector across debug sessions. Currently, when I start a debug session this sector is being erased regardless of the fact that I've enabled the following flash protection:

As you can see, I'm using a XDS110 USB Debug Probe with a standard LP-EM-CC2340R5 development board and CCS Theia version 1.5.1.3. What am I doing wrong?

  • Hello,

    May I kindly ask you to specify which SDK version you are using? I am asking as before SDK 8.10, the "Erase/Retain, Main Sectors 32-255" value should be set to 0x8xxxxxxx (in SDK 8.10 an newer, this value is altered by SysConfig behind the scene).

    For the rest, it seems the setup in SysConfig will end-up protecting sector 244 (i.e. address 0x7A000).

    In the field "Erase/Retain, Main Sectors 32-255", each bit represents eight sectors in range 32-255, when set to 1, the range of sectors is retained when performing a flash erase. For example, setting this field to 0x00000005 retains sectors 32 to 39 and 48 to 55 i.e. address ranges 0x10000 to 0x13FFF and 0x18000 to 0x1BFFF when the device flash is erased.

    Sector xxxx 255-224 223-192 191-160 159-128 127-96 95-64 63-32
    Erase/Retain field Main Sectors 32-255 X--- ---- -X-- ---- --X- ---- ---X ---- ---- X--- ---- -X-- ---- --X- ---- ---X

    When setting -X-- ---- in the "Erase/Retain field Main Sectors 32-255":

    • If X = 0x0 = b0000 => no sector protected
    • If X = 0x1 = b0001 => sectors 224-231 are protected
    • If X = 0x2 = b0010 => sectors 232-239 are protected
    • If X = 0x4 = b0100 => sectors 240-247 are protected
    • If X = 0x8 = b1000 => sectors 248-255 are protected

    Best regards, 

  • Hi Clement,

    Thank you for your reply. I'm using simpelink_lowpower_f3 SDK version 8.10.01 and I'm trying to protect sector 244, which starts at address 0x7A000, so shouldn't my configuration work? I can see data in this sector, but that sector is erased after I click the Start Debugging button in CCS Theia.

    Thank you,

    Rob

  • I just tried the same project with Erase/Retain Main Sectors 32-255 set to 0xFF000000 and when I load a new debug session flash address 0x7A000 is still getting erased. Does this feature work because it certainly seems like the Erase/Retain does nothing.