Hello and thank you again for your fast answer, we have been a little bit busy with other projects so please forgive the delay.
>If the CLK Clock signal stops then the SDRAM remains locked until it is clocked out of this state. There should be a point during initialisation where the clock and CKE are enabled. Put a delay in there rather than immediately proceeding to the next step of initialisation.
This point (I guess) is where we set the SDRAM registers - before the CKE signal activation but after the CK initialization.
// 5mS Wait Time before raising up CKE for (i = 0; i < 222; i++) { _ASM_NOP(); } sdramc->SDCR = MCF54XX_SDRAMC_SDCR_MODE_EN | MCF54XX_SDRAMC_SDCR_CKE | MCF54XX_SDRAMC_SDCR_DDR_MODE | MCF54XX_SDRAMC_SDCR_DDR2_MODE | MCF54XX_SDRAMC_SDCR_ADDR_MUX(1) | MCF54XX_SDRAMC_SDCR_REF_CNT(11) | MCF54XX_SDRAMC_SDCR_MEM_PS | MCF54XX_SDRAMC_SDCR_IPALL;
In the next image you can see the CK and CKE initialization process.

Note: We had some trouble sampling in the 10nS span - we are working at 100Mhz CK speed rate - and had to reduce the sampling frequency. This made our CK signal sampling wrong but the image is useful to calculate the amount of CK cycles before CKE.
Time delayed: 5ms
Cycle Speed Rate: 10nS (100MHz)
Total cycles elapsed: 5mS/10nS =500 000 cycles
This delay should be more than enough to clock out the SDRAM from wherever state it is and avoid the MCU crash.
>Where did ThAT come from? I'm talking about the Burst Length configured into the Mode Register in the DDR RAM chip, and not something configured into the DDR Controller.
>According to my data sheets, the only allowed burst settings are "0, 1, 2, 3" corresponding to bursts lengths of "1, 2, 4, 8". This should be set to exactly match your CPU's burst length (in units of 16 bits remember). "7" isn't legal.
Sorry, my bad. I was talking about SDRAM Controller software values. Our DDR works at a selectable burst length of 4 or 8 (Right now is 8.) But for SDRAM controller configuration (SDCFG2) Burst Length is equal to the chip burst length value (16 bits base) minus one. I thought you were talking about this.
// BL = Burst Lenght - 1sdramc -> SDCFG2 = MCF54XX_SDRAMC_SDCFG2_BL(7);
>*WHERE* does the CPU hang?
That’s a good question. According to our tests, the CPU hangs when initializing after a reset. More specifically, while attempting to access to the SDRAM but after the SDRAM initialization. This happens mostly if we reset the board while the MCU is accessing to the SDRAM. This means in our case, when coping FLASH software to the SDRAM.
>Your CPU should be happily running up until the point where it tries to rely on data stored in the DDR at which point it probably crashes rather than hangs.
That’s right. Our MCU crashes, and we are unable to restore the normal initialization by using the reset button. We only can only restore it by powering off and on again.
>Why not code up a short RAM test that runs after it has initialised the DDR? If the test fails it can print something on a console or flash a LED at you. It could even trigger its own reset. It could even go and reinitialise the RAM again, and then keep doing that until it works (or until your external reset controller kicks it again).
I see your point. The test could run after the hardware initialization but before the MQX_start call. But I’m afraid that any access to the SDRAM will crash the MCU, generating a sefl reset infinite loop, as the MCU doesn’t seems able to restore the SDRAM. We will give it a try anyway.
With external reset controller, the only reset signal we can send to the MCU is the same signal that the reset button generates (they are attached in an AND door) and the MCU only un-crashes after a power on, so it is not very helpful.
>Have you tried READING and WRITING some dummy values to the DDR after initialisation and before running? Beware that if you have the data cache on at that point you might not be writing anything to the DDR, so read and write with the data cache off.
I think is the access to the SDRAM what crashes the MCU. Part of our program runs in the SDRAM, we will check if the crash comes after writing or after the SDRAM jump. Thank you.
>Changing the chip brand won't solve anything. it won't guarantee the problem has gone. Reprogramming and resetting twice doesn't guarantee it is working properly either. You can't guarantee the hardware is working properly until you have found exactly what is wrong and have fixed it
Ok. We will trace this particular error first and determine exactly what is wrong. The double initialization trick didn't work eventually. The only reason why it worked -we think- was the delay added to that particular part of the initialization, but right
now we are not so sure. After adding a big delay we didn’t saw a change in the MCU behaviour, the error persists.
Thanks again.