Interacting with QSPI memory after XMOS boot

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
en2senpai
Junior Member
Posts: 5
Joined: Mon Jul 19, 2021 7:32 am

Interacting with QSPI memory after XMOS boot

Post by en2senpai »

Hi,

In our project, QSPI flash memory is being shared by 2 devices:
- XMOS (which is normally booting from it and acting as USB Audio Class device)
- MCU (which is responsible for in-field upgrades and other control tasks).

An upgrade is being performed while MCU holds XMOS in reset state (to prevent any communication).
After MCU has performed an update (by writing new binary image via SPI interface), XMOS is being released from reset state and starts operating as expected.

Upgrade is being generated with xflash tool as binary file (flash loader + factory image).

So far so good, everything works fine and as expected.

And here comes the question:

Is it possible to interact with XMOS QSPI memory (i.e perform any read or write) after XMOS succesfully performs boot procedure and is running ?

What we want to achieve is to store additional data in XMOS boot memory and read them while XMOS is running factory image.

Can we be sure, that internal flash loader releases all QSPI pins and does not interact with memory after successful boot ?

I found some reference code examples for custom flash loader which is calling fl_disconnect(); function but is it included in default flash loader generated by xflash tool ?
Can default flash loader code be somewhere found and examined ?

Any advice appreciated,

Best,

Ernest


RitchRock
XCore Addict
Posts: 163
Joined: Tue Jan 17, 2017 9:25 pm

Post by RitchRock »

Yes I do with great success. On one design I do DFU upgrade on XMOS via UART comms from another IC and can also interact with QSPI to save / load parameters as needed. All done in a single QSPI interface task that clients can call. You do need to make a data partition for this.

include and take a look at what is provided in quadflash.h

Helpful material:
https://www.xmos.ai/file/an00188-using- ... ion=latest

https://www.xmos.ai/documentation/XM-01 ... flash.html

This guide is very helpful on libflash API starting on page 98. The section right before is nice also, but I believe it is a copy of the above link:
https://www.xmos.ai/download/Tools-User-Guide(6).pdf