Bootloader jump to APP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bootloader jump to APP

1,815 Views
w_lingjun
Contributor III

Hi,

 

I'm working on FBL development based on S32K142, and I've programmed the app code into flash by FBL successfully, but after boot, I can't start app because it will get stuck in WDOG_EWM_IRQHandler(); as the following picture.

I put the jump function at the begin of FBL code, it can jump to app, so I think the jump function is correct. But if I put the jump function after SBC_Init(), it can't jump to app. It seems that SBC will effect the jump function. What should I do before jump from boot to app except disable all interrupts? Is there any special operation for SBC?

error.png

Best regards,

Sarah

0 Kudos
5 Replies

1,584 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hi Sarah,

Unfortunately, I do not know what your SBC_Init() function does.

Can you share your code?

Also, you can use as reference serial bootloader for the S32K1xx devices:

https://www.nxp.com/docs/en/application-note/AN12218.pdf 

SW:

https://www.nxp.com/docs/en/application-note-software/AN12218SW.zip 

I hope it helps.

Best regards,

Diana

0 Kudos

1,583 Views
w_lingjun
Contributor III

Hi Diana,

SBC_Init(); is a function from SDK, it's in the following file. It is the initial function for UJA1169, which is a CAN transciever. We must download program by CAN on the car, so I can't use the bootloader you suggested.

Best regards,

Sarah

0 Kudos

1,583 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hi Sarah,

I understand, but you can check, for example, the jump function. You can see how to move vector table VTOR in that example. Also, you can see how to set the linker files for the bootloader and for the application.

Best regards,

Diana

0 Kudos

1,583 Views
w_lingjun
Contributor III

Hi Diana,

I've checked the bootloader linker file of example, and I have a question want to ask.

  /* Flash */
  m_interrupts          (RX)  : ORIGIN = 0x00000000, LENGTH = 0x00000400
  m_flash_config        (RX)  : ORIGIN = 0x00000400, LENGTH = 0x00000010
  m_text                (RX)  : ORIGIN = 0x10000000, LENGTH = 0x00001000 /* Only 4 kB are allowed for the bootloader */

The bootloader start from 0x10000000, is it right? It is not in PFlash.

And about application linker file, also want to confirm.

/* Flash */
  m_interrupts          (RX)  : ORIGIN = 0x00001000, LENGTH = 0x00000400
  m_flash_config        (RX)  : ORIGIN = 0x00001400, LENGTH = 0x00000010
  m_text                (RX)  : ORIGIN = 0x00001410, LENGTH = 0x0017EBF0

In the reference manual, the flash config register stored from 0x00000400 to 0x00000040F. Above setting means there is a copy of flash config at 0x00001400?

flash config.png

I have programmed application code into flash successfully, but I can't jump from bootloader to application.

I make two test in my bootloader project as below.

1)

main()

{

   Board_Init();

   Jump2App();

} // It can jump to application code.

2)

main()

{

   Board_Init();

   UJA1169_Init(); //SBC init

   Jump2App();

} // It can't jump to application code.

So I guess there is some special operation for UJA1169 before jump to application code. Is there anybody familiar with UJA1169 or have similar problem with me?

Best regards,

Sarah

0 Kudos

1,583 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hi Sarah,

The bootloader from this example is placed into DFLASH. So, yes, it starts at 0x1000_0000 address. It is up to you where you want to place the bootloader.

Flash configuration field is only one and it is at fixed address. So, flash config is copied to 0x1400, but the m_flash_config from the bootloader will be used. 

Back to your issue. I'm not an SBC expert, but the SBC driver enables watchdog. So, I'm not sure when or if you feed the dog. I recommend you to look at the manual of the SBC, there is a possibility in Software Development mode disable watchdog for debugging purposes.

Also, I recommend you to jump into the application directly after reset.

Best regards,

Diana

0 Kudos