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.

CCS/CC1310: Debug - Flash Settings - Program Load Settings - Erase Settings: "Necessary Sectors Only (Retain untouched...." does not work as expected

Part Number: CC1310

Tool/software: Code Composer Studio

Hello,

I'm using Version: 7.4.0.00015, TI Emulators 7.0.100.1.

I have CC1310 Launchpad and I'm trying to force debugger to not erase particular sector in the flash. So I'm using the setting of Code Composer Studio in the title and I'm having the linker configured so this section has atribute NOLOAD (noLoadFlash : type = NOLOAD > FLASH_NV).

It's located at:

#define FLASH_NV_BASE 0x1E000
#define FLASH_NV_SIZE 0x1000

But the debugger always erase this section (based on below and fact that data are always erased after this step):

Cortex_M3_0: Writing Flash @ Address 0x00018400 of Length 0x00007c00
Cortex_M3_0: Chunk 1: addr=0x00018400, length=4096 (using block 1)
Cortex_M3_0: Chunk 2: addr=0x00019400, length=4096 (using block 0)
Cortex_M3_0: Chunk 3: addr=0x0001A400, length=4096 (using block 1)
Cortex_M3_0: Chunk 4: addr=0x0001B400, length=4096 (using block 0)
Cortex_M3_0: Chunk 5: addr=0x0001C400, length=4096 (using block 1)
Cortex_M3_0: Chunk 6: addr=0x0001D400, length=4096 (using block 0)
Cortex_M3_0: Chunk 7: addr=0x0001E400, length=4096 (using block 1)
Cortex_M3_0: Chunk 8: addr=0x0001F400, length=3072 (using block 0)

When I use SmartRF Flash Programmer V2, it works as expected (based on log below - affected sector 30 is unassigned and of course based on fact that data there are not erased):

>Page: 25 verified OK.

>Skip verification of unassigned page: 26.

>Skip verification of unassigned page: 27.

>Skip verification of unassigned page: 28.

>Skip verification of unassigned page: 29.

>Skip verification of unassigned page: 30.

>Page: 31 verified OK.

I suspect that CCS is not taking care about the setting and erase all sectors. Or maybe I'm doing something wrong?

  • Would it be possible to get the .out and .cmd files? CCS looks like it is writing there later which would explain why it erased the section first. So then the question is if CCS is not supposed to be writing there.

    Regards,
    John

  • Hi John, I attached them.sensor_cc1350lp.zip

  • Just wanted to let you know that our guys are looking at this to figure out what is going on.

    John
  • Hi,

    Can you confirm that the "sensor_cc1350lp.out" program you attached is the one you loaded when you got the output you initially posted?

    When I tried loading sensor_cc1350lp.out in CCS7.4, I'm getting the following output:

    ...
    Cortex_M4_0: Writing Flash @ Address 0x00017800 of Length 0x0000237e
    Cortex_M4_0: Chunk 1: addr=0x00017800, length=8192 (using block 1)
    Cortex_M4_0: Chunk 2: addr=0x00019800, length=894 (using block 0)
    Cortex_M4_0: Writing Flash @ Address 0x0001f000 of Length 0x00001000
    Cortex_M4_0: Chunk 1: addr=0x0001F000, length=4096 (using block 1)

    Based on this output, it is not writing to memory address 0x1E000. And I was able to confirm using the Memory view that the memory at 0x1E000 is preserve after program load.

    Thanks,
    Ricky
  • Hi,

    I've tried it again. When I hit the debug button the output below appears in console. One thing I noticed is that it is mentioning "FlashLoaderCC26x0.out" file, not the "sensor_cc1350lp.out" although "sensor_cc1350lp.out" is the actual output from the linker (the firmware works as expected, so it is somehow loaded too).

    Cortex_M3_0: GEL Output: Memory Map Initialization Complete.
    Cortex_M3_0: Flashloader: Verbose output enabled.
    Cortex_M3_0: GEL Output: Board Reset Complete.
    Cortex_M3_0: Writing Flash @ Address 0x00000000 of Length 0x00000fc0
    Cortex_M3_0: Loading flashloader to target: FlashLoaderCC26x0.out
    Cortex_M3_0: Chunk 1: addr=0x00000000, length=4032 (using block 0)
    Cortex_M3_0: Writing Flash @ Address 0x00001000 of Length 0x00007c00
    Cortex_M3_0: Chunk 1: addr=0x00001000, length=4096 (using block 1)
    Cortex_M3_0: Chunk 2: addr=0x00002000, length=4096 (using block 0)
    Cortex_M3_0: Chunk 3: addr=0x00003000, length=4096 (using block 1)
    Cortex_M3_0: Chunk 4: addr=0x00004000, length=4096 (using block 0)
    Cortex_M3_0: Chunk 5: addr=0x00005000, length=4096 (using block 1)
    Cortex_M3_0: Chunk 6: addr=0x00006000, length=4096 (using block 0)
    Cortex_M3_0: Chunk 7: addr=0x00007000, length=4096 (using block 1)
    Cortex_M3_0: Chunk 8: addr=0x00008000, length=3072 (using block 0)
    Cortex_M3_0: Writing Flash @ Address 0x00008c00 of Length 0x00007c00
    Cortex_M3_0: Chunk 1: addr=0x00008C00, length=4096 (using block 1)
    Cortex_M3_0: Chunk 2: addr=0x00009C00, length=4096 (using block 0)
    Cortex_M3_0: Chunk 3: addr=0x0000AC00, length=4096 (using block 1)
    Cortex_M3_0: Chunk 4: addr=0x0000BC00, length=4096 (using block 0)
    Cortex_M3_0: Chunk 5: addr=0x0000CC00, length=4096 (using block 1)
    Cortex_M3_0: Chunk 6: addr=0x0000DC00, length=4096 (using block 0)
    Cortex_M3_0: Chunk 7: addr=0x0000EC00, length=4096 (using block 1)
    Cortex_M3_0: Chunk 8: addr=0x0000FC00, length=3072 (using block 0)
    Cortex_M3_0: Writing Flash @ Address 0x00010800 of Length 0x00007c00
    Cortex_M3_0: Chunk 1: addr=0x00010800, length=4096 (using block 1)
    Cortex_M3_0: Chunk 2: addr=0x00011800, length=4096 (using block 0)
    Cortex_M3_0: Chunk 3: addr=0x00012800, length=4096 (using block 1)
    Cortex_M3_0: Chunk 4: addr=0x00013800, length=4096 (using block 0)
    Cortex_M3_0: Chunk 5: addr=0x00014800, length=4096 (using block 1)
    Cortex_M3_0: Chunk 6: addr=0x00015800, length=4096 (using block 0)
    Cortex_M3_0: Chunk 7: addr=0x00016800, length=4096 (using block 1)
    Cortex_M3_0: Chunk 8: addr=0x00017800, length=3072 (using block 0)
    Cortex_M3_0: Writing Flash @ Address 0x00018400 of Length 0x00007c00
    Cortex_M3_0: Chunk 1: addr=0x00018400, length=4096 (using block 1)
    Cortex_M3_0: Chunk 2: addr=0x00019400, length=4096 (using block 0)
    Cortex_M3_0: Chunk 3: addr=0x0001A400, length=4096 (using block 1)
    Cortex_M3_0: Chunk 4: addr=0x0001B400, length=4096 (using block 0)
    Cortex_M3_0: Chunk 5: addr=0x0001C400, length=4096 (using block 1)
    Cortex_M3_0: Chunk 6: addr=0x0001D400, length=4096 (using block 0)
    Cortex_M3_0: Chunk 7: addr=0x0001E400, length=4096 (using block 1)
    Cortex_M3_0: Chunk 8: addr=0x0001F400, length=3072 (using block 0)

  • Now I see Cortex_M4 in your log, so you probably don't use CC1310 launchpad?
  • You are right; thanks for pointing that out, and sorry for the confusion.

    I was using a CC1352 Launchpad that was on my desk. Trying again on the CC1310 and I am seeing the same output as you. It's interesting that the behaviour is different between the CC1310 and CC1352. Let me have a further look and report back.

    Thanks.
  • On further investigation, the issue seems to be caused by a feature CCS has to combine close sections together to increase performance.  Specifically there is a bug that is causing it to combine 2 sections in your program that shouldn't be combined, and therefore it is over writing the memory at 0x1E000.

    As a temporary work around, can you download the attached CC13_FlashProperties.xml and copy it into the following folder?

    <installDir>\ccsv7\ccs_base\DebugServer\propertyDB\

    CC13_FlashProperties.xml
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    <?xml version="1.0" encoding="utf-8"?>
    <PropertyList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <!--Nodes-->
    <node id="FlashProgrammerNode">
    <name>Flash Settings</name>
    <children>
    <child>ProgramLoadSettingsGroup</child>
    <child>EraseActionGroup</child>
    <child>FlashAlignCombineToggle</child>
    <child>FlashAlignmentSize</child>
    <child>DeviceInfoGroup</child>
    <child>DeviceMacAddressGroup</child>
    </children>
    </node>
    <!--Groups -->
    <group id="ProgramLoadSettingsGroup">
    <name>Program Load Settings</name>
    <children>
    <child>FlashEraseSetting</child>
    <child>KeepCcfgSetting</child>
    </children>
    </group>
    <group id="EraseActionGroup">
    <name>Erase Actions</name>
    <children>
    <child>ChipEraseButton</child>
    </children>
    </group>
    <group id="DeviceInfoGroup">
    <name>Device Information</name>
    <children>
    <child>DeviceInfoFlashSize</child>
    <child>DeviceInfoRAMSize</child>
    <child>DeviceInfoRevision</child>
    <child>DeviceInfoRevisionTranslation</child>
    <child>DeviceFlashloaderFile</child>
    </children>
    </group>
    <group id="DeviceMacAddressGroup">
    <name>Device MAC Addresses</name>
    <children>
    <child>DeviceBlePrimaryGroup</child>
    <child>DeviceBleSecondaryGroup</child>
    <child>DeviceIeeePrimaryGroup</child>
    <child>DeviceIeeeSecondaryGroup</child>
    </children>
    </group>
    <group id="DeviceBlePrimaryGroup">
    <name>Primary BLE Address</name>
    <children>
    <child>DeviceBlePrimary</child>
    <child>DeviceBlePrimaryLoc</child>
    <child>DeviceBlePrimaryReadButton</child>
    </children>
    </group>
    <group id="DeviceBleSecondaryGroup">
    <name>Secondary BLE Address</name>
    <children>
    <child>DeviceBleSecondary</child>
    <child>DeviceBleSecondaryLoc</child>
    <child>DeviceBleSecondaryReadButton</child>
    <child>DeviceBleSecondaryWriteButton</child>
    </children>
    </group>
    <group id="DeviceIeeePrimaryGroup">
    <name>Primary IEEE Address</name>
    <children>
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    This should disable the combine feature.

    Please let me know if this fixes your issue. We will be looking into implementing a fix to this issue in CCS as soon as possible.

    Thanks,

    Ricky

  • Hi Rick, based on diff the file you've sent is identical with the original file I have in that folder.
  • Let's try that again.

    5126.CC13_FlashProperties.xml
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    <?xml version="1.0" encoding="utf-8"?>
    <PropertyList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <!--Nodes-->
    <node id="FlashProgrammerNode">
    <name>Flash Settings</name>
    <children>
    <child>ProgramLoadSettingsGroup</child>
    <child>EraseActionGroup</child>
    <child>FlashAlignCombineToggle</child>
    <child>FlashAlignmentSize</child>
    <child>DeviceInfoGroup</child>
    <child>DeviceMacAddressGroup</child>
    </children>
    </node>
    <!--Groups -->
    <group id="ProgramLoadSettingsGroup">
    <name>Program Load Settings</name>
    <children>
    <child>FlashEraseSetting</child>
    <child>KeepCcfgSetting</child>
    </children>
    </group>
    <group id="EraseActionGroup">
    <name>Erase Actions</name>
    <children>
    <child>ChipEraseButton</child>
    </children>
    </group>
    <group id="DeviceInfoGroup">
    <name>Device Information</name>
    <children>
    <child>DeviceInfoFlashSize</child>
    <child>DeviceInfoRAMSize</child>
    <child>DeviceInfoRevision</child>
    <child>DeviceInfoRevisionTranslation</child>
    <child>DeviceFlashloaderFile</child>
    </children>
    </group>
    <group id="DeviceMacAddressGroup">
    <name>Device MAC Addresses</name>
    <children>
    <child>DeviceBlePrimaryGroup</child>
    <child>DeviceBleSecondaryGroup</child>
    <child>DeviceIeeePrimaryGroup</child>
    <child>DeviceIeeeSecondaryGroup</child>
    </children>
    </group>
    <group id="DeviceBlePrimaryGroup">
    <name>Primary BLE Address</name>
    <children>
    <child>DeviceBlePrimary</child>
    <child>DeviceBlePrimaryLoc</child>
    <child>DeviceBlePrimaryReadButton</child>
    </children>
    </group>
    <group id="DeviceBleSecondaryGroup">
    <name>Secondary BLE Address</name>
    <children>
    <child>DeviceBleSecondary</child>
    <child>DeviceBleSecondaryLoc</child>
    <child>DeviceBleSecondaryReadButton</child>
    <child>DeviceBleSecondaryWriteButton</child>
    </children>
    </group>
    <group id="DeviceIeeePrimaryGroup">
    <name>Primary IEEE Address</name>
    <children>
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi, with this file it's working as expected. Thanks!