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.

TMS320F280049C: Store a variable to a certain address in RAM

Part Number: TMS320F280049C

Hey TI-Team,

I want to store a variable to a certain address and get the reset cause. I reset my device by using the driverlib function:

SysCtl_resetDevice();

Now, I can invoke

 SysCtl_getResetCause(); 

in order to get the reset cause. Since I want to distinguish between intended reset (my software triggering the watchdog reset) and unintended reset, the watchdog timing out, I want to store 

a intended reset flag in ram. This should be possible, since the tmsf280049c ( this is not the case for every ti uc! ) will not erase ram on watchdog reset. 

Now in the linker command file I added:

MEMORY
{

...

   RAMLS7      : origin = 0x00B800, length = 0x000800 

...

}

SECTIONS
{ ....

   .resetCause : > RAMLS7, PAGE = 1 

....} 

and in my *.c file in global space:

#pragma DATA_SECTION(resetTriggered, ".resetCause")

uint16_t resetTriggered;

compiling result in .map:

.resetCause
* 1 0000b800 00000001 UNINITIALIZED
0000b800 00000001 myTestObj.obj (.resetCause)

The Handbook only states: 

After a POR, the boot ROMs will clear the M0/M1, LSx, GSx, and message RAMs to ensure that they contain valid ECC or parity.

Same counts for the boot section. 

And in this post the tmsf280049  is mentioned as not resetting ram, but since I use the tmsf280049c.. (https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/742852?TMS320F280049-Which-reset-source-will-cause-the-clear-of-RAM-data-on-F280049

This behavior is recognized in release/debug mode. What do I miss out?

Thanks in advance.

  • Hi Jan,

    Are you seeing the variable getting initialize to 0x0 after watchdog reset. If yes then that may be because of initialization of global variables as part of init function. You can avoid this by using NOINIT for that specific section in cmd file where this variable is stored (like below) -

    AdcaRegsFile               : > ADCA, type=NOINIT

    Regards,

    Vivek Singh