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
Hi,
this can be done by section attribute and modifying the linker script file (please see attached example).
main.c:
Linker script file:
.map file:
But the question is why you need such function on particular address in the Flash memory? Why you can't use for example pointer to the function? From my point of view it is an unusual approach.
hi jiri_kral,
thank you reply !
I want five functions to always have the same addresses in the bootloader project, so that my app project can always call those five addresses.
"Why you can't use for example pointer to the function?" I'm not quite sure what your meaning,
how to use pointer to solve this requirement?can you show me a example?
thanks
oceansea
Hi,
I see, this make sense. So, you are going to use some functionality (communication) from bootloader in your project. Well, the __attribute__ section is the option.
Other possibility is to have some table on constant known address in bootloader with addresses of the functions you like share with app. When the app starts - it can simply assign these addresses and use it as pointer to function.