how to place the function in a specified addrss

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

how to place the function in a specified addrss

1,263件の閲覧回数
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

タグ(1)
0 件の賞賛
返信
3 返答(返信)

1,211件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Seems like there is no other option with GCC.

 

Regards,

Daniel

0 件の賞賛
返信

1,240件の閲覧回数
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 件の賞賛
返信

1,219件の閲覧回数
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 件の賞賛
返信