cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
nctuser
Observer
Observer
326 Views
Registered: ‎10-27-2019

QSPI flash linear read incorrect values

Jump to solution

Hello,

I have experienced a strange behavior of linear flash reading
of QSPI flash memory attached to zynq7000 device. The qspi
memory is Cypress S25FL256S (32 MiB).

I have tested my own developed functions which purpose to switch
the qspi peripheral between I/O mode and linear mode. I used the
start of flash memory to test it because it contains known data
(the boot header).

QFlash_InitLinear(XPAR_XQSPIPS_0_DEVICE_ID);

for (int i = 0; i < 20; i++)
    array[i] = *((uint32_t*)0xFC000000 + i);

The first eight read value (32 bytes) contained 0xFFFFFFFF value,
and the ninth and the further values were correct. If I read the
qspi flash through my own read function which uses I/O mode all
the values were correct (the content is the interrupt vectors).
I tried qspi reset, RX FIFO flush after switching to linear mode,
but the result was the same, the first 32 bytes were incorrect
of linear reading from address 0xFC000000. Linear reading of
other addresses seemly worked well.

After some experiments it seems if I read linearly the first 32
bytes of 0xFC000000 come form flash address 0x1000000,
so the upper 16M of the qspi flash. Could it be possible? Can
anybody explain this? Our application uses the qspi flash
intensively both in linear and in I/O mode and it is hardly
defensible if the reading happends from wrong address.

I attached the register settings of qspi peripheral after calling my
linear init funiction.

Thank you.

qspi_regs.png
0 Kudos
1 Solution

Accepted Solutions
denist
Xilinx Employee
Xilinx Employee
244 Views
Registered: ‎10-11-2011

Linear mode in zynq-7000 actually start reading from the provided address - 3.

If you read 0x0 the actual read address will be 0xFFFFFFFE.

Some flashes loop around correctly to 0x0, other change page (16MB).

I think that's what you are seeing.

Recommend to read starting from 0x10 instead.

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

View solution in original post

2 Replies
denist
Xilinx Employee
Xilinx Employee
245 Views
Registered: ‎10-11-2011

Linear mode in zynq-7000 actually start reading from the provided address - 3.

If you read 0x0 the actual read address will be 0xFFFFFFFE.

Some flashes loop around correctly to 0x0, other change page (16MB).

I think that's what you are seeing.

Recommend to read starting from 0x10 instead.

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

View solution in original post

nctuser
Observer
Observer
184 Views
Registered: ‎10-27-2019

When I read from address 0xFC000020 (above the first 32 byte)
the value is 0xAA995566 which is expected (defined in zynq boot
header) and seemly there is no any address offset on it but the
problem certainly caused what you wrote. Thank you for bothering
our problem.

 

 

0 Kudos