2015-09-14 08:31 AM
Hi.
I have a problem with jumping to specific location on stm32 flash memory. At that location some functions should be implemented and the result from these functions have to be kept in any of (all purpose)registers. after jump to specific location i want to back to main program and using data from the registers. i would be thank full if everybody help me.i am in a dark situation. Any clue will be help me so much. Thank you #stm32-jump-function-call2015-09-14 09:27 AM
If you need to return a lot, use a structure pointer, and fill that with the data, or learn to use assembler?
The routine here could be changes to expect parameters, or return a different type. The first four parameters passed would be in R0, R1, R2, and R3, and the return in R0 (and R1 if 64-bit, as I recall), beyond this the stack is used, refer to ABI documentation.typedef int (*pFunction)(void);
void CallFlashCode(void)
{
pFunction RunCode;
RunCode = (pFunction)0x080012345; // ODD for Thumb code - Address of your function
printf(''%d
'',RunCode());
}
2015-09-15 08:15 AM
Thank you for your answer.
Unfortunately i am still dark at this subject. i saw you recommend ABI Documentation. if you think this document can help me would you please guide me to this document(where i can find it?) thank you.2015-09-15 10:57 AM
I think it might help enlighten you,
http://www.google.com/search?q=arm+abi
2015-09-18 02:59 AM
Thank you Clive.
with your Suggestion and using #progma location = ''Specific Sector''Befor function definition my problem solved.thank you again.