Hello,
I'm developing in C language for the AT32UC3C2512C compiling with a makefile and using the avr32-gcc.exe (AVR_32_bit_GNU_Toolchain_3.4.3_820) 4.4.7
I'ld like to have a global variable not initialised at startup when the a reset occurs(watchdog reset for instance).
I've read this tuto: https://www.avrfreaks.net/forum/...
and tried to declared my variable like this:
board_flag board_flags __attribute__((section(".noinit")));
Seeing the map file generated by the toolchain, I can see that this variable is well put in the noinit section (not in bss).
Map file generated:
.noinit 0x0000015c 0x5a load address 0x8000d5c0
.noinit 0x0000015c 0x58 src/adc.o
.noinit 0x000001b4 0x2 src/driver/board.o
0x000001b4 board_flags.data1
*(.data1).balign 0x000001b6 0x2 load address 0x8000d61a
0x000001b8 . = ALIGN (0x8)
*fill* 0x000001b6 0x2
0x000001b8 _edata = .
0x000001b8 _edata = .
0x000001b8 PROVIDE (edata, .)
0x000001b8 __bss_start = ..bss 0x000001b8 0x2b58 load address 0x8000d61c
However this variable is still cleared during startup. Having seen the ld file I've noticed that the noinit section is not declared anywhere.
Is there a way to tell the toolchain to not initialize this variable at startup? If possible without modifying the ld file (currently using the default provided with the toolchain).
Thank you very much for your help.
Louis