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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
1,307 Views
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.

Tags (1)
0 Kudos
Reply
1 Solution
1,297 Views
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.

View solution in original post

0 Kudos
Reply
2 Replies
1,298 Views
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 Kudos
Reply
1,280 Views
hurongbo
Contributor I

Thanks a lot.

0 Kudos
Reply