using libflash and lib_spi with mutliple devices on SPI bus Topic is solved

If you have a simple question and just want an answer.
DemoniacMilk
XCore Addict
Posts: 191
Joined: Tue Jul 05, 2016 2:19 pm

using libflash and lib_spi with mutliple devices on SPI bus

Post by DemoniacMilk »

Our hardware setup has three devices connected to one SPI bus: Flash, DSP, FPGA. DSP/FPGA are configured as SPI slaves and will be booted/configured by the xmos chip, based on data stored in flash (alternating flash-reads and DSP/FPGA writes). DSP/FPGA never access the flash directly.

The libflash library has all I need for using the flash device (store, read, erase, image handling, ..), but doesnt provide access to the SPI interface itsself (correct?)

The two possible options I see are:
  1. dont use libflash and do everything manually
  2. put the flash on an additional SPI bus, use libflash for flash communication and lib_spi for DSP/FPGA communication
I'd go with option 2, as I have the pins available. Just wanted to make sure: The libflash library is used for communicating with flashs ONLY and does not support any additional SPI communication? Also, I cannot use libflash and lib_spi with the same pins, as that will vilate parallel usage regulations?
View Solution
colin
Experienced Member
Posts: 74
Joined: Mon Dec 16, 2013 12:14 pm

Post by colin »

Hi DemoniacMilk,

You are correct that libflash does not provide an API for direct access to the SPI interface, you will need to use lib_spi for this. Also libflash is used purely for the communication with flash devices that are listed as supported here https://www.xmos.com/support/tools/docu ... nent=14585. You can add support for other flash devices as described in this document https://www.xmos.com/support/tools/docu ... nent=14627.

You are correct that you cannot use libflash and lib_spi on the same ports as you will violate parallel usage results (at least it certainly wont be easy). Much easier to keep the bus separate.

Colin