cancel
Showing results for 
Search instead for 
Did you mean: 

DTCM NOT Losing Contents On Power Off

C-Coder
Visitor

I'm using an STM32H747XI Discovery board for testing. I seem to have the opposite problem of everyone else, my DTCM value is NOT clearing upon losing power.

 

I have the following in my LD script:

 

 

MEMORY
{
...
/* Put NOINIT at the top of the DTCM block. */
NOINIT (rwx)    : ORIGIN = 0x20000000 + 128K - 0x100, LENGTH = 0x100
...
}

...

SECTIONS
{
...
  .noinit (NOLOAD) :
  {
/*    KEEP(*(*.noinit*)) */
    *(.noinit*)
  } > NOINIT
...
}

 

 

 

and in the code I have:

 

 

#define ENABLE_BLUSB_MAGIC 0xDEADBEEF

__attribute__((section(".noinit"))) volatile int g_iEnableBLUSB;

int main(void)
{
if (g_iEnableBLUSB != ENABLE_BLUSB_MAGIC)
{
...
g_iEnableBLUSB = ENABLE_BLUSB_MAGIC;
}
...
}

 

 

 

The first time I debug using STM32CubeIDE, g_iEnableBLUSB will not be the magic number, this is the correct behavior. I then disconnect and debug again, g_iEnableBLUSB will be the magic number; this is also the correct behavior. Now if I power off the board, wait some amount of time (waited over 10 minutes just to see), plug the USB back in to power up the board, it immediately behaves as if g_iEnableBLUSB matches the magic number (this is the incorrect behavior).

What am I missing here? Shouldn't that DTCM block (and the same for the SRAM blocks) go to random values upon chip power up?

 

Thanks - C-Coder

0 REPLIES 0