cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4xx, CCMRAM startup init

sony_nix
Associate
Posted on July 09, 2016 at 22:17

Hello guys,

Encountering the following problem:

static

__attribute__((__section__(

''.bss_CCMRAM''

)))

int

data;

''data'' is put explicitly into CCMRAM (verified with debugger) but is not automatically initialized with 0 at startup. After ''data'' takes a value, when a reset occurs (triggered by reset pin), value ''data'' maintains the old written value... I'm using the default linker script for Cortex-M (attached). The startup file which should clear the bss region is

https://sourceforge.net/p/gnuarmeclipse/se/ci/d0737bf75fec35242aa585fd8947c578addfdcad/tree/ilg.gnuarmeclipse.templates.core/templates/common/system/src/newlib/_startup.c

.
2 REPLIES 2
Posted on July 10, 2016 at 14:53

Well depending on the defines the startup code is either explicitly initializing the bss region, or going through a list. Is the linker creating a list? If it isn't then you are going to do it manually for you CCM BSS, and not just for the regular BSS.

#if !defined(OS_INCLUDE_STARTUP_INIT_MULTIPLE_RAM_SECTIONS)
// Zero fill the BSS section (inlined).
__initialize_bss(&__bss_start__, &__bss_end__);
#else
...

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
sony_nix
Associate
Posted on July 14, 2016 at 09:59

Hello clive1,

I was interested why, by default, the data_RAM, data_CCMRAM and bss_RAM are initialized accordingly at startup, but bss_CCMRAM isn't.

Meanwhile I updated the ldscript and startup code to initialize accordingly the bss_CCMRAM.

Thanks.