Hello,
After reading through various information on forums, was able to create a bootloader and a position-independent firmware. -fPIC, .got, .got.plt, startup changes in assembly and c files are all done for VTOR relocation etc. The application firmware works when I dont use any NXP library sources. However, when I call the PCC_SetClockMode a hard fault occurs. The only peculiar thing about this function is that it is "static inline" in nature. Are there any issues with position independence and "static inline" functions? Can someone help point the issue / solution for the same? Thanks a ton in advance.
Hi,
as I posted in couple threads - the position independent code has very limited usage on embedded systems without OS. You can find useful details on this page - https://mcuoneclipse.com/2021/06/05/position-independent-code-with-gcc-for-arm-cortex-m/#more-28612
BTW, this is with the gcc tool chain. Is this a tool chain issue? Will IAR work? Please help / clarify. Thanks