cancel
Showing results for 
Search instead for 
Did you mean: 

QSPI prefix bytes when reading data

Posted on March 15, 2018 at 11:03

Hello there,

Using the BSP example code I have composed a function for reading data from an external QSPI flash memory. Here it is:

https://pastebin.com/ZsGjfDGD

 

I am facing a peculiar problem at the moment. When I read the data, i notice that it is not saved right at the start of the buffer, but it is shifted by 2 bytes (0x88 both). For for example, i under address 0x00 I have previously saved values 01 02 03 04, the data I read will be equal to: 88 88 01 02 03 04 (saved under provided buffer). This works this way both for regular and DMA reading. At the moment I have made a workaround in the code to ignore this offset, but because of that I need to copy bytes, which is not optimal. I cannot drive from what operation are those bytes comming from. I have a feeling that it has to do something with the Alternate byte mode, but I am not sure how. I was also not able to find why are the alternate bytes set this way in the example and what does it do.

here is the original BSP example code:

https://pastebin.com/0eK1QWsa

 

https://pastebin.com/7XW0LiQc

 

I would appreciate all help.

#qspi-flash
5 REPLIES 5
RKrah
Associate II

Hi,

have You found any solution to this problem?

Best regards!

RKrah
Associate II

Hi,

have You found any solution to this problem?

Best regards!

RKrah
Associate II

Hi,

have You found any solution to this problem?

Best regards!

Hello @RKrah​ 

This was a while a go. I think the problem was improper settings of the amount of command/ address/ data bytes for the certain memory chip.

Thanks for the hint, it pointed me in right direction. My solution was to increase number of dummy cycles (from 8 to 14) for read command during memory mapped access setup. 6 additional dummy cycles corresponds to 6 8's i was receiving (0x888888) each 32 (length of microcontroller qspi read fifo buffer) bytes read.

Hope that will help somebody someday.