pcm720 / u-boot-build-scripts

A script that may come in handy when building U-Boot images for Pinebook Pro
20 stars 5 forks source link

Unable to use dd to write spiflash.bin #2

Closed elijahr closed 4 years ago

elijahr commented 4 years ago

I'm using Manjaro, kernel 5.8.6-1-MANJARO-ARM. Following the below instructions copied from https://github.com/pcm720/u-boot-build-scripts/releases/tag/v2020.07-1:

Writing to SPI Flash (Manjaro):
# flash_erase /dev/mtd0 0 0
# dd if=spiflash.bin of=/dev/mtd0

I get:

$ sudo flash_erase /dev/mtd0 0 0
Erasing 4 Kibyte @ fff000 -- 100 % complete
$ sudo dd if=spiflash.bin of=/dev/mtd0
dd: writing to '/dev/mtd0': Connection timed out
1+0 records in
0+0 records out
0 bytes copied, 0.202538 s, 0.0 kB/s

Not sure why it didn't work for me. Instead, I used (after flash_erase):

sudo nandwrite -p /dev/mtd0 spiflash.bin

And that seemed to work. Is there a reason to use dd instead of nandwrite?

pcm720 commented 4 years ago

dd works for me, that's why I use it to flash the SPI Flash. You can use whatever works best for you, these are simply recommendations based on my own experience.

Thanks for mentioning nandwrite, I've added it to recommendations.