Flash programing problem

If you have a simple question and just want an answer.
Leif
Junior Member
Posts: 6
Joined: Tue May 06, 2014 12:22 pm

Flash programing problem

Post by Leif »

I have designed and assembled custom board using XS1-L8A-TQ128-I4 processor. I can program and run simple test programs using XTAG-2 card. For some reason I do not manage to program external Flash memory attached to the device. The design is quite similar to the XK-1A development kit. MODE2 and MODE3 pins are attached to xSYS header as in reference. I take power from XTAG-2. Flash is attached to X0D00 (MISO), X0D01(CS), X0D10 (SCLK) and X0D11 (MOSI). I use XTimeComposer Community 13.0.2 in a Windows machine.There was problem the get AT25FS010N-SH27 chip that was used in XK-1A. I chose M25PE10 chip (digikey: M25PE10-VMN6P-ND) but had no success using that. After that, I removed one flash from startkit (Winbond 25X20CL) and had no success trying it. Then I ordered EPCS1SIBN flash (Farnell code 1453504). No success. According to list at:https://www.xmos.com/list-flash-devices ... cu...these memories should be supported "natively".I have modified .XN file to change memory type in lineand also defined the SPI interface. When I start flashing, there is warning F03098 about lack of write-protection. After there is no text and the process never ends.I have spent now few days and have not much hint about what goes wrong.br,\leif
You do not have the required permissions to view the files attached to this post.


User avatar
sethu_jangala
XCore Expert
Posts: 589
Joined: Wed Feb 29, 2012 10:03 am

Post by sethu_jangala »

The flash device on startKIT is "S25FL204K". Changing the XN file as shown below should work,

 <Device NodeId="0" Tile="0" Class="SPIFlash" Name="bootFlash" Type="S25FL204K">

  
Leif
Junior Member
Posts: 6
Joined: Tue May 06, 2014 12:22 pm

Post by Leif »

I managed to run SPI_master_demo.xc example file and it runs when I made the change:

fl_DeviceSpec flash = FL_DEVICE_NUMONYX_M25P10;

to get correct flash ID.

Running in SPI mode 3
with SPI frequency 25MHz
expected flash ID: 202011
returned flash ID: 202011
Flash ID data returned from slave received correctly
Write speed test... Time taken: 114790ns, for 256 bytes: 2.11MB/s
Read speed test... Time taken: 23554090ns, for 51200 bytes: 2.06MB/s

So it seems that there is connection to the flash. I changed .xe file to have

<Device NodeId="0" Core="0" Class="SPIFlash" Name="bootFlash" Type="M25P10">

But running the flash command never ends, as before. And no prints after:

Warning: F03098 Factory image and boot loader cannot be write-protected on flash device on node "0".

Leif
Junior Member
Posts: 6
Joined: Tue May 06, 2014 12:22 pm

Post by Leif »

I ordered AT25DF041A from mouser (556-AT25DF041A-SHF-B) and installed the chip to the board. This chip is end of life... I did not manage to program via xflash the device directly. I ran tests with spi_master_demo, and managed to read flash id, but reading in further test did not work, I just got FFFF..

In the next step I created a file named AT25DF041A.con (attached as .txt file) for flash definitions copied actually from SpecMacros.h FL_DEVICE_ATMEL_AT25DF041A definions. In flash configurations I set:

SPI spec file: ...\AT25DF041A.con

Boot partition size: 262144

Other Flash options: --noinq

I finally got:


Warning: F03086 Using default SPI clock divider (value 3; divide by 6).
Warning: F03102 Cannot check boot partition size for sector alignment.
Warning: F03102 The boot partition should contain a whole number of sectors
Warning: F03102 but this cannot be checked when the inquirer is disabled.
Warning: F03097 Cannot check factory image protection because --noinq was specified.

Site 0 has started.         
Site 0 has type 002.        
Site 0 write    0x00000000.
Site 0 verified 0x00000000.

...

Site 0 write    0x0000a800.
Site 0 verified 0x0000a800.
Site 0 has finished.        
xflash succeeded

First the card did not boot because 1V supply went on before 3.3V. Both are driven from same 5 V regulator that turns on slow. So there I need to make some changes. I put switch for 1V supply and ... the leds started to blink from flash program and even external USB-UART chip talked with computer side python script ! So the flash programming did work and program was loaded from flash in the startup.

As a moral, one should reserve some week or two for making the flash programming work in XMOS.

 
You do not have the required permissions to view the files attached to this post.