GaIA BIOS Library
Loading...
Searching...
No Matches
Board reset

Board reset functions are provided to reset and restart GaIA with a defined post-reset behavior. Scope of these functions is to provide a clean environment, without any initialized peripheral, for the restarted program. These functions are particularly useful when a user bootloader is installed in the first flash sector.

Core function of reset operation is gwa_boot_handler(), which should be called immediately after reset, before any initialization is done, and takes care of the post-reset behaviour, based on the conditions requested by the caller of reset functions.

int main(void)
{
...
}
void gwa_boot_handler(void)
This function handles the reset exit, based on the requested conditions.

gwa_boot_handler() makes use of two 32-bit dedicated variables, allocated in the .bss.uninit section, to save the desired post-reset state. The linker script must take care of that and place the section accordingly, as follows.

Arm KEIL scatter file example:

RW_IRAMRESET 0x2001FFF0 UNINIT 0x00000010
{
gwa_reset.o (+ZI)
}

GCC Linker file example:

.reset (NOLOAD) :
{
. = ABSOLUTE(0x2001fff0);
*libgwa_lib.a:gwa_reset.o(.bss.uninit);
} >DTCMRAM