Hi, Is it possible to run the code from an external flash memory or RAM? We are running out of space in our K60. We don’t want to change the whole processor. So I was wondering if there is a possibility to execute code from external memory. I would like to compile the whole code –libraries, RTX RTOS, application and then generate some file (let’s call it the main application) which I would copy to SD card or program external flash with it. Then my boot loader application which resides in the internal flash memory would read the generated file (with the main application), copy that file to the RAM and execute it. Or if the main application would reside in the external flash, the main application would be executed from the external flash.
Thanks in advance. John Ostrowski
Yes, but it might be significantly slower.
You can modify the memory map in the target pane, or via scatter files passed to the linker.
To burn directly to external flash you will likely need to create an applet to do that, for running from RAM via the debugger, you'd need to create an initialization script to configure the external memory, and download the code.
We are running out of space in our K60. We don’t want to change the whole processor.
But is changing the whole board schematics, and losing a truckload of I/O pins that you'll now need for the memory interface instead, really any less painful than moving up to a micro with sufficient internal memory? Or did you just have all that extra memory already connected to the CPU, waiting for something you might do with it?
Significant investment in working software? Familiarity with architecture and peripherals?
Sometimes time to market trumps refactoring everything...
Then again I picked an M4 part with a common foot print, and flash ranging from 128KB to 2MB
At some point this 2MB will be not enough. What will you do then? ;-)
Or did you just have all that extra memory already connected to the CPU, waiting for something you might do with it?
Yes, we have a lot of RAM - about 2MB and an external flash and SD card. If we add one more address line, than we can have extra 2MB of RAM. So there still will be 2MB for the heap and the extra 2MB for the code.
I don't see my application bloating in that way, but.. I'll move to my ARM926 400 MHz, 32 MB SDRAM Linux board, or my road-mapped 128 MB DDR3 one.
It's always valuable to know that the current hardware isn't the end-of-the-line master-blaster, but that there exists reasonably compatible big-brother solutions in case a customer would for some reason upgrade their requirements at a late stage in the development, or maybe even when the product has reached maintainance mode.
In the end, it's a well-known facts that the marketing department regularly wants more, or they claim they can't sell the product. So regularly new protocols, crypto algorithms, ... to add.
While it's possible to release a lamp timer with 95% of the resources consumed and no big-brother chip available can be ok - it's a huge volume product that is extremely price-sensitive - it isn't a good criteria for selecting processors to more advanced systems that is expected to live (with software updates) for a number of years, or where the customer may expect regular over-the-air updates with extended functionality.