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.

Compiler/CC1310: Link TI-RTOS-Project for use with (own) OTA Bootloader

Part Number: CC1310

Tool/software: TI C/C++ Compiler

Hi all!

I have written a small bootloader (<8k Code) for OTA usage  which optionally can update the CPU from an serial flash.
(I use a proprietary radio protocol and th serial flash can be written by several different sources)

However if i modify the the (user's program) "CC1310_LAUNCHXL_TIRTOS.cmd" to start at 0x2000,
I get some linker errors for the TI-RTOS-parts.
It seems, there is a 2.nd place, where I must modify the Flash-Layout?
Where can I find this?
Thanks for your help!

Best regards from Germany, Jo

(user's program) "CC1310_LAUNCHXL_TIRTOS.cmd":
----------------------------------------------------------------------------
....
// #define FLASH_BASE              0x0         /* Original */
// #define FLASH_SIZE              0x20000    /* Original */

#define FLASH_BASE              0x2000 /* Main App Start at 8k*/
#define FLASH_SIZE              0x1E000 /* 8k Missing at Top */
...

Errors (in CCS):
-----------
.....
<Linking>
"C:/c/cc13xx/tirtos_builds_CC1310_LAUNCHXL_release_ccs/Debug/configPkg/linker.cmd", line 583: warning #10096-D: specified address lies outside memory map
error #10264: DEFAULT memory range overlaps existing memory range FLASH
error #10264: DEFAULT memory range overlaps existing memory range SRAM
"C:/c/cc13xx/tirtos_builds_CC1310_LAUNCHXL_release_ccs/Debug/configPkg/linker.cmd", line 697: warning #10096-D: specified address lies outside memory map
error #10263: DEFAULT memory range has already been specified
error #10264: DEFAULT memory range overlaps existing memory range DEFAULT
error #10264: DEFAULT memory range overlaps existing memory range FLASH
error #10264: DEFAULT memory range overlaps existing memory range SRAM
error #10010: errors encountered during linking; "empty_CC1310_LAUNCHXL_tirtos_ccs.out" not built

  • I am not familiar with this linker command file ...

    Juergen Wickenhaeuser said:
    However if i modify the the (user's program) "CC1310_LAUNCHXL_TIRTOS.cmd"

    So I can't give you any specific recommendations.

    But I think reading the first part of the article Linker Command File Primer will help you understand this file.  At that point, I think you will understand how to change it to meet your needs.

    Thanks and regards,

    -George

  • Hi,

    there are several pitfalls:

    • If you use TI-RTOS in ROM, half of the second flash page (from 0x1000) is reserved for TI-RTOS. The ROM code needs config variables at fixed addresses. You can disable the ROM kernel by disabling the ROM module in the TI-RTOS .cfg file, but this would increase application size.
    • The reset vector must be adjusted in the TI-RTOS .cfg file to match the new entry point. Have a look at the OAD examples provided in the SDK

    The OAD solution from TI contains only a boot-image manager located at the first flash page. This BIM only copies data, it does not include RF. But locating a bootloader at the begin of the flash requires also to change the TI-RTOS application and the linker file.

    I think that the best solution is:

    • Put your OTA bootloader at the end of the flash together with the CCFG and never update that in the field. You may take as many flash pages as you want.
    • Keep the interrupt vector table that is located at address 0x0000 on the first flash page under the control of the bootloader. That means: The bootloader would overwrite it when programming the application. The reset vector must always point to the bootloader. The TI-RTOS kernel will program another vector table in RAM anyway when starting. So the flash vector table isn't needed anymore.

    If you follow this, then you don't need to change your TI-RTOS application at all, just remove the CCFG because it is now defined by the bootloader. Does this make sense? This is just a proposal. I haven't tried to implement it that way.

  • Hi Richard,

    thanks for your details about the pitfalls! Yes, I think your solution should work!

    I already tested it with a TI-RTOS simple-test-software at adr. 0 and parts of my bootmanager in the last 8k.
    Still there is a "small vulnerability", when the bootmanager adjusts the reset vector at adr. 4, but I think this is tolerable...

    Best regards,
    Jo

  • Hi,

    Juergen Wickenhaeuser said:
    Still there is a "small vulnerability", when the bootmanager adjusts the reset vector at adr. 4, but I think this is tolerable...

    Oh, indeed. I was just thinking "0xFF is interpreted as NOP until it reaches the bootloader". It's a pity that the ROM bootloader on the CC1310 does not allow the entry point to be moved to a different location (the bootloader).