Problem reading QSPI on PXUA EVK

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
elektron314
New User
Posts: 3
Joined: Tue Nov 14, 2023 7:46 pm

Problem reading QSPI on PXUA EVK

Post by elektron314 »

Hello everybody,

I have PXUA-XU316-KIT v2.01, a Chinese minimalistic devkit with XU316-1024-QF60B-C24 onboard.
https://docs-pawpaw-ltd.translate.goog/ ... r_pto=wapp
Be aware that now they already have v3.

I want to mention that in version v2.01 they implemented a very weird connection to debug the XMOS, only 10 pins out of 12 minimum required for XTAG connection. So the user has to create some wired spider to connect XTAG with the PXUA EVK.

I'm trying to flash it with my compiled or their (PawPaw company) binaries - same error.

# What I can do with success
## See the XTAG and the DUT
$ xburn -l

Available XMOS Devices
----------------------

ID Name Adapter ID Devices
-- ---- ---------- -------
0 XMOS XTAG-4 GYNUPYVU P[0]
and
xrun --io hello-pxua.xe
Hello World!

It works ok with my compiled or their binaries but the firmware doesn't stay in the processor, it is just uploaded directly from the PC via XTAG and not written to the flash memory.

# What I can NOT do with success
## Read to the flash to the file with xflash
$ xflash --read-all -o output.txt --target PXUA --verbose --spi-spec UC25HQ16B_QSPI.spec
XFlash::DoXFlash
XFlash::DoReadWriteErase
XFlash::GetDeviceInfo
XFlash_DeviceInfo::GetDeviceInfo_User
XFlash_DeviceInfo::PrintDeviceInfo
Site 0 (bootFlash) info:
_device_size 0x200000
_device_page_size 0x100
_regular_sector_sizes true
_device_sector_size 0x1000
_device_protection_available false
_device_divider 3
_device_first_user_sector 0x0
_device_search_limit 0x200000
_qe_override true
_device_qe_register 1
_device_qe_bit 1
XFlash_Programmer_Read::DoRead
XFlash_Programmer_Read::IssueCompileCommand
xcc -w -fxscope -x xn "/Users/el314biig/Applications/XMOS_XTC_15.2.1/targets/PXUA/PXUA.xn" -O2 -lquadflash -D xnPORT_SQI_CS0=PORT_SQI_CS -D xnPORT_SQI_SCLK0=PORT_SQI_SCLK -D xnPORT_SQI_SIO0=PORT_SQI_SIO -x xc "fr-8d78504b" -o "fr-61347a4e"
XFlash_Utils::BuildRunCommand : xrun --xscope fr-61347a4e
xrun: First stage multi-node boot failed, please check XN file and Xmos link connectivity

Error: F03013 Failed to run : 0x7ff7b6746f80.


## Flash the flash with xlfash
$ xflash --verbose hello-pxua.xe --spi-spec UC25HQ16B_QSPI.spec --target PXUA
XFlash_Options::ListDevices : xgdb --batch -q --ex listdevices devl-afbfcaa2
XFlash_Application found _start :80000 on Node 0
XFlash_Application found _DoSyscall :801c0 on Node 0
XFlash_Application found _DoException :800c4 on Node 0
XFlash_Application found _start :80000 on Node 0
XFlash_Application found _DoSyscall :80008 on Node 0
XFlash::DoXFlash
XFlash::DoImageProgramming
XFlash::GetDeviceInfo
XFlash_DeviceInfo::GetDeviceInfo_User
XFlash_DeviceInfo::PrintDeviceInfo
Site 0 (bootFlash) info:
_device_size 0x200000
_device_page_size 0x100
_regular_sector_sizes true
_device_sector_size 0x1000
_device_protection_available false
_device_divider 3
_device_first_user_sector 0x0
_device_search_limit 0x200000
_qe_override true
_device_qe_register 1
_device_qe_bit 1
XFlash::BuildFlashBinaryFile
XFlash_Builder_S2L::BuildStage2Loaders Factory
Stage2_Loader::Compile : xcc -Wno-bidirectional-buffered-port -Wno-timing -Wno-unused-function -Xmapper --dontenablesodlinks -Xmapper --nochaninit -Xmapper --noinitialtidy -Xmapper --image-base -Xmapper 0x80080 -Xmapper --image-size -Xmapper 0x7ff80 -Xmapper --wno110 -Xmapper --wno226 -Xmapper --wnoXN -std=gnu99 -O2 -target=XU316-1024-FB265-C32 -x none "/Users/el314biig/Applications/XMOS_XTC_15.2.1/target/app/xs3a/stage2loader_SQI.o" -lstage2loader -lsqiaccess -lquadspi -llocks -o s2l-n0-a190de39
Stage2Loader found DEVICE_SECTOR_WORD_SIZE : 0x81c68 on Node 0
Stage2Loader found pllConfig : 0x81b78 on Node 0
Stage2Loader found secondaryPllConfig : 0x81b88 on Node 0
Stage2Loader found ddrConfig : 0x81b98 on Node 0
Stage2Loader found otp_disable : 0x81c6c on Node 0
Stage2Loader found debug_stop : 0x81c70 on Node 0
Stage2Loader found s2l_record_timings : 0x81c5c on Node 0
Stage2Loader found s2l_search_by_address : 0x81c60 on Node 0
Stage2Loader found s2l_num_addresses : 0x81c64 on Node 0
Stage2Loader found s2l_search_addresses : 0x81b38 on Node 0
Stage2Loader found secondaryPllConfig : 0x81b88 on Node 0
Stage2Loader found ddrConfig : 0x81b98 on Node 0
Stage2Loader found flash_ports : 0x81b48 on Node 0
Stage2Loader found clock_config : 0x81b58 on Node 0
Stage2Loader found qe_config : 0x81b70 on Node 0
Stage2Loader found spanning_routing_id : 0x81f0c on Node 0
Stage2Loader found spanning_table : 0x80e18 on Node 0
Stage2Loader found num_spanning_tables : 0x81f10 on Node 0
Stage2Loader found routing_table : 0x81548 on Node 0
Stage2Loader found num_routing_tables : 0x81f14 on Node 0
Stage2Loader found link_info : 0x816d8 on Node 0
Stage2Loader found links_table : 0x818b8 on Node 0
Stage2Loader found num_link_tables : 0x81f18 on Node 0
Stage2Loader found galaxian_table : 0x81db8 on Node 0
Stage2Loader found num_galaxian_tables : 0x81f1c on Node 0
Stage2Loader found pll_table : 0x81e30 on Node 0
Stage2Loader found debug_stop : 0x81f20 on Node 0
XFlash_Builder_Image::BuildImages Factory
XFlash_Builder_Image::BuildImageTable
master node = 0
node = 0
XFlash_Builder_Image::BuildImageTable num cores for image table = 2
XFlash_Builder_Image::CalculateBufferSize Starting calculation _total_image_size=0
XFlash_Builder_Image::CalculateBufferSize Add Image Header _total_image_size=38
XFlash_Builder_Image::CalculateBufferSize Add Switch Setup header _total_image_size=40
XFlash_Builder_Image::CalculateBufferSize Add Per Core header _total_image_size=80
XFlash_Builder_Image::CalculateBufferSize_SwitchSetup _total_image_size=1fa8
XFlash_Builder_Image::CalculateBufferSize_Application application size = 4e8c _total_image_size = 6e34
XFlash_Builder_Image::CalculateBufferSize_Application application size = 10 _total_image_size = 6e44
XFlash_Builder_Image::BuildImageTable allocated image buffer size = 6e44
XFlash_Builder_Image::WriteBuffer_ImageHeader
XFlash_Builder_Image::WriteBuffer_SwitchSetup current switch setup table offset : 38
XFlash_Builder_Image::WriteBuffer_SwitchSetup current application data offset : 80
XFlash_Builder_Image::WriteBuffer_SwitchSetup size : 1f24
XFlash_Builder_Image::WriteBuffer_SwitchSetup aligned_size : 1f28
XFlash_Builder_Image::WriteBuffer_SwitchSetup init_vec_shift : 0
XFlash_Builder_Image::WriteBuffer_Application
XFlash_Builder_Image::WriteBuffer_Application for node : 0
XFlash_Builder_Image::WriteBuffer_Application for core : 0
XFlash_Builder_Image::WriteBuffer_Application current core table offset : 40
XFlash_Builder_Image::WriteBuffer_Application current application data offset : 1fa8
XFlash_Builder_Image::WriteBuffer_Application size : 4e88
XFlash_Builder_Image::WriteBuffer_Application aligned_size : 4e8c
XFlash_Builder_Image::WriteBuffer_Application init_vec_shift : 0
XFlash_Builder_Image::WriteBuffer_Application chan end : 80020002
XFlash_Builder_Image::WriteBuffer_Application for core : 1
XFlash_Builder_Image::WriteBuffer_Application current core table offset : 60
XFlash_Builder_Image::WriteBuffer_Application current application data offset : 6e34
XFlash_Builder_Image::WriteBuffer_Application size : c
XFlash_Builder_Image::WriteBuffer_Application aligned_size : 10
XFlash_Builder_Image::WriteBuffer_Application init_vec_shift : 0
XFlash_Builder_Image::WriteBuffer_Application chan end : 80030002
XFlash_Builder_Image::WriteBuffer_SwMem
XFlash_Builder_Image::WriteBuffer_SwMem for node : 0
XFlash_Builder_Image::WriteBuffer_SwMem for core : 0
XFlash_Builder_Image::WriteBuffer_SwMem current core table offset : 40
XFlash_Builder_Image::WriteBuffer_SwMem current application data offset : 6e44
XFlash_Builder_Image::WriteBuffer_SwMem for core : 1
XFlash_Builder_Image::WriteBuffer_SwMem current core table offset : 60
XFlash_Builder_Image::WriteBuffer_SwMem current application data offset : 6e44
XFlash_Builder_Image::WriteBuffer_ExtMem
XFlash_Builder_Image::WriteBuffer_ExtMem for node : 0
XFlash_Builder_Image::WriteBuffer_ExtMem for core : 0
XFlash_Builder_Image::WriteBuffer_ExtMem current core table offset : 40
XFlash_Builder_Image::WriteBuffer_ExtMem current application data offset : 6e44
XFlash_Builder_Image::WriteBuffer_ExtMem for core : 1
XFlash_Builder_Image::WriteBuffer_ExtMem current core table offset : 60
XFlash_Builder_Image::WriteBuffer_ExtMem current application data offset : 6e44
XFlash_Builder_Image::WriteBuffer_CRC
XFlash_Builder_Binary::BuildBinary
XFlash_Builder_Binary::CalculateBufferSize_Factory
XFlash_Builder_Binary::CalculateBufferSize_Factory : Adding s2l size word (4)4
XFlash_Builder_Binary::CalculateBufferSize_Factory : Adding s2l app (1c80) 1c84
XFlash_Builder_Binary::CalculateBufferSize_Factory : Adding s2l crc (4)1c88
XFlash_Builder_Binary::CalculateBufferSize_Factory : Adding factory app (6e44) 8acc
XFlash_Builder_Binary::CalculateBufferSize_Factory : Adding sector padding (534) 9000
XFlash_Builder_Binary::CalculateBufferSize_Factory : First User Sector offset = 9000
XFlash_Builder_Binary::GetSearchLimitPadding : current size (9000) 0
XFlash_Builder_Binary::CalculateBufferSize_Data
XFlash_Builder_Binary::BuildBinary : Allocating buffer - 9000
XFlash_Builder_Binary::GetSearchLimitPadding : current size (9000) 0
XFlash_Builder_Binary::WriteBufferToBinary : flash_bin_node0
XFlash_Builder_Storage_PPB::BuildStorage
XFlash_Programmer_Write::DoWrite
XFlash_Programmer_Write::IssueCompileCommand
xcc -w -fxscope -x xn "/Users/el314biig/Applications/XMOS_XTC_15.2.1/targets/PXUA/PXUA.xn" -O2 -lquadflash -D xnPORT_SQI_CS0=PORT_SQI_CS -D xnPORT_SQI_SCLK0=PORT_SQI_SCLK -D xnPORT_SQI_SIO0=PORT_SQI_SIO -x xc "fw-df5143c9" -o "fw-92c172a6"
XFlash_Utils::BuildRunCommand : xrun --xscope fw-92c172a6
xrun: First stage multi-node boot failed, please check XN file and Xmos link connectivity

Error: F03013 Failed to run : 0x7ff7bca0d430.


## Erase the flash with xflash
$ xflash --erase-all --target PXUA --verbose --spi-spec UC25HQ16B_QSPI.spec
XFlash_Options::ListDevices : xgdb --batch -q --ex listdevices devl-6944d080
XFlash::DoXFlash
XFlash::DoReadWriteErase
XFlash::GetDeviceInfo
XFlash_DeviceInfo::GetDeviceInfo_User
XFlash_DeviceInfo::PrintDeviceInfo
Site 0 (bootFlash) info:
_device_size 0x200000
_device_page_size 0x100
_regular_sector_sizes true
_device_sector_size 0x1000
_device_protection_available false
_device_divider 3
_device_first_user_sector 0x0
_device_search_limit 0x200000
_qe_override true
_device_qe_register 1
_device_qe_bit 1
XFlash_Programmer_Erase_NoChan::DoErase
XFlash_Programmer_Erase_NoChan::IssueCompileCommand
xcc -w -fxscope -Xmapper --nochaninit -Xmapper --noinitialtidy -x xn "/Users/el314biig/Applications/XMOS_XTC_15.2.1/targets/PXUA/PXUA.xn" -O2 -lquadflash -D xnPORT_SQI_CS0=PORT_SQI_CS -D xnPORT_SQI_SCLK0=PORT_SQI_SCLK -D xnPORT_SQI_SIO0=PORT_SQI_SIO -x xc "fe-81a18520" -o "fe-6c9532b0"
XFlash_Utils::BuildRunCommand : xrun --xscope fe-6c9532b0
xrun: First stage multi-node boot failed, please check XN file and Xmos link connectivity

Error: F03013 Failed to run : 0x7ff7b500bfb0.


# What I have verified already
[x] Verify that this connection is done right physically and that every net is switching as it should be
[x] Check that every signal on both boards corresponds to the schematics
[x] See the differences between xrun --io hello-pxua.xe and xflash
xrun --io doesn’t use XMOS link wires
[x] Check how XMOS uploads from the flash
It seems like XMOS and the request to read the flash start the same, almost. In both cases, there are a lot of data transfers via QSPI on all 4 lines
[x] Check the pin connection between XTAG and the PXUA by schematics
[x] Is nRST working?

# What I have discovered that has to be mentioned
During any operation related to the external QSPI flash memory XLink wires are involved but I see only activity on the data lines from the XTAG to the PXUA EVK, on the reciprocal lines (EVK>XTAG) there's only short splash like disturbing shorter than 1 bit on both Xlink out lines and then silence all the time.

# Questions
1. Does anybody have an experience with this devkit? Any problems, issues or success?
2. What can I do and check more to have success working with my flash through XMOS via XTAG?
3. Any help or thoughts from anybody to help me resolve my problem?