my_abousamra
Junior Member level 3
Hi,
I want to store a variable value between microcontroller resets (not power off). The case is that the microcontroller goes to sleep and woke up by interrupt caused by a button press where in interrupt handler I should assign a certain value to a variable and reset the controller and after controller reset it should read the new value. I tried to do it using no init section in linker script but it doesn't work. Here's what I did
and in gnu ld linker script
I'm using AT91SAM7X microcontroller and gnu arm tools
thanks
I want to store a variable value between microcontroller resets (not power off). The case is that the microcontroller goes to sleep and woke up by interrupt caused by a button press where in interrupt handler I should assign a certain value to a variable and reset the controller and after controller reset it should read the new value. I tried to do it using no init section in linker script but it doesn't work. Here's what I did
Code:
uint8 u8FastOperationAfterReset __attribute__ ((section (".noinit"))); // a variable changed in ISR then reset the controller
and in gnu ld linker script
Code:
.noinit :
{
_noinit_start = . ;
*(.noint)
} >ram
. = ALIGN(4);
_noinit_end = . ;
I'm using AT91SAM7X microcontroller and gnu arm tools
thanks