feat(bootloader): Bootloader check and loader target application

This commit is contained in:
Dong Heng
2018-07-11 19:40:56 +08:00
parent cb0c5ee5fc
commit 583a875910
3 changed files with 28 additions and 43 deletions

View File

@ -29,7 +29,7 @@
#define FLASH_MAP_ADDR 0x40200000
extern void chip_boot(void);
extern void chip_boot(size_t start_addr, size_t map);
extern int rtc_init(void);
extern int mac_init(void);
extern int base_gpio_init(void);
@ -66,7 +66,7 @@ static void user_init_entry(void *param)
wifi_task_delete(NULL);
}
void call_user_start(void)
void call_user_start(size_t start_addr, size_t map)
{
int i;
int *p;
@ -91,6 +91,8 @@ void call_user_start(void)
for (p = &_bss_start; p < &_bss_end; p++)
*p = 0;
chip_boot(start_addr, map);
__asm__ __volatile__(
"rsil a2, 2\n"
"movi a1, _chip_interrupt_tmp\n"
@ -99,8 +101,6 @@ void call_user_start(void)
"movi a2, 0x40100000\n"
"wsr a2, vecbase\n");
chip_boot();
wifi_os_init();
assert(wifi_task_create(user_init_entry, "uiT", 2048, NULL, wifi_task_get_max_priority()) != NULL);