| FORUM

FEDEVEL
Platform forum

need help with spi-nor flash (mtd)

eugene128 , 05-15-2021, 08:36 AM
Hello. I've SPI-NOR flash connected to SPI1 on my custom board:

# cat /proc/mtd
dev: size erasesize name
mtd0: 00200000 00001000 "UBOOT"

I'm trying to write something, but seems like process has been failed:


# flash_eraseall /dev/mtd0
flash_eraseall has been replaced by `flash_erase <mtddev> 0 0`; please use it
Erasing 4 Kibyte @ 1ff000 -- 100 % complete

# echo -n "0123" > mtd_in

# mtd_debug write /dev/mtd0 0 4 mtd_in
Copied 4 bytes from mtd_in to address 0x00000000 in flash

# mtd_debug read /dev/mtd0 0 4 mtd_out
Copied 4 bytes from address 0x00000000 in flash to mtd_out

# diff mtd_in mtd_out && echo "Data are the same"
1c1
< 0123
\ No newline at end of file
---
> ▒▒▒▒
\ No newline at end of file

Does anyone have any ideas?
Thanks!








eugene128 , 05-18-2021, 05:05 AM
Ok, looks like it should be unblocked through u-boot firsly
for example: # sf probe 0:0
Use our interactive Discord forum to reply or ask new questions.
Discord invite
Discord forum link (after invitation)

Didn't find what you were looking for?