XHRA-2HPA Flash communication problems

Technical questions regarding the XTC tools and programming with XMOS.
Decourcf
Member++
Posts: 21
Joined: Fri Oct 30, 2015 8:53 am

Post by Decourcf »

Ok, after working on it and trying to fix the issue, it seems that you are right (again) and that quad SPI is not working properly.

Indeed, my programmer can only read standard SPI and even if I am writing the value 0x40 in the status register of the flash, as explained in datasheet (IS25LQ016B : http://www.issi.com/WW/pdf/25LQ080B-016B-032B.pdf), I still have to put Q3 to HIGH to do it, acting as standard SPI communication then.

So here are the conclusions so far :

- The image in the flash 'seems' to be good.
- The flash is not working in Quad SPI

I try to make it work but I must miss something in the datasheet, I think I'll try with another flash.
And what do you mean by '- Maybe the length is programmed incorrectly'. Where do I have to specify the length?
Decourcf
Member++
Posts: 21
Joined: Fri Oct 30, 2015 8:53 am

Post by Decourcf »

Here are some measurements of the signal I obtain when I power up the board, related to CS.
You do not have the required permissions to view the files attached to this post.
Decourcf
Member++
Posts: 21
Joined: Fri Oct 30, 2015 8:53 am

Post by Decourcf »

And the last ones
You do not have the required permissions to view the files attached to this post.
henk
Verified
Respected Member
Posts: 347
Joined: Wed Jan 27, 2016 5:21 pm

Post by henk »

Hi,

So - it seems that it is in 1-bit mode, rather than 4-bit mode - which explains it.

You will have to find a way to set it to quad-mode.

Don't worry about the length; one field in the flash image is the length, and it will be corrupted with the rest of the data.
Decourcf
Member++
Posts: 21
Joined: Fri Oct 30, 2015 8:53 am

Post by Decourcf »

Hi,

So I did check with the company who produces the flash memory, and as i thought I did the right procedure to activate Quad SPI. I also tested with another chip in case of component failure and I got the same result. I used a logic analyser in order to have more precise graphics.

I attach the file, if the results give you any idea of the problem, I am quite lost at this point.
You do not have the required permissions to view the files attached to this post.
henk
Verified
Respected Member
Posts: 347
Joined: Wed Jan 27, 2016 5:21 pm

Post by henk »

Hi,

Would you be able to zoom in on the first part, where CS goes low, and the command is sent out to the flash?

By the looks of it, the flash does not respond with any data; that is either because it didn't get the read command or because it didn't decode the read command.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

Hi François. Jumping into the middle of this post to see if we can assist. We do not have knowledge of your ref design but we spent a few weeks debugging the Quad SPI flash interface with assorted target flash devices. The posted code on github for Quad SPI is not stable for Quad SPI flash use and contains many errors.

To get a proper orientation of your project, please share the following:

a) is your Quad SPI flash mounted on a PCB or hand wired to the XMOS processor. The length of the wiring between the CPU and the flash memory is critical. Watch the lead and trace lengths and keep them as short as possible. We recall that Winbond brand flash devices could not support as long lead lengths (used with our logic analyzer probes and additional wires) as the Spansion brand. Also recommend that you consider to source Spansion (believe that will now be under Cypress) flash devices for some testing.

b) which OP CODE are you sending to the flash memory for these tests ? Once you send the proper OP CODE, the flash device will reply as noted in the data sheet. We know that after some rework of the code, we did succeed to R/W to the target Spansion and Winbond devices in Quad SPI mode with high speeds.

For a sanity check, we recall using standard SPI commands to perform an erase -> writing a pattern of values like 0x11,0x22,0x33,0x44..0xFF,0x55,0xaa (or similar) and then reading back in standard SPI mode to confirm the values are correct. Only then move to test your QUAD SPI op codes to READ (only) the same written values. Only once you can confirm that in QUAD SPI mode you can read back the same values, move on to work with the WRITE op code, etc. From a quick review, do not believe that you are operating the flash at high speed but do not agree with the viewed timing diagrams.

Summary:

1) Write a known pattern of data to your flash device using only standard SPI Flash commands (this is an industry standard).

2) Verify the same written data using the industry standard SPI flash READ command.

3) Now move to use the QUAD SPI flash command to read back from the same addresses.

From our past review, Spansion had a strong pin drive as compared to Winbond. Winbond sent us then a new version of the die which featured a custom register that allowed us to alter the pin drive strengths. Pretty sure that version of the flash memory behaved correctly under the same set of test conditions.

Good luck and post back your details and will see if we can assist further on your project.
Decourcf
Member++
Posts: 21
Joined: Fri Oct 30, 2015 8:53 am

Post by Decourcf »

Hi,

@Henk : Sure, I attached the zoomed screenshot, where you can read the command 0xEB, which is the fast read quad I/O command according to the datasheet (IS25LQ016B)

@Mon2 : About my ref design, I used the one posted on the chip main page (https://www.xmos.com/support/boards?product=18340). Hence I don't understand when you speak about code from GitHub, which one exactly?

a) To clarify my project, I am just using a XHRA-2HPA chip in order to build a usb audio board. The xmos chip is the only device I have which speaks in quad spi with the flash, which is soldered on the PCB. About the length, I made the traces as short as possible, but didn't put resistor network on the bus, maybe it could help (I'll try that and say if it did)

b) What exactly do you mean by OP CODE? Is that the one loaded in the xmos or in the flash? Because if it is the one in the xmos, I never modified it, and actually I don't know how to do it (or if it is possible?)

My process is the following :

1) In order to load firmware in the flash, I use a raspberry pi (with a python script) which speaks in standard SPI.

2) In order to read the data I use both raspberry Pi and/or Bus Pirate, which both still communicate in standard SPI. So I can say that your sanity check is OK.

3) I then write into the status register of the flash in order to enable quad SPI. But the only device I have which can communicate in quad SPI is the xmos and it is not working so far.

I hope I am quite clear about my project and my problem.
Also I really would like to thank both of you for your time and your help with me in this project.
You do not have the required permissions to view the files attached to this post.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

Hi. Thanks for the additional details. What is the issue ? That you are unable to get your design operational using a freshly loaded flash device ? For this project, you are using the external Raspberry PI to flash your memory on this target board ?

What is the relevance of the Quad SPI mode use ?

Do you believe that you need to be in QUAD SPI mode to make this design function correctly ?

May we suggest for you to source a StartKit -> write code using the StartKit to flash the LED using the same port pin as defined for your audio board (LEDA) -> then remove that flash from the StartKit and place onto your target board and see if the LEDA is able to blink ON/OFF as expected. This simple test can then confirm that the working LED blink program can be transferred onto your hardware.

Aside from the above, you should consider to somehow access a QUAD SPI bus analyzer - we are using the Zeroplus tool with the QUAD SPI module - not sure which tools from their line support this feature but some of the models are very inexpensive. Suspecting that the issue is with the contents of the flash memory so start with a simple LED blinky test.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

Have you seen this tool ?

https://www.xmos.com/support/boards?com ... 441&page=3

Could you not use the USB method to reflash the (empty) target flash device ? This approach will ensure that you are properly writing to the target device.

Also,

http://www.xcore.com/forum/viewtopic.ph ... +XHRA+2HPA

http://www.xcore.com/forum/viewtopic.ph ... +XHRA+2HPA