Snagboot is an open-source cross-vendor recovery tool for embedded targets

Bootlin has just released the Snagboot open-source recovery tool for embedded platforms designed to work with multiple vendors, and currently STMicro STM32MP1, Microchip SAMA5, NXP i.MX6/7/8, Texas Instruments AM335x and AM62x, and Allwinner “sunxi” processors are supported.

Silicon vendors usually provide firmware flashing tools, some closed-source binaries, that only work with their hardware. So if you work on STM32MP1 you’d use STM32CubeProgrammer, while SAM-BA is the tool for Microchip processors, NXP i.MX SoC relies on UUU, and if you’ve ever worked on Allwinner processors you’re probably family with sunxi-fel. Bootlin aims to replace all those with the Snagboot recovery tool.

snagboot

The Python tool is comprised of two parts:

  • snagrecover using vendor-specific ROM code mechanisms to initialize external RAM and run the bootloader (typically U-Boot) without modifying any non-volatile memories.
  • snagflash communicates with the bootloader over USB to flash system images to non-volatile memories, using either DFU, USB Mass Storage, or fastboot.

You’ll find the source code on GitHub, but if you just want to install snagboot, you can do so with pip:


You’ll also need to add udev rules so that snagrecover has read and write access to the USB devices to the target SoCs:


snagrecover usage:


You can get a long list of supported SoCs using the command:


snagflash usage:


Bootlin welcomes contributions to add support for more targets.

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX RK3588 mini-ITX motherboard
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
4 Comments
oldest
newest
Willy
1 year ago

Interesting. I unbricked a few marvell boards in the past by uploading u-boot over the serial port to the RAM and using it to first boot the OS, then did it again to write it to the flash. I’m sure they’ll easily support it.

Thomas Petazzoni
Thomas Petazzoni
1 year ago

snagboot already supports recovering TI AM335x over UART, so it should indeed not be too complicated to support the UART-based recovery of Marvell EBU platforms. Supporting Marvell platforms was on our list of possible platforms to support, but we couldn’t support them all 🙂

Widi
Widi
1 year ago

How about amlogic, is that supported to

Thomas Petazzoni
Thomas Petazzoni
1 year ago

Amlogic is not supported right now, so you are welcome to help on that. On LinkedIn, at https://www.linkedin.com/feed/update/urn:li:activity:7066793783866060800?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7066793783866060800%2C7067405444863938560%29, Neil Armstrong (Linux kernel maintainer of the Amlogic support) has expressed interest.

Khadas VIM4 SBC