LPC54608 Secondary bootloader jump and main app debugging

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

LPC54608 Secondary bootloader jump and main app debugging

1,706 Views
cybaluke
Contributor III

Hi, i'm working with LPC54608 and MCUxpresso, I have already coded my main application and now I have to code a secondary bootloader, so I have some question about this:

1 - first I've moved the main app at the 0x8000 address (32kB sector) in flash using the MCUxpresso's memory setting option, but now I can't debug this app because when I launch the debug session the debugger doesn't break in the main function but jumps in a wrong RAM location (the flash memory from 0x0 to 0x7FFF is empty). What I'm missing to correctly debug the main relocated app?

2 - For my Secondary Bootloader first step I've tryed to make a bootloader that only should jump immediatly at the main app (at the flash address 0x8000) but I have some problems with the jump so  what is the right calling code to jump from  the secondary bootloader to main app?

3 - what is the right code to jump back from main app to the bootloader at 0x00000000 address?

4 - is it possible automatically upload the SecondaryBootloader firmware together the main app during the main app debugg session  launch?

Labels (3)
3 Replies

818 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Cybaluke,

Which debugger connection are you using?  

I would recommend you to use the LPC1700 secondary USB bootloader as reference:

http://cache.nxp.com/docs/en/application-note/AN10866.zip

This is the function used by the bootloader to jump to the application:

__asm void boot_jump( uint32_t address ){
   LDR SP, [R0]        ;Load new stack pointer address
   LDR PC, [R0, #4]    ;Load new program counter address
}

 

You can debug both the bootloader and the application by adding the following command to your debug Run Commands in the bootloader debug connection:
add-symbol-file filename address
As an example:

 

add-symbol-file C:\\Users\\Documents\\MCUXpressoIDE_10.xxx\\workspace\\MK64FN1M0xxx12_Project_2\\Debug\\MK64FN1M0xxx12_Project_2.axf 0x80000

 

pastedImage_1.png

 

The address 0x80000 corresponds to the first flash section of the second project which was previously flashed to the MCU:

 

pastedImage_3.png


Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos

818 Views
cybaluke
Contributor III

Any comment about my reply/question?

thanks Carlos for the answer,

but.... I'm using the MCUXpresso LinkServer Debugger with the OM13092 lpclink onboard debugger for my first tests and then I use an LPC_LINK2 debugger for my custom target board (via SWD connection), so I can't find the "add-symbol-file filename address" equivalent settings you suggested for my debug configurations. I think your solution is right for the Segger debug interface, isn't it?

Is there an equivalent solution for the LinkServer debugger configuration for loading and debugging both the bootloader (@0x0000 address) and the main app (@0x8000 address) projects?

0 Kudos

818 Views
cybaluke
Contributor III

thanks Carlos for the answer,

but.... I'm using the MCUXpresso LinkServer Debugger with the OM13092 lpclink onboard debugger for my first tests and then I use an LPC_LINK2 debugger for my custom target board (via SWD connection), so I can't find the "add-symbol-file filename address" equivalent settings you suggested for my debug configurations. I think your solution is right for the Segger debug interface, isn't it?

Is there an equivalent solution for the LinkServer debugger configuration for loading and debugging both the bootloader (@0x0000 address) and the main app (@0x8000 address) projects?