We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all,
I have try to develop an ethernet bootloader via tftp. First program (bootloader is placed in 0x0000-0xFFFF adress area) gets bin file from tftp-server and flashes it to from 0x10000 to the end of IROM. After all it jumps using this:
__asm void boot_jump( uint32_t address ) { LDR SP, [R0] ;Load new stack pointer address LDR PC, [R0, #4] ;Load new program counter address } /** * @brief Jump to second program * * @param address */ void jumpToProgram (uint32_t address) { SCB->VTOR = address & 0x3FFFFF80; boot_jump(address); } //some code here ... // jumping to second program from bootloader else if(memcmp("jump\r", str, strlen("jump\r")) ==0 ) { vTaskEndScheduler(); jumpToProgram(0x10000); } ... //some code here
Second program is shifted to 0x10000 by compiler (IROM1 start parametr is 0x10000). It works if I don't use any RTOS in second program. If I do, then program crashes at starting sheduler (vTaskStartScheduler() in FreeRtos or os_sys_init() in RTX). Furthermore I figured out that if I exclude frome bootloader file EMAC_LPC177x_8x.c the second program starts working (sheduler starts) after jumping in it from bootloader. What is wrong? Regards Vasilij
Per Westermark , Thank you for your reply.
SCB->VTOR = address & 0x3FFFFF80; <--- This is remaping interupt vectors. And yes I sure about protection mode.