Kinetis Rtx bootloader jump rtx app

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Kinetis Rtx bootloader jump rtx app

1,519件の閲覧回数
bastien
Contributor I

Hello !

I wrote an RTX bootloader with (based on http_server démo from keil) at 0x0 using LAN Ethernet (for updating) and uart (for debuging) to jump to the USER application at 0x00080000 address.

I try the following with my boot :

https://github.com/UltimateHackingKeyboard/bootloader/tree/master/apps/led_demo/MK64F12/mdk/led_demo... 

I changed the scatter file from 0x0000a000 to 0x00080000 and The jump works !

I copyed my bootloader and modify it to get an USER APP at 0x00080000.

The problem is that the bootloader jump again and again to my USER APP.

If I use the bootloader from the github source the jump works !

https://github.com/UltimateHackingKeyboard/bootloader/tree/master/targets/MK64F12/mdk/freedom_bootlo...

I searched for hours but i don t understand the problem.

Someone to give me some help? Any idea?

Thank you ! 

0 件の賞賛
返信
4 返答(返信)

1,253件の閲覧回数
bastien
Contributor I

Hello !

I found the problem,

When i loaded the firmware in to the flash, at 0x400 i miss an byte, this is why with the little blinky firmware the jumps works (less than 0x400).

Also, after a NVIC_SystemReset() I don't need to __set_CONTROL(0);

Bye

0 件の賞賛
返信

1,253件の閲覧回数
bastien
Contributor I

Hello,

I don't succed to jump to my User APP firmware.. 

Some one have an idea ?

Thanks

here, a piece on my code :

__asm void boot_jump( uint32_t address )
{
LDR SP, [R0]
LDR PC, [R0, #4]
}

void execute_user_code(void)
{
/* Change the Vector Table to the USER_FLASH_START
in case the user application uses interrupts */

//__disable_irq();

SysTick->CTRL &= ~0x00000002;

SCB->VTOR = (uint32_t)USER_FLASH_START;

boot_jump(USER_FLASH_START);

}

/*----------------------------------------------------------------------------
Main Thread 'main': Run Network
*---------------------------------------------------------------------------*/
int main (void)
{

if(Flash_ReadFW()==0)
{
execute_user_code();
}

osKernelInitialize (); // initialize RTOS kernel

hardware_init();
LED_Initialize ();
Buttons_Initialize ();
debug_printf("\r\n\r\nBootloader by - GB\r\n"); // ne pas oublier de cocher MicroLIB dans les options du projet !!!

osThreadNew(blinky_Thread, NULL, NULL); // Create application main thread
osThreadNew(LAN_Thread, NULL, NULL); // Create application main thread


osKernelStart (); // start kernel with job2 execution
while(1);
}

0 件の賞賛
返信

1,253件の閲覧回数
mjbcswitzerland
Specialist V

Hi

If the boot loader jumps repeatedly to the application it presumably means that the application crashes.

See appendix B of the following document for a checklist of various things that may be necessary for boot loader and application compatibility: http://www.utasker.com/docs/uTasker/uTaskerSerialLoader.pdf

Note that there is also a K66 Ethernet (web server) and HS USB boot loader at
http://www.utasker.com/kinetis/FRDM-K66F.html

Regards

Mark

Complete Kinetis solutions for faster/more efficient professional needs, training and support: http://www.utasker.com/kinetis.html
i.MX RT project compatibility: http://www.utasker.com/iMX.html
Including FreeRTOS integration for all Kinetis parts

Kinetis K66:
- http://www.utasker.com/kinetis/TWR-K65F180M.html
- http://www.utasker.com/kinetis/FRDM-K66F.html
- http://www.utasker.com/kinetis/TEENSY_3.6.html

uTasker: supporting >1'000 registered Kinetis users get products faster and cheaper to market

Request Free emergency remote desk-top consulting at http://www.utasker.com/services.html

Open Source version at https://github.com/uTasker/uTasker-Kinetis

https://community.nxp.com/thread/512558
https://community.nxp.com/thread/352862
https://community.nxp.com/thread/498809

0 件の賞賛
返信

1,253件の閲覧回数
bastien
Contributor I

Hi !

Thank you Marc ! I changed the boot_jump function and I have a hardfault now.

In the following link, I add the bootloader, the user App (bootloader with scatter modified) and a blinky project.

=>   The bootloader jump to the blinky application

=>   The Kinetis example Bootloader jump to my User App 

=>   My bootloader don't jump to the User App (with hardfault)

https://drive.google.com/open?id=13T5lvo5zAy4W6icKHSAMxPKaFmfpnz8Z 

Something in my User App or in the bootloader fails the jump..

Is it due to the RTX bootloader try to jump to an RTX firmware ?

Thank for you help ! :smileyhappy:

0 件の賞賛
返信