2

So I hooked up an Winbond 25Q256JVEQ to my Raspi3 via SPI (spi0.0) and want to read its content. I use the jedec-nor-spi dtoverlay so its available as MTD.

However when I want to read the chips memory with e.g. sudo hexdump -C /dev/mtd0 I receive very unexpected and different results:

For every read I do, the first bytes are always 0x00. I know the content of the chip and 02 00 10 00 should be at the very beginning.

pi@raspberrypi:~ $ sudo hexdump -C /dev/mtd0
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00005000  02 00 10 00 00 00 00 f8  02 00 10 00 00 00 00 f6  |................|
00005010  02 00 10 00 00 00 00 f4  02 00 10 00 00 00 00 f2  |................|

When I do the exact same read operation again, the data starts at a different offset:

pi@raspberrypi:~ $ sudo hexdump -C /dev/mtd0
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00003000  03 00 10 00 00 00 00 00  03 00 10 00 00 00 00 fe  |................|
00003010  02 00 10 00 00 00 00 fc  02 00 10 00 00 00 00 fa  |................|

and again, another time:

sudo hexdump -C /dev/mtd0
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00006000  03 00 10 00 00 00 00 00  03 00 10 00 00 00 00 fe  |................|
00006010  02 00 10 00 00 00 00 fc  02 00 10 00 00 00 00 fa  |................|

I observed this offset to fluctuate around 0x2000 and 0x6000. I already tried another 25Q256JVEQ but the behavior is the same.

Am I missing something? The chip supports a clock of up to 133MHz while the Raspi-Overlay is far below that. I also can't write to it or erase it using my Pi.

  • To write or erase, there should be /dev/mtdblockX. There are also tools specially made for mtd device (mtdwrite or mtd_write). The offset is odd and possibly suggests some timing issue. – domen Jun 6 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.