lpcware

LPC1788 + FreeRtos or RTX + bootlader + Ethernet

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Dfcbkbq on Wed Nov 06 23:10:18 MST 2013
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);
        }
...

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

Outcomes