[File] [PATCH] Magdir/firmware RP2040 firmware

Christos Zoulas christos at zoulas.com
Sat Jun 29 15:43:10 UTC 2024


Committed, thanks!

christos

> On Jun 28, 2024, at 6:09 AM, Alexandre IOOSS <erdnaxe at crans.org> wrote:
> 
> Hello,
> 
> I noticed a few days ago that file does not recognized Raspberry Pi Pico flash dumps. This board uses a RP2040 chip. This chip is ARM Cortex-M0+ and has a vector table, but required a prepended second stage bootloader.
> 
> PicoSDK also adds some binary info after the vector table. This enables `picotool` tool to extract some information about the firmware. However, not all firmware seems to include this structure.
> 
> Attached, you will find a patch that enables file to recognized RP2040 firmware dumps.
> 
> I tested the patch using some samples from MicroPython, Meshtastic and some simpler firmware:
> ```
> firmware-pico-2.3.13.83f5ba0.bin:  Raspberry Pi RP2040 firmware, initial SP at 0x20042000, reset at 0x100001e2, NMI at 0x100001c2, HardFault at 0x100001c4, SVCall at 0x100001c6, PendSV at 0x100001c8
> firmware-picow-2.3.13.83f5ba0.bin: Raspberry Pi RP2040 firmware, initial SP at 0x20042000, reset at 0x100001e2, NMI at 0x100001c2, HardFault at 0x100001c4, SVCall at 0x100001c6, PendSV at 0x100001c8
> flag.bin:                          Raspberry Pi RP2040 firmware, initial SP at 0x20042000, reset at 0x100001f6, NMI at 0x100001c2, HardFault at 0x100001c4, SVCall at 0x100001c6, PendSV at 0x100001c8, with binary_info
> glitch_detect.bin:                 Raspberry Pi RP2040 firmware, initial SP at 0x20042000, reset at 0x100001f6, NMI at 0x100001c2, HardFault at 0x100001c4, SVCall at 0x100001c6, PendSV at 0x100001c8, with binary_info
> hello.bin:                         Raspberry Pi RP2040 firmware, initial SP at 0x20042000, reset at 0x100001f6, NMI at 0x100001c2, HardFault at 0x100001c4, SVCall at 0x100001c6, PendSV at 0x100001c8, with binary_info
> RPI_PICO-20210202-v1.14.bin:       Raspberry Pi RP2040 firmware, initial SP at 0x20042000, reset at 0x100001f6, NMI at 0x100001c2, HardFault at 0x100001c4, SVCall at 0x100001c6, PendSV at 0x100001c8, with binary_info
> RPI_PICO-20210418-v1.15.bin:       Raspberry Pi RP2040 firmware, initial SP at 0x20042000, reset at 0x100001f6, NMI at 0x100001c2, HardFault at 0x100001c4, SVCall at 0x100001c6, PendSV at 0x100001c8, with binary_info
> RPI_PICO-20230426-v1.20.0.bin:     Raspberry Pi RP2040 firmware, initial SP at 0x20042000, reset at 0x100001f6, NMI at 0x100001c2, HardFault at 0x100001c4, SVCall at 0x100001c6, PendSV at 0x10029fcc, with binary_info
> RPI_PICO-20240602-v1.23.0.bin:     Raspberry Pi RP2040 firmware, initial SP at 0x20042000, reset at 0x100001f6, NMI at 0x100001c2, HardFault at 0x100001c4, SVCall at 0x100001c6, PendSV at 0x1002b854, with binary_info
> ```
> 
> Thanks a lot,
> Best regards,
> -- 
> Alexandre<rp2040_diff.DEFANGED-6>-- 
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file
> <sanitizer.log>



More information about the File mailing list