Change the hex file address

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

Change the hex file address

Jump to solution
2,627 Views
durgasivakrishn
Contributor III

Hi,

I am using MK66FN2M0VLQ18, I would like to change the Flash address of the .hex file from 0x00000000 to 0x00000500 can anyone help me how to do it.

 

Below are the steps I followed but it didn't work and through an error.

 

durgasivakrishn_4-1605530731074.png

1. In IROM1 address is changed from 0 to ox500

 

durgasivakrishn_5-1605530752982.png

 

2. In the above window I enable the "Use Memory Layout from Target Dialog"

 

I was getting below error

Error: L6218E: Undefined symbol __initial_sp (referred from entry2.o).

Thanks & Regards,

Sivakrishna

0 Kudos
1 Solution
2,602 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi durgasivakrishn,

   You can modify your MK66F2M0XXX18_flash.scf, the start address to your desired address.

image.png

Wish it helps you!

If you still have questions about it, please kindly let me know!

Best Regards,

Kerry

-------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored

Please open a new thread and refer to the closed one, if you have a related question at a later point in time.

-----------------------------------------------------------------------------

 

View solution in original post

6 Replies
2,599 Views
durgasivakrishn
Contributor III

Hi,

Thanks for your reply Erich and Kerry,

As Kerry mentioned we can change the address location in the scatter file(.scf) I am able to generate a .hex file with my desired location but I want to do it on Keil Tool is it possible, Means I want to change the linker file from Keil tool.

 

Thanks & Regards,

Sivakrishna

0 Kudos
2,597 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi durgasivakrishn,

   If you are using the SDK project, I suggest you use the .scf file directly, as it also complicate to the sdk driver.

   But if it your own created keil project, you also can use the keil tool gui method to modify the relocated address. As you know, that address modification also modify the keil project link file in default.

 

Wish it helps you!

If you still have questions about it, please kindly let me know!

Best Regards,

Kerry

-------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored

Please open a new thread and refer to the closed one, if you have a related question at a later point in time.

-----------------------------------------------------------------------------

0 Kudos
2,607 Views
durgasivakrishn
Contributor III

Hi,

Thanks for your reply Erich, Actually I am using Keil V5.

And that you want to create an image at a that offset so it can be loaded with the bootloader, correct?

Yes, your view is correct,

check entry2.c why it tries to load the SP from address zero (this is the default in the vector table).

I didn't find the entry2.c in my project.

 

With regards,

sivakrishna

0 Kudos
2,593 Views
ErichStyger
Senior Contributor V

HI @durgasivakrishn ,

I'm not familiar with Keil, so I assume it might be part of the library which includes some startup code related things.

I hope this helps,

Erich

0 Kudos
2,603 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi durgasivakrishn,

   You can modify your MK66F2M0XXX18_flash.scf, the start address to your desired address.

image.png

Wish it helps you!

If you still have questions about it, please kindly let me know!

Best Regards,

Kerry

-------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored

Please open a new thread and refer to the closed one, if you have a related question at a later point in time.

-----------------------------------------------------------------------------

 

2,624 Views
ErichStyger
Senior Contributor V

It sounds you are using IAR tools? And that you want to create an image at a that offset so it can be loaded with the bootloader, correct?

My take is that yo need to change the settings in the linker settings.

Or use one of the bootloader example files of the MCUXpresso SDK which show how the target image is relocated to an offset.

As for the error message: check entry2.c why it tries to load the SP from address zero (this is the default in the vector table).

I hope this helps,

Erich

0 Kudos