In-Circuit Programming of SPI NOR Flash
#11
Hi,

I do not think there is any reason to use external hardware for flashing. The SPI flash can simply be written from within the OS (or even u-boot). By default (I think even on the stock Debian?) the whole flash is exposed via
Code:
/dev/mtd0
. You can simply (and safely) write to the flash using the
Code:
flashcp
command from
Code:
mtd-utils
by running
Code:
flashcp <filename> /dev/mtd0
.

Even if you need to recover from a defective bootloader written to the SPI flash, you can simply short pin 6 of the SPI flash to GND and boot. This will render the bootrom unable to read from the SPI flash and have it fall back to reading the bootloader from other boot media like the micro SD card or eMMC.

The procedures described above are a lot less risky than attaching an external SPI flasher and do not require any additional hardware.
Manjaro ARM

Kernel dev
Buy me a coffee
  Reply
#12
(04-18-2020, 10:43 AM)tsys Wrote: Hi,

I do not think there is any reason to use external hardware for flashing. The SPI flash can simply be written from within the OS (or even u-boot). 

Even if you need to recover from a defective bootloader written to the SPI flash, you can simply short pin 6 of the SPI flash to GND and boot. This will render the bootrom unable to read from the SPI flash and have it fall back to reading the bootloader from other boot media like the micro SD card or eMMC.

The procedures described above are a lot less risky than attaching an external SPI flasher and do not require any additional hardware.

Hello @tsys,

Hope you are well, and I apologize for the delayed response!

I agree, the methods you describe do not require additional hardware. But there is no more risk in attaching a Pomona clip with wiring, than shorting pins manually.

You have however given me a great pointer to an easier process to start with which is using u-boot (from a micro SD card) to flash the SPI. So I am going to investigate that, as it is easier to insert a micro SD card, than taking the PBP apart.

Just a note, the old stock Debian did not contain a /dev/mtd0 device.

I have just converted all my other ARM(HF|64) devices to stock Debian and am now tackling the Pinebook Pro. I was excited to actually be able to use the net installer on the ARM64 device, I had to create images for the ARMHF devices. I know you are a Manjaro Dev, your distribution is doing great things. I just adopted Debian years ago and stuck with it.
  Reply
#13
Can you not just read and write to /dev/mtd0 like any other device?
  Reply
#14
(04-18-2020, 10:43 AM)tsys Wrote: Hi,

I do not think there is any reason to use external hardware for flashing. The SPI flash can simply be written from within the OS (or even u-boot).

Thanks for the tip @tsys  =)

I am still learning embedded computing and am a u-boot novice. But I have learned the minimum required to get started. So far I have  a tiny image I have created which uses the master u-boot sources (includes your work). When burned to micro SD card, u-boot loads as expected and I am able to probe the spi flash successfully.

Looking forward to building and flashing u-boot to spi next. Have to do a little more homework first.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Extracting a copy of SPI NOR flash contents using micro SD card and u-boot hmuller 0 514 09-21-2020, 11:24 AM
Last Post: hmuller
  Program SPI NOR Flash on Pinebook Pro with u-boot on micro SD Card hmuller 0 669 09-21-2020, 10:02 AM
Last Post: hmuller
Exclamation Flash dhivael's SPI uboot (risky) clover 51 16,750 06-20-2020, 03:24 PM
Last Post: craftkiller
  Widevine-flash on Chromium-SD Card mamboman777 3 1,866 01-20-2020, 04:00 PM
Last Post: tophneal

Forum Jump:


Users browsing this thread: 1 Guest(s)