Jump to content

Mikhail Kshevetskiy

Validating
  • Posts

    1
  • Joined

  • Last visited

  1. A lot of spi-nand flashes is supported linux kernel. It will be very helpful to add a possibility to read/write/erase such flashes using standard linux support. Unfortunately spi-nand support is not enabled in armbian linux kernel. example: recovery bootloader on the router board Orange Pi 4 configuration 1. Recompile orange pi 4 linux kernel to enable spi-nand driver (linux-5.10 or above is required). Make sure spinand, mtd and nandcore are built as modules 2. sudo armbian-config, go to “System → DTC” and replace spidev with spinand 3. install the following packages: mtd-utils 4. reboot board to apply changes Connect spi-nand chip to orange pi4 board Testpoint Meaning Where to connect 3.3V 3.3V power supply pin 17 of orange pi 4 connector DI SPI Data In pin 19 of orange pi 4 connector DO SPI Data Out pin 21 of orange pi 4 connector CLK SPI Clock pin 23 of orange pi 4 connector GND Ground pin 25 of orange pi 4connector CS# SPI Chip Select pin 24 of orange pi 4 connector WP# Write Protect short with HOLD# and 3.3V testpoints HOLD# Hold short with WP# and 3.3V testpoints restart spinand and mtd modules rmmod ofpart spinand mtd nandcore modprobe spinand modprobe mtd make sure the flash was detected dmesg | tail -n 6 [ 237.055291] spi-nand: probe of spi0.0 failed with error -524 [ 383.913569] spi-id: 00, ef, aa, 21 [ 383.913729] spi-id: ef, aa, 21, 00 [ 383.913878] spi-id: ef, aa, 21, 00 [ 383.913936] spi-nand spi0.0: Winbond SPI NAND was found. [ 383.913965] spi-nand spi0.0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64 Recovering bootloader Add partitions of your choice using mtdpart add /dev/mtd0 <PART_NAME> Erase & flash partition flash_erase /dev/mtd 0 0 nandwrite /dev/mtd image_file Disconnect flash from orange pi board and test it
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines