bootloader jump to app

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

bootloader jump to app

837 Views
Jackson_Ping
Contributor II

At present, I am upgrading the bootloader of S32K344. After the upgrade, the boot fails to jump to the app. I have done the following steps in total:

1. Assign the app address value to the vector table offset register

S32_SCB->VTOR = 0x600000 ;

2. Jump to the address of reset interrupt function in the APP interrupt vector table

((JumpToPtr) (*((uint32 *)( 0x600000 + 4))))();

3. Only this sentence of the LD file has been changed in the app firmware:

int_pflash : ORIGIN = 0x00600000, LENGTH = 0x001D4000

PE can run the APP firmware in a single step directly (app firmware can run normally), but the following situation occurs when jumping after the app is upgraded.

“Break at address "0x600800" with no debug information available, or outside of program code.”

Of course, I have also tried to jump directly after entering the boot, and this information still appears. I don't know where the problem is, but on the K1 chip these operations are OK. But at present, this problem appears on K3, is the kernel of M7 "app_address+4" is not the position of the reset function in the interrupt vector table? Is it something else? Is there a solution to this problem?

0 Kudos
7 Replies

108 Views
JonAnder_Amante
Contributor I

Hi, I am using the project "S32K344_Can_bootloader_RTD200" in the microprocessor S32K344. I want to download an application with the program of bootloader. I have achieved the jump from program to application but I have different questions. 1. I want to use #define EN_DELAY_TIME but when I uncomment the command in the folder "public_in", the program has different errors. My target to use "Backdoor", that is to say, I want to check if the program has to enter to bootloader or not. I don´t know the process and the different functions that I have to use to achieve the target. I want to use the function "Boot_CheckReqBootloaderMode(void)" but when I debug the program, it never enters to the "if". Could you explain me the process and the steps to achieve the target. I add different functions that I think are important. 2. I don´t know if I have to modificate the parameters of "static tJumpAppDelayTimeInfo gs_stJumpAPPDelayTimeInfo = {FALSE, 0u};". I have to change this structure ? You can see all structure in one of the next pictures. I need the reply as soon as possible since I have to send a project very soon. 

 

JonAnder_Amante_0-1713768678337.png

 

 

 

 

 

JonAnder_Amante_1-1713768678340.png

 

 

 

 

 

JonAnder_Amante_2-1713768678341.png

 

 

 

 

 

JonAnder_Amante_3-1713768678350.png

 

 

 

 

 

JonAnder_Amante_4-1713768678343.png

 

 

Thank you for all,

0 Kudos

770 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Jackson_Ping,

Can you try this code?

ADDR_APP = 0x600000;

func = *(UINT32 volatile *)(ADDR_APP + 0xC);
func = *(UINT32 volatile *)(((UINT32)func) + 0x4);
func = (((UINT32)func) & 0xFFFFFFFEU);
(* (void (*) (void)) func)();

At ADDR_APP there should be 0x5AA55AA5
At ADDR_APP + offset 0xC, there is the core start address.
(RM, Table 189. Image vector table).

 

Regards,

Daniel

0 Kudos

552 Views
scott071209
Contributor II

Hello ,

i have used same program. for K344, it's OK to jump from bootloader to APP. But when I used same way to test K311. it doesn't jump. Could you give some suggestion? 

0 Kudos

548 Views
Jackson_Ping
Contributor II

You need to find the exact location of the interrupt vector table correctly. The location of the interrupt vector table for K1 and K3 is different. The interrupt vector table can be found in the LD file or map table.

0 Kudos

767 Views
Jackson_Ping
Contributor II

Hi.Daniel,

Thank you very much for your answer,I've solved my problem.

But I still have a problem, that is, I found a piece of code in the LD file, a piece of content called "boot_header" occupies 2048 bytes, I am not very clear what "boot_header" means微信图片_20231122102637.png

 

 

0 Kudos

759 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Jackson_Ping,

The boot_header does not occupy 2048B it is just alligned to this value.

The boot_header is defined in startup_cm7.s

danielmartynek_0-1700649832106.png

RM rev7, Table 189. Image vector table

 

BR, Daniel

753 Views
Jackson_Ping
Contributor II

Hi.Daniel,

I have understood.

Thanks for your answer!

 

 

Best Regards,

Jackson

 

0 Kudos