FAILED (remote: 'locked device') when attempting to erase boot loaders

Hello All,

I am attempting to wipe my eMMc on my RockPi Zero, however I keep getting the following when running any of the erase-bootloader commands.

Erasing ‘bootloader’ FAILED (remote: ‘locked device’)
fastboot: error: Command failed

Please note I am running Manjaro 21.x so the suggestion that I install libmraa to support the python script doesn’t seem to be an option as it doesn’t seem to exist on Manjaro.

echo 0 > /sys/block/mmcblk1boot1/force_ro
echo 0 > /sys/block/mmcblk1boot0/force_ro

^ This will “unlock” the protected boot devices to erase them (allowing alternative u-boot to be used).

@chewitt What then can I upload to these two? Is it worth for everyday use (Rock Pi works without it)?

The protected boot blocks are 4MB in size and are used for boot firmware. The blocks can be set into read-only mode to protect the boot firmware from being erased by users that don’t know what they are doing. So you can wipe them or replace the boot firmware in them with your own creation, but that’s all they are used for. If you wipe them then you will need boot firmware on the main eMMC device (or SD card, or USB) else the board has no boot firmware and will not boot. I’m not sure if that helps? - Your question makes no sense to me in the context of the original post.

1 Like

Yes, that helps. Thanks for the info!

I am curious how Rock Pi checks if there is any code in these two boot devices and what are the reasons to assume that there is no boot code in them (for example if there are only NUL bytes).

In the Radxa Zero (the subforum you are posting in) the Amlogic SoC has a hard-coded (in silicon) check for a magic boot header at a specifc offset and it knows how to check for that on eMMC, then SD, then USB. I have no specific knowledge of what the Rock Pi does (don’t have one so no interest in it) but while the specifics will be different on a Rockchip board, most ARM SoC devices do something similar.

1 Like

@chewitt thank you for your reply. I think I should have been a little clearer, it’s my desktop running Manjaro, not the RockPi Zero. I managed to get beyond the error by passing off my USB controller to a windows VM and was able to use the windows app to erase my zero then use DD to rewrite from linux.

I take it the commands you’re recommending need to run from a shell on the device itself, is my assumption correct?

Yes, from an SSH console/. This is the Radxa Zero forum area.

Hi, @Tarick_Karkache

wget https://dl.radxa.com/zero/images/loader/factory-loader.img
boot-g12.py factory-loader.img 

fastboot flashing unlock_critical
fastboot flashing unlock
fastboot erase bootloader
fastboot erase bootloader-boot0
fastboot erase bootloader-boot1

Which step you have the FAILED(remote: ‘locked device’) error?

Hi Jack, not the OP, but in my case, I’ve never been able to execute the last three commands in your quoted text:

fastboot erase bootloader
fastboot erase bootloader-boot0
fastboot erase bootloader-boot1

When I run these commands I always get the “remote: ‘locked device’” message. So I always use windows to erase the eMMC chips on my RxZero boards.

I get the remote: locked device on all three fastboot erase commands

fastboot erase bootloader
fastboot erase bootloader-boot0
fastboot erase bootloader-boot1

The only way I can erase the device is via a Windows VM by passing through the associated USB controller, but I can’t write back via Windows, but once I erase via Windows I can write via Linux. TBH, i think it will just be simpler to no use the eMMC and keep it blank and boot from an SD.

I see on the web page that there are some u-boot files for Rock Pi 4B. Does make sense to write them to boot partitions? (I have eMMC and everything is working fine, would that help to boot from USB?)