Fixed Jump location for bootloader

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

Fixed Jump location for bootloader

943 Views
girishkumarvast
Contributor II

Hi ,

I am working on KE02 and KL02 bootloader code and i want to have a fixed jump location address in application code. What are the options available to achieve a fixed known jump location in KDS?

Labels (1)
5 Replies

504 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ,

Which bootloader do you used ?

If you want change the jump location , at least you need change two place.

On the bootlaoder code ,change the jump address ;

on the application code ,change the linker file , change it from the "jump address" to start.

If you still have question , you can show your code .

Hope it helps

Alice

0 Kudos

504 Views
girishkumarvast
Contributor II

Hi Alice,

I am using the sample bootloader supplied by the NXP using FC protocol.I have done it in the application code and downloaded it and it is not working..

how to make sure application jump address always remains same from version to version? is there any option?

0 Kudos

504 Views
girishkumarvast
Contributor II

Hi Alice,

I am using AN2295,Processor MKL02Z32VFM4 and KDS ver.2.0.0..After going through several posts in community and your reply, i found that Jump address(__thumb_startup function) is always located @RELOCATED_VECTORS+4 address. Thanks for that..

I am using the below function to JumpTouser_Application and bootloader is resetting..I am successfully able to download the user application but when i send quit command it is resetting..I am using AN2295,Processor MKL02Z32VFM4 and KDS ver.2.0.0.

void JumpToUserApplication(uint32_t userStartup)

{

   SCB_VTOR=RELOCATION_VERTOR_ADDR;

    /* set up stack pointer */

    __asm("ldr r1, [r0,#0]");      //get the stack pointer value from the program's reset vector

    __asm("mov sp, r1");          //copy the value to the stack pointer

    __asm("ldr r0, [r0,#4]");      //get the program counter value from the program's reset vector

    __asm("blx r0");          //jump to the start address

 

}

Kindly provide some inputs if the above code is correct??

Thanks in advance,

Girish Kumar

0 Kudos

504 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Girish,

On kds , the jump application you can use this :

pastedImage_0.png

After load APP, you can compare the  memory with  when download the APP alone .

Hope it helps

Alice

504 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Vastrad,

Do you used KBOOT or AN2295 ?

No matter which version , you can  find the jump address at here :

pastedImage_0.png

the MACRO of RELOCATED_VECTORS is the jump address , you can also change it refer to your demand.

And if you have flash the application into your board , you can check the memory , check whether it is right .

Hope it helps

Alice

0 Kudos