This is the pinout I have for the flash memory W25Q128FV which I'm trying to interact with
I'm trying to control it with a raspberry pi 3 B+.
Here's how I wired everything:
CS - GND
D0 - SPIMISO
WP - nothing
GND - GND
VCC - 3.3v
HOLD - nothing
CLK - SPISCLK
DI - SPIMOSI
CS is in GND because datasheet says that in LOW, we can write/read from the chip.
I also enabled spi on raspberry and I'm using the library wiringPi with channel 0.
I'm writing like this:
wiringPiSPISetup(0, 2000000)
wiringPiSPIDataRW(0, data, 4)
but I get no changes in data
. I suspect something is wrong but I don't know if it's on the chip, on the wiring or on the software. This is a brand new chip by the way.
What are the raspberry pins SPICS0
and SPICS1
for?
I'm trying to read the manufacturer id, here are the instructions:
here's what I did:
data[0] = 0x90;
data[3] = 0x00;
data[4] = 0xEF;
data[5] = 0x17;
I don't know what those MF7-MF0
and ID7-ID0
are but I substituted them by some numbers I found on the datasheet
datasheet link: http://www.xmcwh.com/Uploads/2020-09-03/5f50d26953af2.pdf
Here's my Rust code with everything ready to test and dockerized, just ./run.sh
, compile the Wiringpi/wiringpi with ./build
and cargo run
in w25qxx_spi
: https://github.com/lucaszanella/w25qxx_spi/blob/68a7f993a6572e177d9b4d60a7cfac02ccb016ff/w25qxx_spi/src/w25q.rs
If you help me you're helping open source, I'm interfacing with wiringpi in Rust and creating a library to read from W25Q spi flash memory.
Pins information: