so I wanted to try to add a nand flash (AT45DB041b) to my raspi through SPI.
- Test SPI
- Test NandFlash
- Find a driver to embed into system and put FS on it
Code: Select all
I checked lsmod containing spi_bcm2835 (and spidev),
I verified existing /dev/spidev0.0 and /dev/spidev0.1
I downloaded spitest.c, compiled and ran it with the loopback jumper on and off the pins to verify functionality.
I made a python script with py-spidev also doing loopback tests.
2. Work start
System seems ready to continue, I connected the NAND Flash (It looks flaky, but I've tested the pins with the multimeter, everything should be okay, no shortcuts).
Write Protect (Inv), Reset (Inv) and VCC are connected to the pis 3.3V
GND is connected to the pis GND
CS (Inv) is connected to the pis CE0
SI to pis MOSI
SO to pis MISO
SCK to pis SCLK
The AT45DB041B uses SPI Mode 3 (but shall automatically recognize and switch to Mode 0) [http://www.farnell.com/datasheets/94385.pdf#page=12 page 12]
Additionally it states:
In my python script I've putDatasheet wrote:... a high-to-low transition on the CS (Inv) pin will be required to start a valid instruction
Code: Select all
spi.mode = 3 spi.max_speed_hz = 500000 # 500kHz
http://www.farnell.com/datasheets/94385.pdf#page=5 Status Register Reads states, with the opcodes 0x57 or 0xD7 I should receive Ready, Complement, 0, 1,1,1,x,x.
But there are only zeros. I also tried 0x00 0x57 0x00 (same with 0xD7) - but I do not receive anything.
Is there probably something strange with the Chip Select (because it is inverted on the nand flash)?
3. Embed the Nand into the system
If I would like to mount a filesystem on it, from what I understood, the following things need to be done:
- spidev must be disabled
- mkd must recognize the nand and bring it into the /dev/mkd* lalala
- something like ubifs must be put on the mkd in order to mount it and use it systemwide
Thank you for taking your time reading this whole story.
Thank you even more for taking your time responding to it