AN4370: Modifying the application linker file

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

AN4370: Modifying the application linker file

跳至解决方案
2,506 次查看
vincentdin
Contributor I

Hello all,

I am working with a TWR-K20D50M and the software that goes along with AN4370.

I am using IAR for ARM v6.5, and am currently able to upload the dfu bootloader application to the board.  The microusb port can enumerate as a DFU device, and I can use the dfu_example.exe to flash the example k20 binary to the board.

When it comes to uploading a different binary, whether it be an MQX or bare metal application, I am unsure exactly what to modify in the linker application file.  I have tried fiddling with different values in a bare metal hello world example, but it is not generating a usable binary (it will upload with the dfu_example.exe, but it does not run properly).

In sections 4.1.3 and 4.2.2.3, it describes what needs to be changed for Kinetis boards.  It even shows a modified linker file, but in a code warrior context.

How would I translate this process to the IAR environment?  It is just different enough to where I am unable to generate a working binary.

Any help or tips would be greatly appreciated.  Thank you!

-Vincent

标签 (1)
1 解答
1,568 次查看
vincentdin
Contributor I

Hi DerekLau,

Thanks for your response.

I got it to work!

Here is what I did:

1) leave bootloader linker file unchanged

2) change application linker file as follows

     define symbol __ICFEDIT_intvec_start__ = 0x0000A000;

     define symbol __ICFEDIT_region_ROM_start__ = 0x0000A000;

     define symbol __code_start__ = 0x0000A410;

     define exported symbol __VECTOR_TABLE      = 0x0000A000;  //had to modify this line, too

I did try changing image address to 0x4000 along with the changes you suggested (for the bootloader application), but this caused problems with the dfu application (it would no longer enumerate as a DFU device).

-Vincent

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,568 次查看
DerekLau
Contributor IV

The IMAGE_ADDR is defined as 0xA000 in the bootloader.h file.

Linker file can be modified as below:

define symbol __ICFEDIT_intvec_start__ = 0x0000A000;

define symbol __ICFEDIT_region_ROM_start__ = 0x0000A000;

define symbol __code_start__ = 0x0000A410;

The bootloader code actually does not occupy so large code size. You may change the IMAGE_ADDR to 0x4000 and change the linker file to.

define symbol __ICFEDIT_intvec_start__ = 0x00004000;

define symbol __ICFEDIT_region_ROM_start__ = 0x00004000;

define symbol __code_start__ = 0x00004410;

1,569 次查看
vincentdin
Contributor I

Hi DerekLau,

Thanks for your response.

I got it to work!

Here is what I did:

1) leave bootloader linker file unchanged

2) change application linker file as follows

     define symbol __ICFEDIT_intvec_start__ = 0x0000A000;

     define symbol __ICFEDIT_region_ROM_start__ = 0x0000A000;

     define symbol __code_start__ = 0x0000A410;

     define exported symbol __VECTOR_TABLE      = 0x0000A000;  //had to modify this line, too

I did try changing image address to 0x4000 along with the changes you suggested (for the bootloader application), but this caused problems with the dfu application (it would no longer enumerate as a DFU device).

-Vincent

0 项奖励
回复