We have a design based on:-
MCF5208CVM166 Coldfire, parts are PCF
Samsung K4S643232H-UC60 3.3v 32bit SDRAM
Spansion S29GL016A90TFIR20 3.3v 16bit flash on CS0
RCON is provided via a 74LCX244
Crystalis 16MHz
There is an LED on the CS2 pin
DRAMSEL, RESET and RSTOUT all have 10K resistors to 3v3.
The method of operation is:-
(Interrupts are never enabled)
Operational code is held in FLASH which is executed from Power-on.
Setup CS2 as a port output pin
Flash the LED
Initialise the Cache for FLASH memory
Set up the SDRAM controller and initialise the SDRAM
Memory check the SDRAM
Copy a relocatable section from FLASH into SDRAM.
Jump to the relocated code in SDRAM
Set the Cache for SDRAM memory
Go into a tight loop (will run from Cache)
If we force a reset, either an external RESET, a SOFTWARE reset or allow a WATCHDOG reset, in the above state, then everything works fine and the board reboots successfully every time.
If however the Cache is never enabled or disabled before the tight loop so that the instructions are fetched from SDRAM then occasionally the processor will hang after the reset, the board can only be recovered by using a complete power cycle.
We have an external device generation a RESET every 3 seconds and the failure will occur sometimes as often and after the second or third reset but it may take as long as 5 minute.
Inspection shows the RSTOUT goes low for around 1mS and then high after any of the reset conditions during this time the configuration can be seen on the data bus bits 1-7 and 9. The PLL appears to be locked (as RSTOUT goes high), we have tried removing the CORE voltage from the Coldfire but it did not restart the processor. We have tried a LIMP mode start-up followed by configuring the PLL in software but this had not effect.
We have tried doing a RESET before the SDRAM is initialised and again this works every time.
In essence the processor never really seems to actually start running.
Occasionally following the reset the SDRAM will get hot (like in a latch-up situation). This never happens from power on and does not happen every time from the forced reset condition.
The board runs perfectly following a power off-on cycle every time.
Once running the board has no problems what so every with as long as a reset in not carried out. Our full application is completely stable and after quite a few weeks of testing we are very happy with the stability of the whole design.
This really was the last stage of our design i.e. to implement a Watchdog/external reset providing recovery in the event of an unexpected failure.
We have a lot more information and desperately need to resolve this issue.
We have tried the 5208EVB with a variation of our code and could not reproduce the situation, but this is DDR based with split bus and so is quite a different design.
Best Regards
Dave
Message Edited by DavidS on 04-08-2006 10:35 AM
Message Edited by DavidS on 04-08-2006 10:50 AM
Message Edited by DavidS on 04-08-2006 11:01 AM
Message Edited by DavidS on 04-11-2006 12:10 PM
David
I suspect that the problem goes deeper that just during the RCON read.
It looks to me that the SDRAM is also competing with the Flash memory after RSTOUT goes high.
I have not used SDRAM in a design before but from what I can read in datasheets it is not possible to simply raise CS to tri-state the outputs, CS is only used internally to select the command decoder.
Seems to me that my RESET occurs either part way through a read burst or part way through a read cycle and the SDRAM (which has an internal state engine) still thinks it is selected so it is totally unaware of the RESET sequence. I believe that the COLDFIRE should hold off accepting the reset until completion of the read (burst) cycle so that the SDRAM is in an idle state when the RESET is actioned or the COLDFIRE must terminate the SDRAM read(burst) cycle to force the SDRAM into an idle state before actioning the RESET. From what I have read is seems to me that SDRAM devices should really have an asynchronous RESET input.
Since once the problem occurs the SDRAM can get very hot and it is not possible to recover to a functional state, I believe that any RESET source, other than power on, is NOT USABLE ON THE MCF5208 (and maybe other variants) if 32bit SDRAM is used.
I have an additional processor (Silicon Labs. 8051) on my board which drives RESET into the COLDFIRE, the 3.3V power supply is provided externally so I do not have a regulator. I think that the only practical solution open to me is to split the power plane, power the 8051 directly from the input and use a low Rds FET to switch the power to the COLDFIRE subsystem (Process, Flash, SDRAM, RCON buffers and Ethernet PHY). This should allow me to reliably reset the whole lot by cycling COLDFIRE subsystem power under a fault condition.
Best Regards, Dave
7.1 Description
If the SD_CKE signal to the SDRAM deasserts while one or more banks are active, then the SDRAM enters a “clock suspend” state. If the SDRAM was driving the data lines before entering the clock suspend state, then the buffers will continue to drive. During a reset, the processor will deassert SD_CKE without any graceful stop period to ensure that the SDRAM banks are all in an IDLE state. In some cases the SDRAM could be driving the data bus during and immediately after reset. This can lead to possible bus contention while latching reset configuration (RCON) values and/or while reading boot code from flash, and thereby cause the processor to enter an undefined state.
7.2 Workaround
• Use a split bus mode configuration with either DDR SDRAM or SDR SDRAM. This creates a dedicated 16-bit port for the SDRAM on D[31:16]. In this configuration the SDRAM doesn’t share data lines with other devices so bus contention is not an issue.
• Additional workarounds TBD. We are investigating workarounds that can be used for 32-bit wide SDRAM configurations.
7.3 Status
Fixed starting with 2M28B mask set.
Dave
Thanks for the complement!
1. Yes. PSTCLK is clocking at the core frequency of 166MHz.
2. The loop that was executing when the failed RESET took place is a simple bit of C code as follows:-
//Interrupts disabled and SR=0x2700.
printf("\n\nStarting");
while (TRUE)
{
UINT32 Count;
for (Count=0; Count<100000; Count++)
{
*((VUINT32*)0x41400000)=*((VUINT32*)0x40400000);
*((VUINT32*)0x40400001)=*((VUINT32*)0x41400001);
}
printf(".");
for (Count=0; Count<100000; Count++)
{
*((VUINT32*)0x41400000)=*((VUINT32*)0x40400000);
*((VUINT32*)0x40400001)=*((VUINT32*)0x41400001);
}
}
We have tried other variants all cause the same problem. One important point is that we have to turn the cache off to cause the problem; we assume that this is due to the fact that SDRAM access is required to cause the problem. There has been no DMA setup, interrupts have never been enabled and the MAC has not been initialised.
3. Board is currently configured for PLL mode
Under normal operation:-
As RSTOUT goes high CS0 is high
a. Stays high for around 200nS following the RSTOUT high
b. goes low for around 750nS
c. then goes high for 110nS
b (2 & 3) are repeated for a number of cycles is step with program execution
Under fault conditions:-
a. CS0 goes low about 10nS after RSTOUT goes high
b. It stays low for only around 60nS
c. it then goes high for around 60nS
d. it then goes low for around 12nS
e (3 & 4) are repeated for a number of cycles
f. At some point this changes to 12nS high then 12nS low
4. Yes I have RSTOUT connected to both the –OE’s of the 74LXC244WM and I can see the configuration on the data lines during RSTOUT low.
Kind regards, Dave
Hi Dave,
Good detail in your post. The is very much appreciated.
When processor is hung... do you see PSTCLK clocking at the core frequency?
What is the tight loop you are using?
Are you seeing the CS0 asserting to flash after the RSTOUT goes high (i.e. is reset exception trying to occur)?
Are you using RSTOUT to drive the OE on the 74L?
Regards,
DavidS