Change the hex file address

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Change the hex file address

跳至解决方案
2,630 次查看
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

标记 (2)
0 项奖励
1 解答
2,605 次查看
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.

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

 

在原帖中查看解决方案

6 回复数
2,602 次查看
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 项奖励
2,600 次查看
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 项奖励
2,610 次查看
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 项奖励
2,596 次查看
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 项奖励
2,606 次查看
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,627 次查看
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 项奖励