How to write data to the SPI flash on startKIT? Topic is solved

If you have a simple question and just want an answer.
mogren3000
Member++
Posts: 19
Joined: Tue Apr 29, 2014 8:12 am

How to write data to the SPI flash on startKIT?

Post by mogren3000 »

Hey. I have been testing the ALU the startKIT and i want to mesaure something else, so i thought that write and dump into memory. and then take some time on this.
But there is no documentation on how to use the SPI Flash on the startKIT, only for the slicekit.
So how is this done?



View Solution
User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Post by Bianco »

Try libflash:https://github.com/xcore/sw_flashlib_examplesIt essentially doesn't matter on which platform you deploy it, startKIT or SliceKIT or something else.At most you need to configure which ports to use (if the flash chip isn't hooked up at the default pins)
mogren3000
Member++
Posts: 19
Joined: Tue Apr 29, 2014 8:12 am

Post by mogren3000 »

Why does it not work.

The console is writing me this;

FLASH fitted : WINBOND W25X20.
FLASH size: 262144 bytes.
FLASH page size: 256 bytes.
FLASH data partition size: 0 bytes.
FLASH number of pages in data partition: 0
FLASH number of sectors in data partition: 0
FLASH data sector size: 0 bytes.
Data partition erased!
Could not write the data partition

Why cant it write and read from it as it supposed to do.. I have tried all the diffrent macros from SpecMacro.h and have ben setting the XCC_FLAGS in make file. to -lflash

User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Post by Bianco »

The only thing that needs to be modified is changing the target to STARTKIT in app_flashlib_example/Makefile

Code: Select all

mba:app_flashlib_example bianco$ xmakeCreating dependencies for main.xcNo modules used.Compiling main.xcCreating app_flashlib_example.xeBuild CompleteDonemba:app_flashlib_example bianco$ cd binmba:bin bianco$ xflash --boot-partition-size 65536 app_flashlib_example.xeWarning: F03098 Factory image and boot loader cannot be write-protected on flash device on node "0".Site 0 has finished.        xflash succeededmba:bin bianco$ xrun --io app_flashlib_example.xeFLASH fitted : WINBOND W25X20.FLASH size: 262144 bytes.FLASH page size: 256 bytes.FLASH data partition size: 196608 bytes.FLASH number of pages in data partition: 768FLASH number of sectors in data partition: 48FLASH data sector size: 4096 bytes.Data partition erased!Data partition written!Data partition read! Data: Hello World!FLASH tested successfully!