Are you talking about the Program or Data Caches, and it what combination?
Does your code run with the Program Cache on and Data Cache off, but not with both?
These CPUs run very slowly if you don't have the Program Cache on.
Oops! I wrote a whole lot before I re-read your post where it says:
The system now (again) runs in the debugger, or booting from flash, cache enabled or not.
So the problem is solved I wrote a whole lot of stuff before I spotted that.
So which compiler and which version did that to you (I'm guessing CW), and are there any postings on this problem in the CW forums?
Anyway, yYou might be interested in some of the following:
> I am inclined to suspect the 5329 has some inherent design flaws
Plenty, but few that can't be worked around with the right configuration, tweaking of external hardware or lots of manky software workarounds.
> (maybe that is why Freescale is dropping it?)
What do you mean by "Dropping"? Have you got any official information on that?
Freescale (and pretty much everyone else on the planet with the exception of Intel) are using ARM chips. That's simple outsourcing. It means they don't have to spend billions continuously updating their specific CPU architecture to the latest bells and whistles, documenting same, bug fixing and then supporting it with compilers and development software. The CPU Core and its documentation "is now ARM's problem". Compiler updates for one product apply to everyone using that core. Debuggers are bought from third parties that support chips from multiple vendors with the same cores and ARM debug infrastructure.
It isn't all plain sailing. Have you seen the Errata Lists for the ARM cores? There are19 items for the Cortex A8 in the i.MX53 and 47 on the Cortex A9 (i.MX6Q).
Enough ranting, back to your problem (now fixed, so back to variations on "inherent design flaws").
Turning the cache on allows the CPU to stress the memory system a lot harder. It enable cache-line burst reads and writes. If you have anything wrong with your memory controller programming that means the burst cycles don't work properly, then you won't see that until you enable bursts by turning the caches on. Read through the following for the steps I went through to find a memory corruption problem I had on the MCF5329:
MCF5329 with random SDRAM 1k "bit rot" corruptions
The SDRAM corrupts when writing data to the Flexbus using an unconnected chip-select.
Writing 32-bits of zero to an all-ones address has it fail nearly instantly. It depends on the number of zero data bit.
26 bits doesn't fail, and it gets progressively worse with 27, 28, 29, 30, 31 and 32 zero bits. It doesn't matter which data lines are zero, just the number of them. The "all ones address" is important as the FlexBus puts out the address on the data bus and then switches to driving the data. All-ones to all-zeros is a worst-case for something.
That was fixed by changing the SDRAM bus drive strength. It default to the "strong" setting and that was generating bad over and undershoots, upsetting the SDRAM. That was compounded by there not being any documented "drive strength control" registers for these buses. The registers were there, just named and documented misleadingly.
These chips can't handle "brownouts" on their power supplies and have other lockup problems if you're using the 32 bit data bus for FLASH and SDRAM instead of using the half-speed "split bus" configuration. Check SECF196 and EB740:
Re: MCF5329 (MCF5xxx) + SDR DRAM = lockup, anyone else?
The simple PIT timers have never worked properly (correction, they can work, but the documentation has never said how to program them to work properly, and there are no shipped drivers out there that get it right, Linux included):
Re: PIT hw boo-boo. Read if you need accurate PIT (CF)
Then there are problems with the LCD controller. Search this forum for everything I've written on these chips. You'll be reading for a while :-).
Tom