Bootloader K64 / Linker / Change application location

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

Bootloader K64 / Linker / Change application location

Jump to solution
778 Views
ahmedhrabi
Contributor III

Hello everyone, 

I'am trying to create a personnal bootloader on a K64 microcontroller using MCUexpresso 11.2.0.4120 and SDK 2.8.2.  

My bootloader application is supposed to copy the new application binary on flash (at adress 0x1000) then jump to the new application address in flash.

I tried to modify the ld file of the flashed application for that the ISR vector begins at the address 0x1000.  

(The ld files are generated by MCUexpresso)

You can see clearly on the attached map files that : 

  • The .isr_vector starts at address 0x00000 for bootloader.map file
  • The .isr_vector starts at address 0x10000 for flashapplication.map file

By using the Memory debugger of the MCUexpresso i verified that the binary is flashed correctly (after clearing flash with 0xFF) at the address 0x1000. Theni try to jump to the new application at address 0x1000 it restarts the bootloader application instead of launching the flashed application. 

Can enybody check with me the ld files if they are well configured and tell me if there's another method to map the flash memory. 

Here is the .ld files attached. 

BR, 

Ahmed HRABI. 

0 Kudos
1 Solution
760 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello ahmedhrabi

 This post may be helpful to relocate the code: https://community.nxp.com/t5/Kinetis-Design-Studio-Knowledge/Relocating-Code-and-Data-Using-the-MCUX...

 

Let me know if this is helpful, if you have questions do not hesitate to ask me.

Best regards,

Omar

View solution in original post

2 Replies
761 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello ahmedhrabi

 This post may be helpful to relocate the code: https://community.nxp.com/t5/Kinetis-Design-Studio-Knowledge/Relocating-Code-and-Data-Using-the-MCUX...

 

Let me know if this is helpful, if you have questions do not hesitate to ask me.

Best regards,

Omar

742 Views
ahmedhrabi
Contributor III

Hello nxf54944

Yes we can relocate the code through the MUC settings. For me i have choosen to change directly the linker file (.ld), like described below, and it works for me like charm . Anyway thank you for your reply. 

MEMORY
{
/* Define each memory region */
PROGRAM_FLASH (rx) : ORIGIN = 0x10000, LENGTH = 0x80000 /* 512K bytes (alias Flash) */
SRAM_UPPER (rwx) : ORIGIN = 0x20000000, LENGTH = 0x30000 /* 192K bytes (alias RAM) */
SRAM_LOWER (rwx) : ORIGIN = 0x1fff0000, LENGTH = 0x10000 /* 64K bytes (alias RAM2) */
FLEX_RAM (rwx) : ORIGIN = 0x14000000, LENGTH = 0x1000 /* 4K bytes (alias RAM3) */
}

/* Define a symbol for the top of each memory region */
__base_PROGRAM_FLASH = 0x10000 ; /* PROGRAM_FLASH */
__base_Flash = 0x10000 ; /* Flash */
__top_PROGRAM_FLASH = 0x10000 + 0x80000 ; /* 512K bytes */
__top_Flash = 0x10000 + 0x80000 ; /* 512K bytes */

 

Regards,

HRABI. 

0 Kudos