[SOLVED] SAMA5D3 Cannot warm reset on SPI NOR Serialflash

Discussion around products based on ARM Cortex-A5 core.

Moderator: nferre

mfortini
Posts: 7
Joined: Thu Dec 02, 2010 7:30 pm

[SOLVED] SAMA5D3 Cannot warm reset on SPI NOR Serialflash

Mon Jul 28, 2014 12:14 pm

Our SAMA5D35 board will boot ok from poweroff on a NOR serialflash
If we do a warm reset, either through NRST or soft reboot, the board will just start in SAM-BA mode with the RomBOOT prompt. (The reset cause is correctly set to 0x4).

We checked the SPI0 CS0 signal and it's going low for a while on NRST or soft reboot, the same as for power up.
There is only one peripheral on SPI0 and the wires are straight from the CPU to the NOR flash.

NAND boot instead will work both on power up and soft-reboot.

We observed the MISO waveform in power-up and soft-reboot 

Here's a screenshot of a correct boot sequence right after power-up:
BOOT_OK_MISO_NOR.jpg
MISO waveform right after reset.
BOOT_OK_MISO_NOR.jpg (378.27 KiB) Viewed 1605 times
Here's the same waveform on a warm reset:
BOOT_KO_MISO_NOR.jpg
MISO waveform after warm-reset
BOOT_KO_MISO_NOR.jpg (282.49 KiB) Viewed 1605 times
What we observe is that the wrong waveform is shifted, so we suspect that some stray edge is generated on SCLK and the NOR memory is sending out all data shifted one bit.

Some other info:
* the same code works properly on the EVK serial flash
* if we enable SPI but we set the wrong params on CSR0 (setting it to 0x00000300), the NOR is not recognized by barebox, but warm reset works correctly
mfortini
Posts: 7
Joined: Thu Dec 02, 2010 7:30 pm

Re: [SOLVED] SAMA5D3 Cannot warm reset on SPI NOR Serialflas

Wed Jul 30, 2014 3:40 pm

The problem is with spansion serial flash chips with size greater than 16MiB:
Spansion flashes allow for 3- or 4-byte addressing and the bootloader and Linux driver are setting 4-byte addressing to make it easier to use the full 32MB.

Since our board is not resetting the flash on reset, the flash still expects 4-byte addresses and everything in the data gets shifted one byte and RomBOOT fails.
mfortini
Posts: 7
Joined: Thu Dec 02, 2010 7:30 pm

Re: [SOLVED] SAMA5D3 Cannot warm reset on SPI NOR Serialflas

Wed Jul 30, 2014 5:40 pm

Same problem here on Freescale.

The sw solution proposed by the author is quite flakey: if somehow a reset hits you before you reset the number of address bytes to 3, you cannot reboot without a power off.

Return to “SAMA5D Cortex-A5 MPU”

Who is online

Users browsing this forum: No registered users and 1 guest