We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
__asm { ldr pc,=addr }
or
__asm { "ldr pc,=addr" }
getting compilation error, pc replaced with r15 but not getting compiled any suggestions/references
>>Thats why specific in updating either directly in PC or R15
And your experience with BX and BLX is that it doesn't change PC/R15? You could also use a function pointer to jump to arbitrary code or functions.
The documentation I cited specifically states LDR can't use PC as a destination. The M3/M4 behave the same in this regard as do Cortex cores in TI or ST part.
Hi, Thanks for the quick response. While using function pointer I get Hard Fault Exception with FORCED bit enabled.
>>I get Hard Fault Exception
So is it conceivable that you're not jumping to valid code? As I pointed out in other threads the address must be ODD for 16-bit THUMB code, the Cortex-M will not run 32-bit ARM code.