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,821 次查看
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,811 次查看
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,812 次查看
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,794 次查看
hurongbo
Contributor I

Thanks a lot.

0 项奖励
回复