Bootloader and buspal

cancel
Showing results for 
Search instead for 
Did you mean: 

Bootloader and buspal

27 Views
fabiobenevento
Contributor III

Hi,

for my project I have two board with K64F microcontroller. One is master and have UART and one is slave and have only CAN. What I would like to do is have the possibility to program the master board directly via the blhost command or use the master borad to program the slave board via buspal.

To do this I should have bootloader, buspal and my application in flash memory for example booloader at 0x0000, buspal at 0xa000 and my application at 0x10000. My doubts are about how to do this.

In the bootloader code I saw there is a function jump_to_application(applicationAddress, stackPointer) to jump to application that expect application address an stack pointer parameter that are calculated by get_user_application_entry function. In my case for my application the address is 0x10000 but where the stackpointer is obtained from?

Also I wanted to know if there is a description of the buspal protocol to better understand which messages are sent for the various commands.

Thank you very much

0 Kudos
2 Replies

20 Views
fabiobenevento
Contributor III

Hi,

I was able to do what I wanted. 

However, I have a doubt about the linker file of the two applications (.ld)

Currently the start address is different but they both have the same size of the text area (of the entire flash) and the same stack position.
Everything seems to work the same but is that correct?

Below is an excerpt of the two linker files:

linker file app 1 (0xa000):

MEMORY
{
m_interrupts (RX) : ORIGIN = 0x0000a000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x0000a400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x0000a410, LENGTH = 0x000FFBF0
m_data (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00040000
}

linker file app 2 (0x10000):

MEMORY
{
m_interrupts (RX) : ORIGIN = 0x00010000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00010400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00010410, LENGTH = 0x000FFBF0
m_data (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00040000
}

Thank you in advance!

 

0 Kudos

9 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi fabiobenevento,

It is fine. When jump to buspal, the bootloader's work is end. It's stack can be reused.

 

Regards,

Jing

0 Kudos