2016-07-09 01:17 PM
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
.
2016-07-10 05:53 AM
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
...
2016-07-14 12:59 AM
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.