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!
Maybe there is clock timing differences between your program and the flash loader app.
That's possible. However, the init code that I put into the flash loader app (which does configure the clock tree) was copied from my app. So, if it's different, it's not because I made them different. Not knowing what the IDE's download process does though, could account for them being different, if they are.
Does your own application run from RAM or flash? Because flash execution is often slower than RAM execution.
It runs from MCU internal flash. The clock tree should be the same though. Perhaps the flash loader app is running faster and violating the timing of the external NOR flash? I thought that might be the case, so I set all the timing parameters in the external memory controller to their slowest settings, but that didn't make a difference.
"Thanks Tamir, but is using the scatter load file a requirement, or a preference?"
I am not sure it is required in this particular instance but it certainly makes your code more readable and maintainable.
Did you verify the timing of the different control signals going to the NOR? If remember correctly, there is a series of settings in Keil startup files to configure parameters of EMC slots. A BBR once gave us hell !
I'll see if I can't get some flying leads added to the board so that I can compare the timing as the different apps are running.
Now that I think about it... the timing for my flash functions running from MCU internal flash shouldn't be an issue, because those functions work. It's the flash loader app functions that don't work. I'm assuming that those functions (in the flash loader app) must be running from RAM. So... maybe they're executing too fast when running from RAM and thereby violating timing?
So... I adjusted the timing via the init code in the flash loader app to make the system clock run slower, and guess what...? The flash loader app and the download process started working!
So... when running from RAM, the code executed so much faster that the CFI functions violated the timing constraints, and that's why it wouldn't work!
That must be it, because the download process is working quite reliably now. My tech is out till mid next week, so I'll have to wait to get the flying leads added to my board to confirm this all in an easily quantifiable way using an o-scope. In the meantime I'll see if I can't do the math and see if that confirms my hypothesis.
Thanks again for all the hints!