xCore-200 MC dev board - failed to connect to SQI flash device with sample code

If you have a simple question and just want an answer.
Zed1970
Member++
Posts: 26
Joined: Tue Oct 15, 2019 10:36 am

xCore-200 MC dev board - failed to connect to SQI flash device with sample code

Postby Zed1970 » Tue Oct 15, 2019 11:26 am

Hi,

Hopefully a straight forward solution. There appears to be mismatched quad serial flash settings. I have made no adjustments, downloaded the last IDE, latest demo code, new untouched development board. I had hoped they would of all just work seamlessly..

I can debug and run the application however on flashing the board I get the following error:
Error on tile[0]: failed to connect to flash device. Please verify that SQI type is supported and that the correct SQI ports are defined within your xn file.

Hardware and software:
xTIMEcomposer/Community_14.3.3 on Ubuntu 16.04
sw_usb_audio-[sw]_6.15.2.zip
app_usb_aud_xk_216_mc ( app within above zip )
xCORE-200 MC AUDIO 2V0
On board is IS25LQ016 ( the circuit states a IS25LQ008 and the software is xn has S25FL116K )

xflash -l returns:
ID Name Adapter ID Devices
-- ---- ---------- -------
0 XMOS XTAG-3 NN2WUEuW O[0]


After reading many posts on here it seems a mismatch in SQI settings, my question is "exactly" where and how do I change these settings? I've tried "IS25LQ016" and "IS25LQ016B" in my xk-audio-216-mc.xn but neither made any difference. We have a design pending on this development board so any help would be appreciated.

Attached is the error log when trying to program the development board.

Thanks.
You do not have the required permissions to view the files attached to this post.
User avatar
mon2
XCore Legend
Posts: 1679
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Tue Oct 15, 2019 6:30 pm

Hi. See if this helps:

viewtopic.php?f=26&t=6448
User avatar
mon2
XCore Legend
Posts: 1679
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Wed Oct 16, 2019 11:04 am

Post your .XN file for this project.
Zed1970
Member++
Posts: 26
Joined: Tue Oct 15, 2019 10:36 am

Postby Zed1970 » Wed Oct 16, 2019 1:38 pm

Hi mon2,

Here is the default xn file as requested.

Thanks
You do not have the required permissions to view the files attached to this post.
User avatar
mon2
XCore Legend
Posts: 1679
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Thu Oct 17, 2019 12:49 pm

Please review the attached appnote, test and post your results.

What are the results of flashing through the xTimeComposer Studio GUI toolchain? Also to clarify, this testing is on the XMOS supplied kit and not your custom designed hardware? If it is on your custom hardware, please post the schematic of your widget or at least share the XMOS CPU to flash portion for a review.

AN00185_-Boot-an-xCORE-200-device-from-QuadSPI-flash-memory_1.0.1rc1.pdf
You do not have the required permissions to view the files attached to this post.
Zed1970
Member++
Posts: 26
Joined: Tue Oct 15, 2019 10:36 am

Postby Zed1970 » Tue Oct 29, 2019 11:29 pm

Hi mon2,

The kit is out-of-the-box XMOS supplied kit as above, xCORE-200 MC AUDIO 2V0. I don't understand why a new board, xmos IDE and sample code just doesn't work? The debugger works but not the programming to SQIFlash.
I use in my .xv

<Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash" Type="IS25LQ016B">
<Attribute Name="PORT_SQI_CS" Value="PORT_SQI_CS"/>
<Attribute Name="PORT_SQI_SCLK" Value="PORT_SQI_SCLK"/>
<Attribute Name="PORT_SQI_SIO" Value="PORT_SQI_SIO"/>

The XMOS 200 board has a IS25LQ016B on it so why would this not work out of the box? I get no information while flashing in xTIMEcomposer just the error: Error on tile[0]: failed to connect to flash device. Please verify that SQI type is supported and that the correct SQI ports are defined within your xn file. That's why I've used terminal to get some more debug - below:

xflash -v /home/ed/xmos/projects/app_usb_aud_xk_216_mc/bin/2i10o10xssxxx/app_usb_aud_xk_216_mc_2i10o10xssxxx.xe
XFlash_Options::ListDevices : xgdb --batch -q --ex listdevices devl-f4814a5a
XFlash_Application found _start :40000 on Node 0
XFlash_Application found _DoSyscall :43210 on Node 0
XFlash_Application found _DoException :400a4 on Node 0
XFlash_Application found _start :40000 on Node 0
XFlash_Application found _DoSyscall :44960 on Node 0
XFlash_Application found _DoException :400a4 on Node 0
XFlash_Application : Attempting to Compress Binary Data
libcompressor marker 1=186
libcompressor marker 2=126
libcompressor marker 3=223
libcompressor best marker length 3 2 2
libcompressor best marker length 3 2 3
libcompressor best marker length 3 2 4
libcompressor best marker length 4 2 4
libcompressor best marker length 4 2 5
libcompressor DoCompression_Compress took : 180ms
libcompressor compile command=xcc -nostartfiles -Xmapper --bootstyle=forsim -x assembler-with-cpp "decompressor-574da237" -x xn "target-xn-v0-88a5f9d7" -o decompressor-33e7fa0f
libcompressor validating decompressor decompressor-33e7fa0f
libcompressor launching simulator decompressor-33e7fa0f --disable-syscalls --max-cycles 100000000
libcompressor simulator starting @0x40000
libcompressor simulator terminate @0x7ff58
libcompressor decompressor validated
XFlash_Application on Node : 0 compressed from : 19292 bytes to : 13484 bytes (30.11%)
libcompressor marker 1=126
libcompressor marker 2=163
libcompressor marker 3=154
libcompressor best marker length 3 2 2
libcompressor best marker length 3 2 3
libcompressor best marker length 3 2 4
libcompressor best marker length 4 2 4
libcompressor DoCompression_Compress took : 454ms
libcompressor compile command=xcc -nostartfiles -Xmapper --bootstyle=forsim -x assembler-with-cpp "decompressor-15cfb460" -x xn "target-xn-v0-88a5f9d7" -o decompressor-721f1ec2
libcompressor validating decompressor decompressor-721f1ec2
libcompressor launching simulator decompressor-721f1ec2 --disable-syscalls --max-cycles 100000000
libcompressor simulator starting @0x40000
libcompressor simulator terminate @0x7ff58
libcompressor decompressor validated
XFlash_Application on Node : 0 compressed from : 25788 bytes to : 17892 bytes (30.62%)
XFlash::DoXFlash
XFlash::DoImageProgramming
XFlash::GetDeviceInfo
XFlash_DeviceInfo::GetDeviceInfo_Hardware
XFlash_DeviceInfo::GetDeviceInfo_Hardware_IssueCompileCommand : xcc -Xmapper --dontenablesodlinks -Xmapper --wnoXN -x xc "spiinfo-a41429be" -x xn "target-xn-v0-88a5f9d7" -o "spiinfo-e1a9da9e" -lquadflash -D xnPORT_SQI_CS0=PORT_SQI_CS -D xnPORT_SQI_SCLK0=PORT_SQI_SCLK -D xnPORT_SQI_SIO0=PORT_SQI_SIO
XFlash_Utils::BuildRunCommand : xrun --io spiinfo-e1a9da9e
Error on tile[0]: failed to connect to flash device. Please verify that SQI type is supported and that the correct SQI ports are defined within your xn file.


Do you know what device this is? spiinfo-e1a9da9e


We have a product show within a few weeks and I really need to get this fixed, please let me know anything that could help. I looked through the documents you posted but were't helpful in my case.

Thanks.
Zed1970
Member++
Posts: 26
Joined: Tue Oct 15, 2019 10:36 am

Postby Zed1970 » Wed Oct 30, 2019 12:16 am

I tried this after reading a ton of posts,

xflash --id 0 -v --spi-read-id 0x9f /home/ed/xmos/projects/app_usb_aud_xk_216_mc/bin/2i10o10xssxxx/app_usb_aud_xk_216_mc_2i10o10xssxxx.xe

The end resulted in:
.......
...........
libcompressor launching simulator decompressor-33dce1e8 --disable-syscalls --max-cycles 100000000
libcompressor simulator starting @0x40000
libcompressor simulator terminate @0x7ff58
libcompressor decompressor validated
XFlash_Application on Node : 0 compressed from : 25788 bytes to : 17892 bytes (30.62%)
XFlash::DoXFlash
XFlash::DoReadWriteErase
XFlash_Programmer_ReadDeviceID::ReadDeviceId
XFlash_Programmer_ReadDeviceID::GenerateSource
XFlash_SPI_DeviceId::IssueCompileCommand : xcc -Xmapper --dontenablesodlinks -Xmapper --wnoXN -x xc "sqi-a682a655" -x xn "target-xn-v0-c08c926f" -o "sqi-4ae300f8" -lquadflash -D xnPORT_SQI_CS0=PORT_SQI_CS -D xnPORT_SQI_SCLK0=PORT_SQI_SCLK -D xnPORT_SQI_SIO0=PORT_SQI_SIO
XFlash_Utils::BuildRunCommand : xrun --io --id 0 sqi-4ae300f8
Response to SPI ID command on tile[0]: 0x0, 0x0, 0x0.

Cheers.
User avatar
mon2
XCore Legend
Posts: 1679
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Wed Oct 30, 2019 2:20 am

Hi.

1) out of the box, does XMOS ship with onboard firmware on this kit? Perhaps some LEDs blink on the LED array? Please confirm this firmware detail as it is important.

2) If the kit does feature some factory based firmware then most likely this firmware is loading from the external QSPI flash device. This relationship should validate that the flash device is operational and properly connected to the XMOS CPU on this kit. If there is no firmware supplied inside this external flash, continue to read on...

3) The read ID SPI flash command should have returned the ID of the external flash device. The 9fh ID command is common to many flash devices and is listed inside the ISSI datasheet. As long as the XN file is properly mapping the port pains to the proper external flash device, the xflash tool should have worked. From an earlier review of this thread, believe your XN file looked ok.

4) Can you confirm again on the part markings on the flash device onboard your kit? The XMOS schematic notes an ISSI IS25LQ080B @ U24. Perhaps the schematic is out of sync but worthwhile to review.

5) Regardless of the flash p/n, you should be able to R/W to the flash using other means. Review this thread:

viewtopic.php?t=4449

Using the above method we posted a while ago, you should be able to R/W to the external flash. This small piece of code is based on XMOS AN00188. Does this work for you? This method to R/W to the flash is independent of the xflash tool.

6) If the above approach fails to R/W to the flash then perhaps you have a PCB assembly issue - out of the factory. Hope this is not the case but we have seen this in the past and other developers have confirmed our observation. There was one case with one of the kits where the kit did not operate correctly and after 1.5 days of debugging, nailed it down to a multiplexer that was not switching.The XMOS CPU port pin was toggling but the mux did not. The root cause was due to an improperly over etched plated through via from top to bottom side of the PCB. It was a nice waste of life. Without a doubt the kit nor the bare PCB was tested before shipping.

Using a meter and/or scope, it will be quite simple to validate the CPU to flash connection. The suggestion is to simply create a simply LED blinky code to toggle pin # 1 of the flash via the XMOS CPU @ 1 Hz or similar. Run the code out of RAM - does the flash pin toggle as it should? Yes, continue to next toggle pin # 2 on the flash IC and so on to validate each port pin on the CPU to flash relationship. We may see a surprise here which may explain why the FLASH IDs are all 0x00 (assuming the XN file is correct for the kit).

Somewhere on this forum, posted some other code based on the XMOS StartKit (but will work for your kit as well) to allow for R/W to the flash devices - without using xflash. At the very least, that small piece of code should allow you to read out the flash IDs like we did a few years ago. Again, this code will confirm that the electrical side of the design is stable. Once we know this, the focus is on the use of the xflash tool to operate with your kit. Will search for it and post more details later.

There are many developers using this audio kit so hoping others will chime in to add to the above list of debugging ideas.

Update:

Also, not to bash Linux but please consider load up the Windows version of the XMOS toolchain and perform similar testing for the flash programming.
User avatar
mon2
XCore Legend
Posts: 1679
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Wed Oct 30, 2019 2:47 am

Can you also try the following and post your results?

Code: Select all

xflash --target-file YOURFLASH.xn --read-all -o memdump.bin

Use the .xn file that you believe is valid for your kit and run. What is the size of the .bin file? You can use any free HEX or BINARY FILE editor to review the contents of this file. On Windows, we use HHD or HxD but not sure what is available on Linux these days.

and if you are ok to ERASE your target flash:

Code: Select all

xflash --target-file YOURFLASH.xn --erase-all 
It is mandatory for the flash device on your kit to match the flash device referenced inside the .xn file else xflash tool will halt.The xflash tool performs a ping of the ID from the flash device and respectively continues if the flash IDs match. Note that IF the flash device is electrically not connected or missing then the IDs will mismatch and will also cause all of the symptoms you have noted since the start of this thread. We will wait on that conclusion till you perform the above list of testing.
User avatar
mon2
XCore Legend
Posts: 1679
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Wed Oct 30, 2019 3:02 am

Posting the .xn file supplied by another developer with the same kit. The flash device referenced by this .xn file matches the flash p/n ISSI IS25LQ080B as noted inside the kit schematic.

Can you rename the .xn file in your project to another and attempt to use this posted .xn file? Again, post your results after testing.

Be sure that the toolchain is indeed referencing the proper .xn file. You could confirm this by moving the .xn file to another folder -> try to use xflash tool again with the same .xn file (that should now be missing) - does xflash report an error that the .xn file is missing?

xk-audio-216-mc.xn
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: No registered users and 2 guests