cancel
Showing results for 
Search instead for 
Did you mean: 

Function pointer to fixed address

richardknoop39
Associate II
Posted on January 12, 2010 at 05:21

Function pointer to fixed address

3 REPLIES 3
richardknoop39
Associate II
Posted on May 17, 2011 at 13:37

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 ]

ericvanolden9
Associate II
Posted on May 17, 2011 at 13:37

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.

Eric

richardknoop39
Associate II
Posted on May 17, 2011 at 13:37

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 ]