Dynamic programming
#1
Posted 19 October 2012 - 02:59 PM
#2
Posted 19 October 2012 - 03:14 PM
Your code should run with about the same efficiency from flash or RAM. If you're pulling in code on the fly, I'd recommend running it from RAM.I understand that the STM32F4 is supposed to execute code faster from flash than it can from RAM. But I have a concern that flash has a limited number of write cycles (ten thousand maybe?) before it will fail. I'm working on a system that has to be reprogrammable most every time it runs, receiving its code from another part of the system. I'm thinking that the code will have to go into RAM if I don't want to limit the lifespan of the device. Can anyone comment about dynamically loading code into RAM or flash and executing it at run-time?
STM32F4's flash is rated for a minimum of 10,000 flash cycles.
Chris
P.S. Here's an article talking about Flash vs. RAM execution speed on STM32F4.
Both flash and RAM execution are high-performance.
http://www.futurlec....F4_Series.shtml
- Arron Chapman and Mattster like this
#3
Posted 19 October 2012 - 04:51 PM
[1] The Insider's Guide To The STM32 ARM Based Microcontroller
- Mattster likes this
#4
Posted 19 October 2012 - 11:18 PM
Hi Mattster,
Your code should run with about the same efficiency from flash or RAM. If you're pulling in code on the fly, I'd recommend running it from RAM.
STM32F4's flash is rated for a minimum of 10,000 flash cycles.
Chris
P.S. Here's an article talking about Flash vs. RAM execution speed on STM32F4.
Both flash and RAM execution are high-performance.
http://www.futurlec....F4_Series.shtml
Chris:
Thanks for the confirmation of my understanding on the flash re-write limitations. I seem to recall reading somewhere here (maybe in the N+ forum?) about runtime loading of executable modules - do you know where I might have seen this?
Thanks,
Mattster
#5
Posted 19 October 2012 - 11:19 PM
CW2: thanks for the insights, and yes, the number of rewrites is an issue. Can you point me at any additional references on the use of external memory? Also, what can you tell me about the performance of external memories?I have run code from both RAM and flash without any problems. I also believe the code executes from flash a little bit faster than from RAM, because of the dedicated I-Bus and prefetch buffers (when running from RAM, "...the instruction hast to be fetched using the system bus, which incurs and extra wait state" [1]), but I have not performed any measurements. If the number of internal flash rewrite cycles is an issue, you might want to consider using and external memory (100 k cycles and more) , STM32F4 micros have external memory bus interface .
[1] The Insider's Guide To The STM32 ARM Based Microcontroller
Thanks!
#6
Posted 20 October 2012 - 12:10 AM
Check out the MonoBootloader in the Mono forum. It loads assemblies from an SD card.Thanks for the confirmation of my understanding on the flash re-write limitations. I seem to recall reading somewhere here (maybe in the N+ forum?) about runtime loading of executable modules - do you know where I might have seen this?
Chris
- Mattster likes this
#7
Posted 20 October 2012 - 12:14 AM
Hi Mattster,
Check out the MonoBootloader in the Mono forum. It loads assemblies from an SD card.
Chris
Kewl, thanks!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users