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.

SIMPLELINK-CC13X2-26X2-SDK: Bug in linker command files

Part Number: SIMPLELINK-CC13X2-26X2-SDK
Other Parts Discussed in Thread: CC2652R7, CC1352P, CC2652RB, CC1352P7, CC2651P3, CC2651R3SIPA

Tool/software:

There is a bug in the linker command files of some or most examples affecting the calculating of the flash length:

The FLASH memory section is defined as:

FLASH (RX) : origin = FLASH_START, length = (FLASH_END - FLASH_START + 1)

FLASH_START is defined as:

#define FLASH_START                ENTRY_END + 1

ENTRY_END   is defined as:

#define ENTRY_START + ENTRY_SIZE - 1

If you expand these macros the FLASH memory section becomes:

FLASH (RX) : origin = FLASH_START, length = (FLASH_END - ENTRY_START + ENTRY_SIZE - 1+ 1+ 1)

The correct calculation however shoud be:

FLASH (RX) : origin = FLASH_START, length = (FLASH_END - (ENTRY_START + ENTRY_SIZE - 1+ 1) + 1)

The missing brackets cause the flash length to be bigger by ENTRY_SIZE instead of smaller by ENTRY_SIZE. This leads to the FLASH size being declared too big and once the FLASH gets full to the end the OAD image will actually overwrite the bootloader code which sits at the end of FLASH, bricking the device.

This is from the map file if you link with the affected cmd file (from a CC2642 project):

MEMORY CONFIGURATION

name          origin   length   used      unused   attr fill
---------------------- -------- --------- -------- -------- ---- --------
FLASH_IMG_HDR 00000000 00000090 0000008d  00000003 R X
ENTRY         00000090 00000040 0000003c  00000004 R X
FLASH         000000d0 000560d0 00056020  000000b0 R X
RTOS_SRAM     20000000 0000012c 000000e4  00000048 RW X
SRAM 20000fdf 00013021 0000de84 0000519d RW X

Note that FLASH length should be 0x56000 - 0xD0, not 0x56000+ 0xD0 (the bootloader starts on 0x56000) 

In order to correct this bug we need to add a bracket around the FLASH_START macro:

FLASH (RX) : origin = FLASH_START, length = (FLASH_END - (FLASH_START) +1 )

This bug is present in at least the following SDK's:

6.20.00.29

3.30.00.03

This are a few of the path of command files I checked that have this bug present (there is literally 100's of command files in the samples so I just checked a few):

simplelink_cc13xx_cc26xx_sdk_6_20_00_29\examples\rtos\LP_CC2652R7\ble5stack\simple_peripheral_oad_onchip\tirtos7\ticlang\cc13x2x7_cc26x2x7_app_tirtos7.cmd"

simplelink_cc13xx_cc26xx_sdk_6_20_00_29\examples\rtos\LP_CC2652R7\ble5stack\simple_peripheral_oad_offchip\tirtos7\ticlang\cc13x2x7_cc26x2x7_app_tirtos7.cmd"

simplelink_cc13x2_26x2_sdk_3_30_00_03\examples\rtos\CC1352R1_LAUNCHXL\ble5stack\simple_peripheral_oad_onchip\tirtos\ccs\cc13x2_cc26x2_app.cmd"

simplelink_cc13x2_26x2_sdk_3_30_00_03\examples\rtos\CC1352R1_LAUNCHXL\ble5stack\simple_central\tirtos\ccs\cc13x2_cc26x2_app.cmd"

simplelink_cc13x2_26x2_sdk_3_30_00_03\examples\rtos\CC1352P1_LAUNCHXL\ble5stack\simple_peripheral_oad_onchip\tirtos\ccs\cc13x2_cc26x2_app.cmd"

  • Just some more info to this issue, it seems that it actually has been fixed in some of the cmd files, and the ones I mentioned in my first post do actually have a fix for this issue, the brackets are around the FLASH_START define:

    #define FLASH_START                (ENTRY_END + 1)

    However a quick search trough my libraries brings up this list with files that seem to have not been fixed:


    simplelink_cc13x2_26x2_sdk_3_30_00_03\examples\to\CC1352P1_LAUNCHXL\ble5stack\project_zero\tirtos\ccs\cc13x2_cc26x2_app.cmd
    simplelink_cc13x2_26x2_sdk_3_30_00_03\examples\to\CC1352P1_LAUNCHXL\ble5stack\simple_peripheral_oad_offchip\tirtos\ccs\cc13x2_cc26x2_app.cmd
    simplelink_cc13x2_26x2_sdk_3_30_00_03\examples\rtos\CC1352P_2_LAUNCHXL\ble5stack\project_zero\tirtos\ccs\cc13x2_cc26x2_app.cmd
    simplelink_cc13x2_26x2_sdk_3_30_00_03\examples\to\CC1352P_2_LAUNCHXL\ble5stack\simple_peripheral_oad_offchip\tirtos\ccs\cc13x2_cc26x2_app.cmd
    simplelink_cc13x2_26x2_sdk_3_30_00_03\examples\rtos\CC1352P_4_LAUNCHXL\ble5stack\project_zero\tirtos\ccs\cc13x2_cc26x2_app.cmd
    simplelink_cc13x2_26x2_sdk_3_30_00_03\examples\to\CC1352P_4_LAUNCHXL\ble5stack\simple_peripheral_oad_offchip\tirtos\ccs\cc13x2_cc26x2_app.cmd
    simplelink_cc13x2_26x2_sdk_3_30_00_03\examples\to\CC1352R1_LAUNCHXL\ble5stack\multi_sensor\tirtos\ccs\cc13x2_cc26x2_app.cmd
    simplelink_cc13x2_26x2_sdk_3_30_00_03\examples\to\CC1352R1_LAUNCHXL\ble5stack\project_zero\tirtos\ccs\cc13x2_cc26x2_app.cmd
    simplelink_cc13x2_26x2_sdk_3_30_00_03\examples\to\CC1352R1_LAUNCHXL\ble5stack\simple_peripheral_oad_offchip\tirtos\ccs\cc13x2_cc26x2_app.cmd
    simplelink_cc13x2_26x2_sdk_3_30_00_03\examples\to\CC2652RB_LAUNCHXL\ble5stack\project_zero\tirtos\ccs\cc13x2_cc26x2_app.cmd
    simplelink_cc13x2_26x2_sdk_3_30_00_03\examples\rtos\CC26X2R1_LAUNCHXL\ble5stack\project_zero\tirtos\ccs\cc13x2_cc26x2_app.cmd
    simplelink_cc13x2_26x2_sdk_3_30_00_03\examples\rtos\CC26X2R1_LAUNCHXL\ble5stack\simple_peripheral_oad_offchip\tirtos\ccs\cc13x2_cc26x2_app.cmd
    simplelink_cc13x2_26x2_sdk_3_30_00_03\source\ti\ble5stack\common\cc26xx\ccs\cc26x2_app_oad_agama.cmd
    simplelink_cc13xx_cc26xx_sdk_6_20_00_29\examples\rtos\CC1352R1_LAUNCHXL\ble5stack\multi_sensor\tirtos7\ticlang\cc13x2_cc26x2_app_tirtos7.cmd
    simplelink_cc13xx_cc26xx_sdk_6_20_00_29\examples\rtos\LP_CC1352P7_1\ble5stack\project_zero\tirtos7\ticlang\cc13x2x7_cc26x2x7_app_tirtos7.cmd
    simplelink_cc13xx_cc26xx_sdk_6_20_00_29\examples\to\LP_CC1352P7_4\blestack\project_zero\tirtos7\ticlang\cc13x2x7_cc26x2x7_app_tirtos7.cmd
    simplelink_cc13xx_cc26xx_sdk_6_20_00_29\examples\to\LP_CC2651P3\ble5stack\project_zero\tirtos7\ticlang\cc13x1_cc26x1_app_tirtos7.cmd
    simplelink_cc13xx_cc26xx_sdk_6_20_00_29\examples\rtos\LP_CC2651R3SIPA\ble5stack\project_zero\tirtos7\ticlang\cc13x1_cc26x1_app_tirtos7.cmd
    simplelink_cc13xx_cc26xx_sdk_6_20_00_29\examples\rtos\LP_CC2652R7\ble5stack\project_zero\tirtos7\ticlang\cc13x2x7_cc26x2x7_app_tirtos7.cmd
    simplelink_cc13xx_cc26xx_sdk_6_20_00_29\source\ti\ble5stack\common\cc26xx\ccs\cc26x2_app_oad_agama.cmd
    simplelink_cc13xx_cc26xx_sdk_7_40_00_77\source\ti\ble5stack\common\cc26xx\ccs\cc26x2_app_oad_agama.cmd
    simplelink_cc13xx_cc26xx_sdk_7_40_00_77\source\ti\dmm\apps\common\tirtos\ccs\cc26x2_app_oad_agama_tirtos7.cmd

  • Hello Reto,

    Thank you for reporting this. We will review it with the team and report back to you as soon as possible to let you know the next steps.

    BR,

    David.