We've created a custom board around a XU316-1024-FB265-C32 including a W25Q64JW QSPI.
We did not want to use the QSPI form the XCORE_AI_EXPLORER board as it can only be clocked up to 75MHz.
We assumed using the same QSPI chip as on the XK-VOICE-L71 would make things easy for us, but we ran into unexpected issues.
As a very simple test we ran through the QSPI fast read sample instructions:
1) Increased the drive strength to 50% with the following commands:
xflash --spi-command 0x06 --target-file=CUSTOM.xn
Executed SPI command 0x06 on tile[0].
xflash --spi-command 0x11 0 0x40 --target-file=CUSTOM.xn
Executed SPI command 0x11 on tile[0].
and confirmed value is set correctly:
xflash --spi-command 0x15 1 --target-file=CUSTOM.xn
Response to SPI command 0x15 on tile[0]: 0x40.
2) Created custom spi-spec file "W25Q64JW.spi-spec" with the following content:
Code: Select all
0, /* Just specify 0 as flash_id */
256, /* page size */
32768, /* num pages */
3, /* address size */
4, /* log2 clock divider */
0x9F, /* QSPI_RDID */
0, /* id dummy bytes */
3, /* id size in bytes */
0xEF6017, /* device id (determined from xflash --spi-read-id 0x9F)*/
0x20, /* QSPI_SE */
4096, /* Sector erase is always 4KB */
0x06, /* QSPI_WREN */
0x04, /* QSPI_WRDI */
PROT_TYPE_SR, /* Protection via SR */
{{0x18,0x00},{0,0}}, /* QSPI_SP, QSPI_SU */
0x02, /* QSPI_PP */
0xEB, /* QSPI_READ_FAST */
1, /* 1 read dummy byte */
SECTOR_LAYOUT_REGULAR, /* mad sectors */
{4096,{0,{0}}}, /* regular sector sizes */
0x05, /* QSPI_RDSR */
0x01, /* QSPI_WRSR */
0x01, /* QSPI_WIP_BIT_MASK */
3) The content of CUSTOM.xn is:
Code: Select all
...
<Packages>
<Package id="0" Type="XS3-UnA-1024-FB265">
<Nodes>
<Node Id="0" InPackageId="0" Type="XS3-L16A-1024" Oscillator="24MHz" SystemFrequency="800MHz" ReferenceFrequency="100MHz">
<Boot>
<Source Location="bootFlash"/>
</Boot>
...
<Links>
<Link Encoding="2wire" Delays="100clk" Flags="XSCOPE">
<LinkEndpoint NodeId="0" Link="XL0"/>
<LinkEndpoint NodeId="2" Chanend="1"/>
</Link>
</Links>
<ExternalDevices>
<Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash" Type="W25Q64JW" PageSize="256" SectorSize="4096" NumPages="32768">
<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"/>
<Attribute Name="QE_REGISTER" Value="flash_qe_location_status_reg_0"/>
<!-- <Attribute Name="QE_BIT" Value="flash_qe_bit_6"/> -->
</Device>
</ExternalDevices>
...
xflash --spi-spec W25Q64JW.spi-spec --verbose --write-all calibration_pattern.bin --target-file=CUSTOM.xn
XFlash_Options::ListDevices : xgdb --batch -q --ex "listdevices" devl-35d38a80
XFlash::DoXFlash
XFlash::DoReadWriteErase
XFlash::GetDeviceInfo
XFlash_DeviceInfo::GetDeviceInfo_User
XFlash_DeviceInfo::PrintDeviceInfo
Site 0 (bootFlash) info:
_device_size 0x800000
_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 0x800000
XFlash_Builder_Storage_PPB::BuildStorage
XFlash_Programmer_Write::DoWrite
XFlash_Programmer_Write::IssueCompileCommand
xcc -w -fxscope -x xn "C:\Work\02_Projects\test\CUSTOM.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-2a5ad96d" -o "fw-ee490001"
XFlash_Utils::BuildRunCommand : xrun --xscope fw-ee490001
Site 0 has started.
Site 0 has ID 0x672003.
Site 0 erase 0x00000000.
Site 0 write 0x00000000.
Verify failed for page 0x00000000, offset 0x0000 (read 0x0f, expected 0xff).
Error: F03013 Failed to run : 00AFE720.
Observations:
- I can get this command to work if I set the the clock divider in W25Q64JW.spi-spec to 6, but if I then try using the qspi fast read commands I still run into issues.
- Increasing the drive strength of the W25Q64JW does have some effect: if I set it to 100% I can reduce the same clock divider and the QSPI initializes at least, but does not allow any further operations.
There is a HW difference between our design and the XK-VOICE-L71: There is a 10K resistor to the nCS line, in the XK-VOICE-L71 design (and EXPLORER board) this is a 4.7K. Could this lead to this issue?
Any help is much appreciated.
Thanks
Alex