1 2#------------------------------------------------------------------------------ 3# $File: uf2,v 1.6 2024/09/04 19:08:08 christos Exp $ 4# uf2: file(1) magic for UF2 firmware image files 5# 6# https://github.com/microsoft/uf2 7# 8# Created by Blake Ramsdell <blaker@gmail.com> 9 100 string UF2\n UF2 firmware image 11!:ext uf2 12# This is for checking the other magic numbers, do we want to do that? 13#>4 lelong 0x9E5D5157 howdy 14#>>508 lelong 0x0AB16F30 doody 15>8 lelong &0x0001 \b, not main flash 16>8 lelong &0x1000 \b, file container 17>8 lelong &0x2000 \b, family 18 19# To update the UF2 family data, use this fine command 20# 21# families=`curl \ 22# https://raw.githubusercontent.com/microsoft/uf2/master/utils/uf2families.json \ 23# | jq -r '.[] | ">>28\tlelong\t\(.id)\t\(.description)"' | sort -n -k 3` && \ 24# perl -0777 -i -pe \ 25# "s/(### BEGIN UF2 FAMILIES\\n).*(\\n### END UF2 FAMILIES)/\$1$families\$2/s" \ 26# uf2 27 28### BEGIN UF2 FAMILIES 29>>28 lelong 0x00ff6919 ST STM32L4xx 30>>28 lelong 0x04240bdf ST STM32L5xx 31>>28 lelong 0x06d1097b ST STM32F411xC 32>>28 lelong 0x11de784a M0SENSE BL702 33>>28 lelong 0x16573617 Microchip (Atmel) ATmega32 34>>28 lelong 0x1851780a Microchip (Atmel) SAML21 35>>28 lelong 0x1b57745f Nordic NRF52 36>>28 lelong 0x1c5f21b0 ESP32 37>>28 lelong 0x1e1f432d ST STM32L1xx 38>>28 lelong 0x202e3a91 ST STM32L0xx 39>>28 lelong 0x21460ff0 ST STM32WLxx 40>>28 lelong 0x22e0d6fc Realtek AmebaZ RTL8710B 41>>28 lelong 0x2abc77ec NXP LPC55xx 42>>28 lelong 0x2b88d29c ESP32-C2 43>>28 lelong 0x2dc309c5 ST STM32F411xE 44>>28 lelong 0x300f5633 ST STM32G0xx 45>>28 lelong 0x31d228c6 GD32F350 46>>28 lelong 0x332726f6 ESP32-H2 47>>28 lelong 0x3379CFE2 Realtek AmebaD RTL8720D 48>>28 lelong 0x3d308e94 ESP32-P4 49>>28 lelong 0x4b684d71 Sipeed MaixPlay-U4 (BL618) 50>>28 lelong 0x4c71240a ST STM32G4xx 51>>28 lelong 0x4f6ace52 LISTENAI CSK300x/400x 52>>28 lelong 0x4fb2d5bd NXP i.MX RT10XX 53>>28 lelong 0x51e903a8 Xradiotech 809 54>>28 lelong 0x53b80f00 ST STM32F7xx 55>>28 lelong 0x540ddf62 ESP32-C6 56>>28 lelong 0x55114460 Microchip (Atmel) SAMD51 57>>28 lelong 0x57755a57 ST STM32F4xx 58>>28 lelong 0x5a18069b Cypress FX2 59>>28 lelong 0x5d1a0a2e ST STM32F2xx 60>>28 lelong 0x5ee21072 ST STM32F103 61>>28 lelong 0x621e937a Nordic NRF52833 62>>28 lelong 0x647824b6 ST STM32F0xx 63>>28 lelong 0x675a40b0 Beken 7231U/7231T 64>>28 lelong 0x68ed2b88 Microchip (Atmel) SAMD21 65>>28 lelong 0x699b62ec WCH CH32V2xx and CH32V3xx 66>>28 lelong 0x6a82cc42 Beken 7251/7252 67>>28 lelong 0x6b846188 ST STM32F3xx 68>>28 lelong 0x6d0922fa ST STM32F407 69>>28 lelong 0x6db66082 ST STM32H7xx 70>>28 lelong 0x6e7348a8 LISTENAI CSK60xx 71>>28 lelong 0x6f752678 Nordic NRF52832xxAB 72>>28 lelong 0x70d16653 ST STM32WBxx 73>>28 lelong 0x72721d4e Nordic NRF52832xxAA 74>>28 lelong 0x77d850c4 ESP32-C61 75>>28 lelong 0x7b3ef230 Beken 7231N 76>>28 lelong 0x7be8976d Renesas RA4M1 77>>28 lelong 0x7eab61ed ESP8266 78>>28 lelong 0x7f83e793 NXP KL32L2x 79>>28 lelong 0x8fb060fe ST STM32F407VG 80>>28 lelong 0x9517422f Renesas RZ/A1LU (R7S7210xx) 81>>28 lelong 0x9af03e33 GigaDevice GD32VF103 82>>28 lelong 0x9fffd543 Realtek Ameba1 RTL8710A 83>>28 lelong 0xa0c97b8e ArteryTek AT32F415 84>>28 lelong 0xada52840 Nordic NRF52840 85>>28 lelong 0xbfdd4eee ESP32-S2 86>>28 lelong 0xc47e5767 ESP32-S3 87>>28 lelong 0xd42ba06c ESP32-C3 88>>28 lelong 0xde1270b7 Boufallo 602 89>>28 lelong 0xe08f7564 Realtek AmebaZ2 RTL8720C 90>>28 lelong 0xe48bff56 Raspberry Pi RP2040 91>>28 lelong 0xe48bff57 Raspberry Pi MC: Absolute (unpartitioned) download 92>>28 lelong 0xe48bff58 Raspberry Pi MC: Data partition download 93>>28 lelong 0xe48bff59 Raspberry Pi RP2350, Secure Arm image 94>>28 lelong 0xe48bff5a Raspberry Pi RP2350, RISC-V image 95>>28 lelong 0xe48bff5b Raspberry Pi RP2350, Non-secure Arm image 96>>28 lelong 0xf71c0343 ESP32-C5 97### END UF2 FAMILIES 98 99>>28 default x 100>>>28 lelong x %#08x 101>8 lelong&0x2000 0 \b, file size 102>>28 lelong x %#08x 103>8 lelong &0x4000 \b, MD5 checksum present 104>8 lelong &0x8000 \b, extension tags present 105>12 lelong x \b, base address %#08x 106>24 lelong x \b, %u total blocks 107