I wrote:
> Has anyone else had reports of problems like these?
Nobody else? I'm surprised.
Here's the cause and possible/unofficial workarounds.
CAUSE
When I mention "SDRAM Outputs" I'm referring to the control signals output by the SDRAM controller. This includes SD_CLK, SD_CKE, SD_CS0, SD_WE, SD_SRAS, SD_SCAS and SD_DQMn.
On initial power up, the SDRAM Outputs are tri-state. Their levels are thus "indeterminate". They may be floating high, low, be capacitively coupled to the 3.3V plane or whatever.
If this power-on is close to the last power-off (a fast ON-OFF-ON) then the EVDD and IVDD rails may be well above zero, and the other signals may even be above that, being dragged down by the protection diodes to the rails. There are a lot of variables here.
SDRAM chips do not have RESET pins. They are hoped to wake up "idle" but their data sheets don't guarantee that. Combine that with floating inputs and different levels after different timed OFF-ON-OFF resets, and anything can happen.
The SDRAM controller in the MCF5329 (and the same controller in other models) does not seem to be directly initialised by the /RESET signal. It wakes up in a "random state" and this is reflected in all of the SRAM Outputs. It doesn't settle down to its IDLE state until after the oscillator has started up and fed some clock edges through it. It seems more likely to do this on an ON-OFF-ON than a cold start. When in "non-IDLE" mode it is sending a random command to the SDRAM.
When EVDD ramps up to about 2.6V (between 2.0 and 2.8V) the SDRAM Outputs are enabled. If this happens after the crystal/oscillator has started up, the initial output state will switch from "floating" to "driven IDLE state". If the EVDD ramp is reasonably fast (500us or less) the oscillator won't have started and the SDRAM Outputs will change from "floating" to "driven RANDOM". As the oscillator starts up the outputs go through one or more transitions back to the IDLE state.
If you're unlucky, the uninitialised SDRAM chip will have interpreted all these changes on its pins as some sort of READ command and it will drive the data bus. If your luck comes good, it may then let go during the "Random" to "IDLE" changes, but it may not.
When the CPU comes out of reset and tries to read its code from FLASH, the bus contention between the SDRAM and FLASH usually ends up with the CPU halted very quickly. This is the SECF045 problem with a different cause.
The Watchdog doesn't help as it ignores HALT state until the CPU programs it otherwise. Even if it could work and tried to reset the CPU there'd be no changes in the signals to the SDRAM and it would still be jamming the bus.
The only recovery from this condition is power off. The same lockup might happen on the next power on though.
WORKAROUNDS
None of these are "official or recommended by Freescale". Many of them may reduce the incidence of the problem without eliminating it entirely.
Don't use SDR SDRAM, but design with DDR on a "split bus".
Add an external hardware watchdog that can fully power-cycle the CPU if it isn't patted in time. Power-cycle, not Reset.
Don't turn the board OFF_ON_OFF, but wait a long time before turning it on. You may not have control of this.
Add bleed resistors to the EVDD and IVDD rails to get them to ground fast on a power off if you can waste the power. This seems to help a bit.
Add pulldown resistors to the SDRAM Outputs, especially SD_CLK and SD_CKE. The SDRAM seems most sensitive to these floating. Do not add a PULLUP to SD_CKE as this makes it worse (SECF150 for the MCF52277 suggests this for a different problem).
Slow down the power-on ramp so the crystal or external oscillator is running before EVDD gets to 2.0V and enables the SDRAM Outputs. This stops the "random states". This can be done either:
1 - With a separately powered external oscillator instead of a crystal (and a buffer or current limiter plus all the required RCON hardware), or
2 - With a crystal on the internal oscillator.
The internal oscillator is only guaranteed to run when EVDD is over 3.0V, so for a design that meets published specifications you need to get EVDD to the Oscillator to 3.0V BEFORE EVDD gets to 2.0V for the SDRAM Outputs! That should be impossible, except the Oscillator VDD supply is on the undocumented pin K12 on the 256BGA, so it can be driven from a separate supply if need be. The three Reference Design schematics document this pin and the other 9 power pins the Reference Manual doesn't list. In practice the oscillator seems to start at 1.6V, so a VERY slow power ramp (10-100ms) seems to work OK.