s32k344 jumping to application from bootloader triggers hardfault

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

s32k344 jumping to application from bootloader triggers hardfault

Jump to solution
913 Views
lluo
Contributor III

Hi, 

Currently I am trying to jump to application from bootloader in s32k344. I am using the following code to do the task:

__asm volatile ("cpsid i");  // disable all the interrupts

S32_SCB->VTOR = (uint32)0x00601000;  // assign the start address of the vector table
 
__asm(" ldr r1, = 0x00600000");            // get the stack pointer value from the program's reset vector__
 
__asm(" mov sp, r1");
 
__asm(" ldr r1, = 0x00600004");            // get the program counter value from the program's reset vector
 
__asm(" mov pc, r1");
 
But the application code stops at hardfault_handler (0x0060614a HardFault_Handler)
The map file of the application code is generated as shown below:
lluo_1-1711624951786.png

Do you probably know why it triggers HardFault_Handler(0x0060614a HardFault_Handler)? Thank you in advance.

 
Tags (1)
0 Kudos
Reply
1 Solution
862 Views
danielmartynek
NXP TechSupport
NXP TechSupport
0 Kudos
Reply
5 Replies
863 Views
danielmartynek
NXP TechSupport
NXP TechSupport
0 Kudos
Reply
851 Views
lluo
Contributor III

Hi @danielmartynek ,

One more question, if I use the above method to jump to application which is running the FreeRTOS_Toggle_Led_Example_S32K344 demo, it works correctly. While if I use the above method to jump to application which is running the lwip_s32k344 demo, it can not work as expected. Do you probably know the reason for this? Thank you in advance. 

0 Kudos
Reply
828 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @lluo,

It requires some debugging on your side. The examples are provided AS IS with no guarantees and no support. Currently we do not have resources to support the demos.

 

Regards,
Daniel

0 Kudos
Reply
825 Views
lluo
Contributor III

Hi @danielmartynek ,

Noted. Thank you.

0 Kudos
Reply
859 Views
lluo
Contributor III

Hi @danielmartynek ,

The provided solution works for me. Thank you for the support.

0 Kudos
Reply