Using the __attribute__ directive in KDS

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

Using the __attribute__ directive in KDS

726 次查看
Jiun_Yong
Contributor III

Hi

I am new to using Kinetis Design Studio. (Previously used Code Warrior and S12/S12X processors.)

Can anyone direct me to some clear documentation on the use of the __attribute__ directive which is used by the linker.

I have found examples of its use e.g. __attribute__ ((interrupt)) and __attribute__ ((const)), but I cannot find anything in the KDS help file.

Specifically, I want to be able to control where compiled code is put in memory (for a bootloader application).

Many thanks

Steve Lewis

标签 (1)
0 项奖励
回复
1 回复

476 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello STEVE,

In KDS,  we need first use __attribute__ define one section , use it to relocate a function or data .

Then in the linker file ,  create a new segment to relocate the function.

About how to do in detail , please refer to this DOC :

Relocating Code and Data Using the KDS GCC Linker File for Kinetis

Hope it helps



-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

Have a great day,
Alice

0 项奖励
回复