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.

TMS320F28379D: TMS320F28379D: NOINIT variable in RAMGS resets to zero after SysCtl_resetDevice()

Part Number: TMS320F28379D

Hello,

I am developing a custom Bootloader for the TMS320F28379D and I am facing an issue with preserving a status flag in RAM across a software reset.

I need to pass a "Boot Flag" from the Main Application to the Bootloader to force an update mode.

  1. Application writes a magic value to a shared variable in RAM.

  2. Application triggers a software reset using SysCtl_resetDevice().

  3. Bootloader starts, checks the variable, and stays in boot mode if the magic value is present.

Even though I have defined the section as type = NOINIT in the Linker Command File, the variable appears to be re-initialized (cleared to 0) or overwritten after the software reset. When the Bootloader reads it, the value is gone.

My Implementation:

1. C Code (Declaration): I am using #pragma NOINIT and ensuring the variable is not explicitly initialized in the code.

image.png

 

2. Linker Command File (.cmd): I mapped the section to RAM_EXCHANGE in Global Shared RAM on PAGE 1.

 

image.png

image.png

My Questions:

  1. Is there any mechanism in the standard TI _c_int00 startup routine that might override the NOINIT attribute for sections in GS RAM?

  2. Does the device Boot ROM execution (which runs immediately after the reset and before my Bootloader) use or clear specific areas of the RAMGSx, potentially overwriting my flag?

  3. Is there a recommended "safe" RAM location for persistent flags across software resets on the F2837xD?

Any advice on how to keep this data persistent would be appreciated.

Thank you.