Hello,
I wrote a function which call another function through a pointer of function call. When I trace the call, as soon as I reach the function the thumb bit is cleared, and of course the program no more run correctly. When I call the same function directly the thumb bit is not cleared, of course.
What are the mechanism which could clear my thumb bit?
normal call
unsigned char *ip1; fnEraseFlashSector(ip1 ,0);
special call
ulong ( *tempt_Fct )( ulong ); ulong tempData; ulong tempData2; tempData = ((ulong (*)(ulong,ulong))tempt_Fct)(tempData,tempData2);
I need to write generic function calls for RPC.
Thanks a lot T Max,
you got it.
The address given on the MAP file need to be corrected to have the lsb reflect the thumb state. This is done by the compiler normally. In my case I have to do it manually.
Well done.
Ooops....
In fact the MAP file is right, but I used the address given by µVision debugger.
But now I understand what happened and all is OK. Thanks a lot.
Actually, I got it first ;-P
There was indeed no thumb bit in your pointer in the first place, so nothing to get lost.