Flash Library available for non-boot tile?

Technical questions regarding the XTC tools and programming with XMOS.
bearcat
Respected Member
Posts: 283
Joined: Fri Mar 19, 2010 4:49 am

Flash Library available for non-boot tile?

Post by bearcat »

I need to write a flash memory from a non-boot tile. I now realize that flashlib only writes the boot tile.

Is there some source available to read / write flash in XC that I can modify to fit to save coding time?


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

Post by sethu_jangala »

Hi,

Writing to the flash memory can only be done on the tile where the flash pins are physically connected. To do otherwise you have to implement your own mechanism to get the data from the other tile to the tile that can write the flash.

Sethu.
bearcat
Respected Member
Posts: 283
Joined: Fri Mar 19, 2010 4:49 am

Post by bearcat »

Great comment. My design has multiple flash chips. Each tile has a connected flash chip to store local configuration data (not program) for that tile only. Greatly simplifies the software architecture.

I've looked at the specs for the flash chip, and it doesn't look to bad to write routines. But if the flashlib source was available I could speed up the process.
User avatar
Andy
Respected Member
Posts: 279
Joined: Fri Dec 11, 2009 1:34 pm

Post by Andy »

The flashlib source is available here:

https://github.com/xcore/sc_flash
User avatar
segher
XCore Expert
Posts: 844
Joined: Sun Jul 11, 2010 1:31 am

Post by segher »

You can have a look at http://git.infradead.org/users/segher/o ... EAD:/spi.c, maybe it can help you. Pure C code, 25Mbps, one particular flash device hardcoded (M25P IIRC). There also is a project on github that does something similar.
bearcat
Respected Member
Posts: 283
Joined: Fri Mar 19, 2010 4:49 am

Post by bearcat »

Great! Thanks all.