cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F7 - IAR Workbench: Placing a group of functions or variables in a specific RAM Section

MMano.1
Associate

Dear All, I am developing an application in IAR for an STM32F7. The application is working in an External Flash and I need to place some functions in Internal RAM. I have followed the link https://www.iar.com/support/tech-notes/linker/how-do-i-place-a-group-of-functions-or-variables-in-a-specific-section/ to adapt the code and the linker file. I attach to my request both the source file (just a simple test function) and the linker file to let you better understand. If I define FUNC_region in the section 0x90000000-0x90200000 (External Flash before the application region) everything works ok. If I define FUNC_region in the region 0x20000000-0x2004FFFF during download I receive one warning from flashloader. Going in debug mode the code jumps correctly to 0x20000000 but it seems that here there is no useful code.

Have anyone any suggestion to solve this task?

If you need more details don't hesitate to ask.

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Community member​ ,

thank you for your help.

After some research I have found that it is enough to use the __ramfunc directive. Using that it is not necessary to modify the .icf file.

Regards

View solution in original post

2 REPLIES 2

Not an IAR user, but in the general sense you need to encapsulate the RAM your want to get initialized into a Read-Only Flash LOAD REGION, then the startup code will unpack/copy the content into RAM, as this data won't magically appear there across a power cycle.

Suspect similar methods for v8.xx

https://www.iar.com/support/tech-notes/general/execute-in-ram-after-copying-from-flashrom-v5.20-and-later/

https://www.iar.com/support/tech-notes/linker/controlling-placement-of-the-section-where-__ramfunc-functions-reside-ewarm-5.x--6.x/

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hi @Community member​ ,

thank you for your help.

After some research I have found that it is enough to use the __ramfunc directive. Using that it is not necessary to modify the .icf file.

Regards