Giter VIP home page Giter VIP logo

Comments (3)

twerpyfie avatar twerpyfie commented on June 5, 2024 1

I also see, the Debian image you used is GPT (?), while ours is MBR.

Yes its GPT.

If one does not want to flash the Raxda Debian image to only erase the SPI flash, connecting PIN 23 and 25 disables the SPI flash: MichaIng/DietPi#3292 (comment)

Then one can run this script from DietPi, to erase the SPI bootloader which allows to remove the PIN 23-25 wire again.

I recommend to use this guide: https://wiki.radxa.com/Rockpi4/dev/spi-install
at the very bottom

@twerpyfie
Could you paste the content of the rockpi4b_erase_spi_flash.sh script?
rkdeveloptool is required then as well, but maybe we can put everything together so one can use this to erase the SPI image from any currently booted system.

@MichaIng
Sure, but you don't need the rkdeveloptool for that as far as I know.

#!/bin/bash

set -eo pipefail

if [[ "$(id -u)" -ne "0" ]]; then
    echo "This script requires root."
    exit 1
fi

if ! which flash_erase &>/dev/null; then
    echo "Install mtd-utils with 'apt-get install mtd-utils'"
    exit 1
fi

echo "Doing this will overwrite data stored on SPI Flash"
echo "  and it will require that you use eMMC or SD"
echo "  as your boot device."
echo ""

while true; do
    echo "Type YES to continue or Ctrl-C to abort."
    read CONFIRM
    if [[ "$CONFIRM" == "YES" ]]; then
        break
    fi
done

if ! MTD=$(grep \"loader\" /proc/mtd | cut -d: -f1); then
    echo "loader partition on MTD is not found"
    return 1
fi

flash_erase "/dev/$MTD" 0 0

echo Done.


from dietpi-docs.

MichaIng avatar MichaIng commented on June 5, 2024

For reference: MichaIng/DietPi#3292

Most likely the SPI bootloader expects certain root/boot partition UUIDs or a certain partitioning in general (while the currently DietPi image, as based on ARMbian, comes with a single partition only), which does not match the DietPi SDcard image. I also see, the Debian image you used is GPT (?), while ours is MBR.

If one does not want to flash the Raxda Debian image to only erase the SPI flash, connecting PIN 23 and 25 disables the SPI flash: MichaIng/DietPi#3292 (comment)

Then one can run this script from DietPi, to erase the SPI bootloader which allows to remove the PIN 23-25 wire again.
@twerpyfie
Could you paste the content of the rockpi4b_erase_spi_flash.sh script?
rkdeveloptool is required then as well, but maybe we can put everything together so one can use this to erase the SPI image from any currently booted system.

from dietpi-docs.

MichaIng avatar MichaIng commented on June 5, 2024

@twerpyfie
Many thanks.

It's mtd-utils which provides the flash_erase command to clear SPI flash.

from dietpi-docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.