Hi, i'm a beginner in embedded programming. I have a program which runs in the flash memory. my problem is that i want that some functions (for example add() sub() ) will be located in the ram, did someone knew how can i do that. thx
If you are a beginner - maybe you should spend some time giving the motives _why_ you want some functions in RAM.
Yes, RAM may be slightly faster than flash. Yes, RAM may allow interrupts to be handled while the processor erases/reprograms flash. But RAM may also be corrupted by a memory overwrite, making your program fail badly.
Before trying non-standard solutions, there must be very clear advantages to show for going that route. What are your clear advantages of using RAM?
in fact, it is not a choice : it's an obligation. i want to program an application wich allows the transition to power saving mode with an infineon XE166. there are mentionned steps to respect according to the manual, one of them : Function must be located in PSRAM via compiler directives.
In fact its logical cause the program, in an advanced stage will be executed from PSRAM in order to switch off the Flash (that's why some functions must be located in PSRAM) just before going to sleep mode.