sn32 boards: support bootloader jump

This commit is contained in:
Dimitris Mantzouranis 2022-01-11 22:42:02 +02:00
parent ead342d090
commit c704bbd34d
4 changed files with 8 additions and 0 deletions

View File

@ -44,6 +44,7 @@ const PALConfig pal_default_config = {
#endif #endif
static int flag __attribute__((section(".flag"))) __attribute__((__used__)) = 0xAAAA5555; static int flag __attribute__((section(".flag"))) __attribute__((__used__)) = 0xAAAA5555;
extern void enter_bootloader_mode_if_requested(void);
/** /**
* @brief Early initialization code. * @brief Early initialization code.
@ -51,6 +52,7 @@ static int flag __attribute__((section(".flag"))) __attribute__((__used__)) = 0x
* and before any other initialization. * and before any other initialization.
*/ */
void __early_init(void) { void __early_init(void) {
enter_bootloader_mode_if_requested();
sn32_clock_init(); sn32_clock_init();
} }

View File

@ -44,6 +44,7 @@ const PALConfig pal_default_config = {
#endif #endif
static int flag __attribute__((section(".flag"))) __attribute__((__used__)) = 0xAAAA5555; static int flag __attribute__((section(".flag"))) __attribute__((__used__)) = 0xAAAA5555;
extern void enter_bootloader_mode_if_requested(void);
/** /**
* @brief Early initialization code. * @brief Early initialization code.
@ -51,6 +52,7 @@ static int flag __attribute__((section(".flag"))) __attribute__((__used__)) = 0x
* and before any other initialization. * and before any other initialization.
*/ */
void __early_init(void) { void __early_init(void) {
enter_bootloader_mode_if_requested();
sn32_clock_init(); sn32_clock_init();
} }

View File

@ -44,6 +44,7 @@ const PALConfig pal_default_config = {
#endif #endif
static int flag __attribute__((section(".flag"))) __attribute__((__used__)) = 0xAAAA5555; static int flag __attribute__((section(".flag"))) __attribute__((__used__)) = 0xAAAA5555;
extern void enter_bootloader_mode_if_requested(void);
/** /**
* @brief Early initialization code. * @brief Early initialization code.
@ -51,6 +52,7 @@ static int flag __attribute__((section(".flag"))) __attribute__((__used__)) = 0x
* and before any other initialization. * and before any other initialization.
*/ */
void __early_init(void) { void __early_init(void) {
enter_bootloader_mode_if_requested();
sn32_clock_init(); sn32_clock_init();
} }

View File

@ -44,6 +44,7 @@ const PALConfig pal_default_config = {
#endif #endif
static int flag __attribute__((section(".flag"))) __attribute__((__used__)) = 0xAAAA5555; static int flag __attribute__((section(".flag"))) __attribute__((__used__)) = 0xAAAA5555;
extern void enter_bootloader_mode_if_requested(void);
/** /**
* @brief Early initialization code. * @brief Early initialization code.
@ -51,6 +52,7 @@ static int flag __attribute__((section(".flag"))) __attribute__((__used__)) = 0x
* and before any other initialization. * and before any other initialization.
*/ */
void __early_init(void) { void __early_init(void) {
enter_bootloader_mode_if_requested();
sn32_clock_init(); sn32_clock_init();
} }