"Fast" SPI flash cache driver
David Betz
Posts: 14,516
I've just pushed a revision of the spi_flash_cache driver, the one that is configurable for boards using a SPI flash chip. This is the driver that is used by the DNA board configuration as well as the new PKS board configuration for Rayman's Propeller Keychain System. It can also be used by the C3 or any board that has a SPI flash chip on it.
The revision makes use of the very clever counter-based code that Jonathan "lonesock" Dummer wrote for FSRW. To use this version of the driver instead of the original slower SPI code you just need to change one line in your board configuration file.
If you're using a board with an Atmel or Winbond SPI flash chip
Change this:
If you're using a board with an SST flash chip
Change this:
The revision makes use of the very clever counter-based code that Jonathan "lonesock" Dummer wrote for FSRW. To use this version of the driver instead of the original slower SPI code you just need to change one line in your board configuration file.
If you're using a board with an Atmel or Winbond SPI flash chip
Change this:
cache-driver: spi_flash_cache.datTo this:
cache-driver: fast_spi_flash_cache.dat
If you're using a board with an SST flash chip
Change this:
cache-driver: sst_spi_flash_cache.datTo this:
cache-driver: fast_sst_spi_flash_cache.datNone of the standard configuration files make use of this driver currently since it is new and relatively untested.
Comments
10mbps read/write or 20mbps write / 10mbps read?
Bill,
Did you ever get a chance to try the PropGCC cache drivers with any of your boards that support SPI flash? There is support for the SPI addressing mux you described to me once but I've never been able to verify that it works.
Thanks,
David
I have a lot of boards to try it on...
Recently I have been building the tools on ARM processor boards, Raspi and IGEP, and I copy the .dat and .binary files over from a build on my PC. That gets old when there updates comming. Ultimately those files need to be created by an open source tool to keep things building nicely on non-Intel platforms.
I guess the spin2cpp release notice got buried somewhere in the traffic on the forums, but yes, it can do that: will produce foo.S, a GAS syntax version of the DAT section; or, you can embed the GAS version of the DAT section into the output .cpp or .c file by just saying --gas (without the --dat).
It's still pretty experimental, so it may not work for all cases.
Thanks,
David
Edit: I forgot to mention that this FAST mode is working fine with SST SPI flash chips so I believe the send/recv byte functions work.
Are these the same as the binary data you get when doing Spin2Cpp on the PASM part of a Spin program?
I ordered some but haven't had time to play yet. Did you have something special in mind?
The SpinSocket boards have 2 QSPI footprints (P0..7) so there are lots of opportunities there.
I'd like to try making a fast 256KB VGA buffer with 2 chips ... some day.
http://gadgeteer.codeplex.com/wikipage?title=.NET%20Gadgeteer%20Socket%20Types
Or... you could use a "S" SPI header and a "Y" GPIO header and that would give you 8 bits.
The gadgeteer socket system gives you lots of flexibility and you can reconfigure the hardware quickly.
I'll probably just stick with a standard SPI port for the moment. Good to hear these chips do exist and you can get samples. That makes it worth making a board.
1) it is using a 10 way gadgeteer header which makes mixing and matching peripherals a lot easier and
2) The pinouts for the 32k, 64k and 128k chips are all the same so once the chips become more widely available it is very easy to upgrade ram.
You could probably add a footprint to your board just as easily.
These give a bit of an idea what I'm trying to do, and it ties in with this thread with fast SPI.
These are all experimental boards but you can see the sorts of prices BatchPCB charges and it is possible to put those on the BatchPCB marketplace so others can use them. But I'd prefer to test them first! (almost sent off one board with the keyboard socket the wrong way round for instance).
The motherboard is a propeller with a bunch of sockets with pins in groups of 7, and other sockets in groups of 4 (for SD and SPI) and also groups of 2. So lots of flexibility to plug things together in different ways.
I added a screenshot of the Gadgeteer system for C#. You have pictures of boards on the screen, plug them together and then it writes the skeleton code in C. So if you add an SD card, it adds the SD driver with the correct pins already in code. Not hugely complicated and it greatly simplifies building things. If you add a ram board, it knows how much ram you have and can give a warning if almost full. Ditto if you plug boards in that use the same propeller pins.
Behind the scenes, what I want is a touchscreen and external ram and an SD card running off one propeller. I think I can do this as the touchscreen uses 14 pins, the SD card 4, the touch SPI 4, the external ram 4, and there are 2 spare for audio or a serial board, and there is also the I2C bus. But what I also want to do is quickly change it so it runs with a TV. Or a VGA screen etc.
So the idea to run up the flagpole is to ask whether SimpleIDE could incorporate pictures of boards with little wires joining them, and behind the scenes, add the appropriate #include files and put in the correct pin numbers?