Other Parts Discussed in Thread: C2000WARE
Tool/software:
Hello everyone,
I have been asked by a client to design and develop a system consisting of a Secondary Bootloader and an Application.
Environment:
- Device: TMS320F28379D
- Boot Mode:
- SCI Boot (firmware update using sci_flash_kernel)
- Flash Boot (Secondary Bootloader + Application)
- Flash Memory Map:
origin = 0x080000, length = 0x002000
→ Secondary Bootloaderorigin = 0x084000, length = 0x002000
→ Application
- CCS Version: 12.7.1
Overview:
- Secondary Bootloader
- On the first boot, write unique ID, secret, etc. to OTP.
- Jump to the Application.
- Application
- Read OTP and verify whether the unique ID, secret, etc. are valid.
- If valid, continue running the application.
- If invalid (including when OTP is not written), stop the application or report an error.
My questions are as follows:
Q1. Are there any sample codes available for TMS320F28379D that demonstrate a configuration using both a Secondary Bootloader and an Application?
Q2. Is it correct to assume that the Secondary Bootloader and the Application each require their own separate project and linker command file?
Q3. Are the following linker command file definitions for the Secondary Bootloader and Application correct?
→ Is it acceptable that the RESET vector is defined at the same address for both?
- Secondary Bootloader
MEMORY { PAGE 0: /* Program Memory */ BEGIN : origin = 0x080000, length = 0x000002 ... RESET : origin = 0x3FFFC0, length = 0x000002 FLASHA : origin = 0x080002, length = 0x001FFE /* Secondary bootloader area */ // FLASHB : origin = 0x082000, length = 0x002000 /* Undefined */ FLASHC : origin = 0x084000, length = 0x002000 /* Application area */ ... PAGE 1 : /* Data Memory */ ... } SECTIONS { .cinit : > FLASHA, ALIGN(8) PAGE = 0 .pinit : > FLASHA, ALIGN(8) PAGE = 0 .text : > FLASHA, ALIGN(8) PAGE = 0 codestart : > BEGIN PAGE = 0 ... .econst : > FLASHA, ALIGN(8) PAGE = 0 .switch : > FLASHA, ALIGN(8) PAGE = 0 .reset : > RESET, PAGE = 0, TYPE = DSECT /* not used */ ... }
- Application
MEMORY { PAGE 0: /* Program Memory */ BEGIN : origin = 0x084000, length = 0x000002 ... RESET : origin = 0x3FFFC0, length = 0x000002 FLASHA : origin = 0x080000, length = 0x002000 /* Secondary bootloader area */ // FLASHB : origin = 0x082000, length = 0x002000 /* Undefined */ FLASHC : origin = 0x084002, length = 0x001FFE /* Application area */ ... PAGE 1 : /* Data Memory */ ... } SECTIONS { .cinit : > FLASHD, ALIGN(8) PAGE = 0 .pinit : > FLASHD, ALIGN(8) PAGE = 0 .text : > FLASHD | FLASHE, ALIGN(8) PAGE = 0 codestart : > BEGIN PAGE = 0 ... .econst : >> FLASHF | FLASHG, ALIGN(8) PAGE = 0 .switch : > FLASHD, ALIGN(8) PAGE = 0 .reset : > RESET, PAGE = 0, TYPE = DSECT /* not used */ ... }
Q4. How should I implement the jump from the Secondary Bootloader to the Application?
→ Both the Secondary Bootloader and the Application are expected to execute _c_int00
first and then jump to _main
.
When each is programmed in Flash independently, the RESET vector points to _c_int00
, and execution proceeds in the order _c_int00 → _main
.
However, in the linker command files above, RESET is defined at the same address in both.
Wouldn’t this cause a conflict between the _c_int00 → _main
sequences of the two programs?
Would you please advise whether my understanding and configuration are correct, and how best to implement the jump sequence between the two?
Thank you very much for your time and support.