Hard Fault When Jumping to MQXv5 Application From Bootloader

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

Hard Fault When Jumping to MQXv5 Application From Bootloader

Jump to solution
1,810 Views
BTaylor
Contributor III

I currently have an application using MQXv5 on a custom K66-based board that executes just fine unless I relocate the code from a base of 0x0000 to a base of 0xF000 (to accommodate a bootloader) and then jump to the application entry point (__boot) from the bootloader.

I am using IAR EWARM 9.10 as my IDE.

When jumping to the code from the bootloader, the application raises a hard fault early in the initialization process.

More specifically, a hard fault is raised in __iar_data_init3 due to a data access error.

The Bus Fault Address Register - BFAR - indicates an address of 0x3b10e
The Vector Table Offset Register - VTOR - indicates an address of 0x1fff0000

From the linker map file for my application:

"P1", part 2 of 2:                   0x136
Initializer bytes   const   0x3'b001 0x10d <for P3 mid-1>
Initializer bytes   const   0x3'b10e 0x26  <for rw section .vectors_ram-1>
Initializer bytes   const   0x3'b134 0x3   <for KERNEL_DATA-1>
                          - 0x3'b137 0x136

"A1":                                0x400
rw section .vectors_ram-1
                            0x1fff'0000 0x400 <Init block>
        .vectors_ram inited 0x1fff'0000 0x400 vectors.o [4]
                          - 0x1fff'0400 0x400

My linker file is attached.

Any idea what might be causing the data access error when running the app from the bootloader or what I might do next to further debug the issue?

Thank you.

Tags (2)
0 Kudos
1 Solution
1,764 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Coldfirefan:

MQX v5 is under commercial license. I would suggest you contact with mqxsales@nxp.com for support.

 

By default, MQX allocates the vector tale at the first address of the flash memory, 0x0000-0000, Because this region of flash memory is used by your bootloader, it  will be necessary to reallocate the vector table in a RAM section.

Please refer to AN4367 for more details. This application note describes how to add the FENT bootloader to kinetis projects. There is a section that includes adding it to the MQX linker which is the section you will find useful.

 

Regards

Daniel

View solution in original post

0 Kudos
1 Reply
1,765 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Coldfirefan:

MQX v5 is under commercial license. I would suggest you contact with mqxsales@nxp.com for support.

 

By default, MQX allocates the vector tale at the first address of the flash memory, 0x0000-0000, Because this region of flash memory is used by your bootloader, it  will be necessary to reallocate the vector table in a RAM section.

Please refer to AN4367 for more details. This application note describes how to add the FENT bootloader to kinetis projects. There is a section that includes adding it to the MQX linker which is the section you will find useful.

 

Regards

Daniel

0 Kudos