2010-01-11 08:21 PM
Function pointer to fixed address
2011-05-17 04:37 AM
Hi,
I am trying to call a function on fixed address, but it ends in the MemManage_handler, when calling my function pointer I am using the Keil compiler and a STM32F107. My code is:Code:
<BR>void (*uaMain)(void); <BR>uaMain = (void(*)(void))0x08004004L; <BR>(*uaMain)(); <BR>
Can anyone help me? [ This message was edited by: richard.knoop on 11-01-2010 16:59 ]2011-05-17 04:37 AM
Hello,
You must use an odd address. Try uaMain = (void(*)(void))0x08004005L; This is due to old ARM7/ARM9 architecture with Thumb and Arm instructions. With Cortex-M3 all intsructions are Thumb and you must set bit 0 to jump to a Thumb instruction. Eric2011-05-17 04:37 AM
Hi,
you are right, it now jumps to the correct code :D . Thanks, Richard [ This message was edited by: richard.knoop on 12-01-2010 10:07 ]