How to assign data and function to specific section in S32DS for Arm

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to assign data and function to specific section in S32DS for Arm

ソリューションへジャンプ
2,819件の閲覧回数
hurongbo
Contributor I

Hello everyone:

I use S32K148 MCU ,and S32DS for Arm IDE V2.2.

I want to assign data and code to specific sections.

At first, I use #pragma section it not work, S32DS ignore it (Unknow pragmas).

Then,I use __attribute__ ((section(".mycode"))), It worked.But only one function was assigned to ".mycode" section below __attribute__ ((section(".mycode"))) instruct.

My code like this:
__attribute__ ((section(".mycode")))

void AAA()
{
}

void BBB()
{
}

After link,Only function AAA in section ".mycode".Function BBB in default ".text" section.

How to assign all function in one module to a section with one instruction like #pragma section in other platform?

Thanks.

タグ(1)
0 件の賞賛
返信
1 解決策
2,809件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, you have actually answered yourself.

There are no pragmas in GCC, you will have to add mentioned attribute before every function.

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
2,810件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, you have actually answered yourself.

There are no pragmas in GCC, you will have to add mentioned attribute before every function.

0 件の賞賛
返信
2,792件の閲覧回数
hurongbo
Contributor I

Thanks a lot.

0 件の賞賛
返信