Problem reading data partition

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
Experienced Member
Posts: 86
Joined: Sat Aug 31, 2013 11:23 pm

Problem reading data partition

Postby genap » Fri Feb 21, 2020 5:45 pm

We have a product based on XS1-SU01A-FB96 processor using flash ic M25P40.
Project was built with xTIMEcomposer Enterprise_13.2.3

In an application I need to read data from a data partition.
With a flash chip M25P40 everything works fine.
Unfortunately due to discontinuation of M25P40 I need to use another chip.
I use Winbond W25X40, with no change anywhere except of setting Type="W25X40" in xp_skc_su1.xn.
It works fine in other projects where there is no need to read data partition.
But in this project attempt to read data partition gives me an exception.
This is what I get at debugging:

tile[0] core[0] (Suspended: Signal 'ET_LOAD_STORE' received. Description: Memory access exception.)
=fl_getBootPartitionSize() 00017910

What could be a problem and is it possible to fix it?
Will appreciate any input.

User avatar
XCore Legend
Posts: 1849
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Sat Feb 22, 2020 12:27 pm

Hi. So the above offending code runs fine with the older flash from Micron? Can you post the returned result from this library call on the working old flash?

Also you are interested in the boot partition size or rather the data partition size and base address?

Aside from using XMOS library calls, it is simple to perform standard SPI calls to fetch data from absolute addresses in the flash. Review the datasheet and locate the read flash SPI command. Post back if that is of interest and then can do some digging.


Test the method of reading from the data partiton in the flash documented inside the attached appnote. Please post your results.

NB: there is a similar article for QSPI xcore-200 CPU devices

You do not have the required permissions to view the files attached to this post.
Experienced Member
Posts: 86
Joined: Sat Aug 31, 2013 11:23 pm

Postby genap » Mon Feb 24, 2020 6:05 pm

Thank you for advice.

I am trying to avoid flash library related problems and just use spi to read data from a data partition.
I couldn't find anything related to it in either datasheet or xtime composer user manual, but I don't see any problem implementing it, since I've implemented reading data from a similar flash with a different spi port.
The one problem I can't resolve (and I tried various ways) is how to use a bootflash spi port.
SPI ports are used for both spi and audio:

Code: Select all

          <Core Number="0" Reference="tile[0]">
            <Port Location="XS1_PORT_1A" Name="PORT_SPI_MISO"/>
            <Port Location="XS1_PORT_1B" Name="PORT_SPI_SS"/>
            <Port Location="XS1_PORT_1C" Name="PORT_SPI_CLK"/>
            <Port Location="XS1_PORT_1D" Name="PORT_SPI_MOSI"/>
            <Port Location="XS1_PORT_1A" Name="PORT_I2S_ADC0"/>
            <Port Location="XS1_PORT_1B" Name="PORT_I2S_BCLK"/>
            <Port Location="XS1_PORT_1C" Name="PORT_I2S_LRCLK"/>
            <Port Location="XS1_PORT_1D" Name="PORT_I2S_DAC0"/>
Though I need to read data partition BEFORE any audio routines even start, a composer doesn't let me define spi ports.
I am trying to define spi port as

Code: Select all

fl_SPIPorts mports = {
on tile[0]: XS1_CLKBLK_1

The compiler shows the following errors

Code: Select all

- previously declared as ports.spiCLK. (though I can't find a definition)
- previously declared as ports.spiMISO.
- previously declared as ports.spiMOSI.
- previously declared as ports.spiSS.
- Symbol p_bclk is a duplicate port declaration.
- Symbol p_i2s_adc[0] is a duplicate port declaration.
- Symbol p_i2s_dac[0] is a duplicate port declaration.
- Symbol p_lrclk is a duplicate port declaration.
When I am trying to use

Code: Select all

extern fl_SPIPorts ports;
I get an error

Code: Select all

Undefined reference to 'ports'
What do I need to do to properly define and use SPI ports?
Experienced Member
Posts: 86
Joined: Sat Aug 31, 2013 11:23 pm

Postby genap » Mon Feb 24, 2020 8:59 pm

Seems like I was able to define SPI ports.
It works fine now.
And by some mysterious reason access to the data partition by flashlib now also works

mon2, thanks a lot for oyur help.

Who is online

Users browsing this forum: No registered users and 7 guests