Executing PPC code from external flash memory

I have a EDk based design with 8 MB of external flash memory on PLB via the plb_emc core. This is for a Virtex II Pro using EDK/ISE 7.1i, latest service packs. Running a PPC program in either BRAM or SDRAM, I can burn and verify test patterns in the entire flash memory.

I have another program that runs fine downloaded into external SDRAM. I am now trying to execute it in flash. I seems I get an illegal instruction exception on the very first instruction. I put in a single assembly instruction that lights an LED through a GPIO register and use XMD to start at that instruction. Works in SDRAM, not in flash. I have rechecked the timing parameters to the emc core and incresed the margins. For instance, my flash specs a read cycle of 90 ns, I'm giving it 120.

I figure my next step is to learn enough of ChipScope to look at the bus cycles.

However I'm hoping someone here has other suggestions or experience executing out of flash.

Reply to
Loading thread data ...

Without it's something like your flash chip is still in program mode when you try to jump to it, I expect it has something to do with the cache or the C_INCLUDE_DATAWIDTH_MATCHING option. What's the width of your flash device? Can you post the plb_emc section from your .mhs?

Also, when you read the flash memory from xmd do you the the 32-bit words you expect?


Reply to

I've done this on a V4 with newer EDK. One parameter that comes to mind is C_INCLUDE_DATAWIDTH_MATCHING if your flash bus width is narrower than the PLB.

Another thing to check would be if you are loading the flash using something other than the CPU (eg jtag or a programmer) and your endianness doesn't match. If all accesses are via the CPU, that can't be it.

Ben Jackson AD7GD

Reply to
Ben Jackson

Thanks both for the replies.

All my burning was done by the CPU, and I verified byte order etc. several ways so it wasn't that. Also the width matching is on by default so it wasn't that.

However the mention of caching was spot on. I added the burst/cacheline support parameter and it is working now.

Thanks again. Steve

Reply to

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.