Position independent code SD32K146 issues with static inline PCC_SetClockMode functions

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

Position independent code SD32K146 issues with static inline PCC_SetClockMode functions

650 Views
sudheendran
Contributor I

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.

Tags (2)
0 Kudos
Reply
2 Replies

390 Views
jiri_kral
NXP Employee
NXP Employee

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 

0 Kudos
Reply

584 Views
sudheendran
Contributor I

BTW, this is with the gcc tool chain. Is this a tool chain issue? Will IAR work? Please help / clarify. Thanks

0 Kudos
Reply