2020-09-10 02:43 AM
Hi guys,
I would like to ask how properly place the function (code). I have solved the ld. script (have already the section in ram for code there) and functions which I want to place in ram has section attributes, but I read that the long call attribute is also necesarry and –mlong-calls compiler flag has to be set. I did every single step but I'm getting wdg interrupt everytime I want execute function from RAM.
(The clocks are also enabled for RAM)
Maybe I missed some stupid thing there.
Thanks in advance for any advice.
Solved! Go to Solution.
2020-09-10 03:38 AM
I have used functions in RAM on CortexM without -mlong-call. GCC has the concept of ***_venneer https://stackoverflow.com/questions/56019518/linker-script-gcc-how-to-avoid-veneer-call
2020-09-10 03:07 AM
What MCU ?
What RAM address ?
Do you see the right address in the map file ?
Where do you see the –mlong-calls compiler flag has to be set ?
2020-09-10 03:31 AM
https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/ARM-Options.html
"Tells the compiler to perform function calls by first loading the address of the function into a register and then performing a subroutine call on this register. This switch is needed if the target function will lie outside of the 64 megabyte addressing range of the offset based version of subroutine call instruction."
Map file has correct address and I would say what is more important that function is really copied in SRAM, which I checked with debugger. :smirking_face:
MCU and RAM addresses are probably irelevant, after it is copied in SRAM and the correctness of copied data is checked, the problem has to be somewhere else.
2020-09-10 03:38 AM
I have used functions in RAM on CortexM without -mlong-call. GCC has the concept of ***_venneer https://stackoverflow.com/questions/56019518/linker-script-gcc-how-to-avoid-veneer-call
2020-09-10 04:52 AM
I am asking for the MCU and RAM address because not all MCUs allow code in all RAMs ...
2020-09-10 04:54 AM
dont worry i checked these things, :)
2020-09-10 11:21 PM
Thanks :)