how to place the function in a specified addrss

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

how to place the function in a specified addrss

1,176 Views
oceansea
Contributor III

hi

now , i have a problem ,i use S32K146 mcu and the S32DS IDE to development.

i want to place the function    "vExt_UART0_transmit(unsiged char* buff)" in a specified address (0x20000),

i try to use the command __attribute__((at(0x20000))),but it seem have no any effect.

can you help me ,my friend.

haiyang 

08 - 2023

Tags (1)
0 Kudos
Reply
3 Replies

1,124 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Seems like there is no other option with GCC.

 

Regards,

Daniel

0 Kudos
Reply

1,153 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @oceansea,

Create a new section in the linker file starting at 0x20000

danielmartynek_0-1692621138009.png

danielmartynek_1-1692621176302.png

 

And declare the function with this attribute to put func into m_text_2:

danielmartynek_2-1692621217281.png

 

Regards,

Daniel

0 Kudos
Reply

1,132 Views
oceansea
Contributor III

hi,
thank you reply.
it's a solusion to solve this;
but when the requirements become complex,for example
we have 3 function need specified addrss,
"vExt_UART0_transmit(unsiged char* buff)" in (0x20000),
"vExt_UART1_transmit(unsiged char* buff)" in (0x20100),
"vExt_UART2_transmit(unsiged char* buff)" in (0x20200);
Then we should create 3 new section in the linker file ,it maby have some complicated.
Is there a simpler way?
thanks
oceansea

0 Kudos
Reply