I've been browsing the uVision/MDK-ARM manuals looking for a way to do something I did when using the Rowley CrossStudio tools, but I can't find what I'm looking for.
Basically, my app is too large to fit in the FLASH in my MCU (lots of graphics assets). With CrossStudio, I could set my project up so that the graphics assets were located in an external FLASH device that supported CFI (Common Flash Interface). Then when I built my app and used their JTAG tool it would write the parts of the app that belonged in the MCU to the MCU, and write the parts that belonged in the external FLASH to the external FLASH, such that my graphics assets were all available in the external FLASH device from the app code running in the MCU internal FLASH.
Is this possible with uVision/MDK-ARM, and if so, could someone please point me to where I can find the related documentation in the product manuals? Are there any KEIL app notes that describe the process? If they're there, I must be using the wrong search keywords, because I haven't been able to find them.
Thanks!
Sigh... so close... but not quite there...
I tested all this stuff by loading different large images into my external NOR FLASH and then displaying them. All was well for a while, but now I get the following error when I try to download:
Flash Timeout. Reset the target and try again. This happens during the ERASE part of the download process.
I tried increasing the timeout setting from 4 to 20 seconds in the flash loader app, and that did delay the above error message for 20 seconds, but didn't fix the problem so I put it back to 4 seconds.
Would you say then that the most likely cause is that the init code I copied into the flash loader's init function is close, but not quite correct? Meaning that the MCU can't access the flash chip at that place in the address map?
Bizzare... (meaning that I still don't understand what's happening)...
I went back to the app I used to create/test the minimal CPU code, to confirm that after it was done I could do a CFI query successfully; and it worked okay.
I went back to my board app and then the the download to the MCU and the NOR flash worked.
However, it's still flaky. Sometimes downloads to the MCU and NOR flash work, sometimes they don't. I think it must be that my init code is not quite right.
I tried by initialization app over and over again, and eventually it failed too (not loading into the board, but getting correct results from the CFI query).
Sigh...
Dave,
You need to add a load region to your scatter loading file. In that region, add at least one execution region and place in it the object files that need to be mapped to external flash. In addition, one of the blinky samples should show (at least, it did until 2010...) how to configure a NOR flash via uv4.
Thanks Tamir, but is using the scatter load file a requirement, or a preference?
For this exercise, is it sufficient to declare my image like this:
const uint8_t image[] __attribute__((at(0x80000000))) = // 800 x 480 image { ... all the image data goes here ... };
if the NOR flash base address is 0x80000000?
I ask because using the 'at' attribute appears to be enough to signal the tools that it needs to use a loader (different from the MCU loader), and the external flash loader does seem to be invoked as needed; it's just that it doesn't always product the desired result.
View all questions in Keil forum