#include "config.h"
#include "start_boot.h"
#include "lib_mcu/wdt/wdt_drv.h"
Go to the source code of this file.
Functions | |
__no_init U32 boot_key | At (0x0100) |
void | start_boot (void) |
void | start_boot_if_required (void) |
void | goto_boot (void) |
Definition in file start_boot.c.
void start_boot | ( | void | ) |
This function will start the on-chip bootloader after a watchdog timer reset.
The function set a special key in sram (uninitialized during mcu start-up execution) and performs a mcu watchdog timer reset. This function should be called when a special eve,t is detected in the application that requires the bootloader activation. When this function is used, be sure to implement the "start_boot_if_required()" function at the begining of main().
Definition at line 83 of file start_boot.c.
00084 { 00085 boot_key=0x55AAAA55; 00086 00087 // Enable the WDT for reset mode 00088 wdtdrv_enable(WDTO_500MS); 00089 while(1); 00090 }
void start_boot_if_required | ( | void | ) |
This function calls the on-chip bootloader.
The function starts the on-chip bootloader if the application has posted such a request. This function sould be inserted at the begining of the main function.
Jumping to bootloader
Definition at line 98 of file start_boot.c.
Referenced by main().
00099 { 00100 if(boot_key==GOTOBOOTKEY) 00101 { 00102 boot_key = 0; 00103 (*start_bootloader)(); 00104 } 00105 }
void goto_boot | ( | void | ) |
This function jump to on-chip bootloader without CPU reset.
Jumping to bootloader
Definition at line 110 of file start_boot.c.