I'm trying to compile "Bootloader" with commonly used code. But some of the functions not used in "Bootloader" execution runtime. But they will be used and not modified during "main application" development.
In "Main application" this functions will be called with function pointers.
MyFunc = ((void(*)(UART_HandleTypeDef *))0x0800801d);
I try to create a separate memory region and place functions in this region by putting "#pragma arm section code="func" " into source code file. But linker wipes all unused functions. Also I found "__attribute__((used)" but this does not work with "#pragma arm section code="func" ". They only work by one.
1. How to put functions into finale binary image without calling it in main function?
2. How to tag functions for not using in code magic numbers like "0x0800801d" (It can be written like "Region$$Table$$Base", but with my own tag names. So instead of 0x0800801d I can write Region$$Func$$MyFunc for each function " MyFunc = ((void(*)(UART_HandleTypeDef *))Region$$Func$$MyFunc);")?
This message was edited to reduce width.
This message was edited to correct formatting.
View all questions in Keil forum