SPI Library - protocol flexibility
Posted: Mon Sep 18, 2017 9:10 pm
I'm trying to access a Micron SPI NAND Flash Memory chip via the SPI library (spi_master). The library looks like it was designed for a protocol where all messages have the same format, i.e. same command bits, address bits and dummy bits for each message. When you set up a device, that's where those variables are defined, rather than the transaction structure.
That is not the case with the Micron protocol. All messages have an 8 bit command field, but some have address fields following, others don't, some have dummy bits, some don't ....
I can handle this for the most part by setting the command bits to 8 and using the transaction length field for the rest of the bits. But there is a 4x page write where the address bits are written out on a single line, but then the page data (~2000 bytes) is written out on all 4 lines (QIO). That would be a very nice message to be able to use - it would reduce write time by a factor of 4.
Is there a good way to handle this scenario? I'm looking at re-writing the SPI driver to do what I want it to, but that's going to be a pain. Then, there's the maintenance issues. I'm looking for another option.
Thanks - Rob
That is not the case with the Micron protocol. All messages have an 8 bit command field, but some have address fields following, others don't, some have dummy bits, some don't ....
I can handle this for the most part by setting the command bits to 8 and using the transaction length field for the rest of the bits. But there is a 4x page write where the address bits are written out on a single line, but then the page data (~2000 bytes) is written out on all 4 lines (QIO). That would be a very nice message to be able to use - it would reduce write time by a factor of 4.
Is there a good way to handle this scenario? I'm looking at re-writing the SPI driver to do what I want it to, but that's going to be a pain. Then, there's the maintenance issues. I'm looking for another option.
Thanks - Rob