KBOOT ROM never executes application, bootloops

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

KBOOT ROM never executes application, bootloops

ソリューションへジャンプ
992件の閲覧回数
xxxajk
Contributor III

As the title says, just reenters ROM after timeout.

MKE16F512VLH16

K1.5.1 ROM

BCA:

0x3c0: 6b 63 66 67 ff ff ff ff ff ff ff ff ff ff ff ff
0x3d0: ff ff e8 03 ff ff ff ff ff ff ff ff ff ff ff ff
0x3e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x3f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff

Flash configuration field:

0x400: ff ff ff ff ff ff ff ff ff ff ff ff de fb ff ff

                                            ^^

                                           ||

                                      boot from rom

If I disable ROM and only enable with BOOT0 pin, the application runs as expected.

Two quesions to help resolve the issue:

Is there something the ROM configs that is causing a fault in my start up code? I can post my start up code if required.

Does Zeroing RAM at start up of app cause the fault?

1 解決策
730件の閲覧回数
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Andrew

Actually, your application is executing after timeout, the problem is that the WDOG interrupt is happening and you get into the ROM bootloader again.

There is a Errata in this chip about the WDOG, please check the following link: https://www.nxp.com/docs/en/errata/Kinetis_E_0N79P.pdf 


So, when you boot from the ROM bootloader and then jump to the application, you need a delay before you continuing your program execution. I added a little delay in the Reset Handler, so now my application can run without problems.

void ResetISR(void) {
     unsigned int i=100;
         while(i--){}
    // Disable interrupts
    __asm volatile ("cpsid i");
#if defined (__USE_CMSIS)
// If __USE_CMSIS defined, then call CMSIS SystemInit code
    SystemInit();
...

Inside the SystemInit you will find the WDOG disable.

Hope this could help you,

Best Regards

Jorge Alcala

元の投稿で解決策を見る

3 返答(返信)
730件の閲覧回数
xxxajk
Contributor III

Flash configuration field:

0x400: ff ff ff ff ff ff ff ff ff ff ff ff de fb ff ff

                                               ^^

                                              ||

                                         boot from rom

Was off-by one. Anyway....

0 件の賞賛
731件の閲覧回数
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Andrew

Actually, your application is executing after timeout, the problem is that the WDOG interrupt is happening and you get into the ROM bootloader again.

There is a Errata in this chip about the WDOG, please check the following link: https://www.nxp.com/docs/en/errata/Kinetis_E_0N79P.pdf 


So, when you boot from the ROM bootloader and then jump to the application, you need a delay before you continuing your program execution. I added a little delay in the Reset Handler, so now my application can run without problems.

void ResetISR(void) {
     unsigned int i=100;
         while(i--){}
    // Disable interrupts
    __asm volatile ("cpsid i");
#if defined (__USE_CMSIS)
// If __USE_CMSIS defined, then call CMSIS SystemInit code
    SystemInit();
...

Inside the SystemInit you will find the WDOG disable.

Hope this could help you,

Best Regards

Jorge Alcala

730件の閲覧回数
xxxajk
Contributor III

Thanks so much!

I'll have the MCU do other set up during this time, if possible, instead of the simple loop.

Also FWIW I'm not using any tools from NXP/Freescale or anyone else, but I now get the gist of what needs to be done.

0 件の賞賛