uf2 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #------------------------------------------------------------------------------
  2. # $File: uf2,v 1.3 2021/04/28 01:00:31 christos Exp $
  3. # uf2: file(1) magic for UF2 firmware image files
  4. #
  5. # https://github.com/microsoft/uf2
  6. #
  7. # Created by Blake Ramsdell <blaker@gmail.com>
  8. 0 string UF2\n UF2 firmware image
  9. !:ext uf2
  10. # This is for checking the other magic numbers, do we want to do that?
  11. #>4 lelong 0x9E5D5157 howdy
  12. #>>508 lelong 0x0AB16F30 doody
  13. >8 lelong &0x0001 \b, not main flash
  14. >8 lelong &0x1000 \b, file container
  15. >8 lelong &0x2000 \b, family
  16. # To update the UF2 family data, use this fine command
  17. #
  18. # families=`curl \
  19. # https://raw.githubusercontent.com/microsoft/uf2/master/utils/uf2families.json \
  20. # | jq -r '.[] | ">>28\tlelong\t\(.id)\t\(.description)"' | sort -n -k 3` && \
  21. # perl -0777 -i -pe \
  22. # "s/(### BEGIN UF2 FAMILIES\\n).*(\\n### END UF2 FAMILIES)/\$1$families\$2/s" \
  23. # uf2
  24. ### BEGIN UF2 FAMILIES
  25. >>28 lelong 0x00ff6919 ST STM32L4xx
  26. >>28 lelong 0x04240bdf ST STM32L5xx
  27. >>28 lelong 0x16573617 Microchip (Atmel) ATmega32
  28. >>28 lelong 0x1851780a Microchip (Atmel) SAML21
  29. >>28 lelong 0x1b57745f Nordic NRF52
  30. >>28 lelong 0x1c5f21b0 ESP32
  31. >>28 lelong 0x1e1f432d ST STM32L1xx
  32. >>28 lelong 0x202e3a91 ST STM32L0xx
  33. >>28 lelong 0x21460ff0 ST STM32WLxx
  34. >>28 lelong 0x2abc77ec NXP LPC55xx
  35. >>28 lelong 0x300f5633 ST STM32G0xx
  36. >>28 lelong 0x31d228c6 GD32F350
  37. >>28 lelong 0x4c71240a ST STM32G4xx
  38. >>28 lelong 0x4fb2d5bd NXP i.MX RT10XX
  39. >>28 lelong 0x53b80f00 ST STM32F7xx
  40. >>28 lelong 0x55114460 Microchip (Atmel) SAMD51
  41. >>28 lelong 0x57755a57 ST STM32F401
  42. >>28 lelong 0x5a18069b Cypress FX2
  43. >>28 lelong 0x5d1a0a2e ST STM32F2xx
  44. >>28 lelong 0x5ee21072 ST STM32F103
  45. >>28 lelong 0x647824b6 ST STM32F0xx
  46. >>28 lelong 0x68ed2b88 Microchip (Atmel) SAMD21
  47. >>28 lelong 0x6b846188 ST STM32F3xx
  48. >>28 lelong 0x6d0922fa ST STM32F407
  49. >>28 lelong 0x6db66082 ST STM32H7xx
  50. >>28 lelong 0x70d16653 ST STM32WBxx
  51. >>28 lelong 0x7eab61ed ESP8266
  52. >>28 lelong 0x7f83e793 NXP KL32L2x
  53. >>28 lelong 0x8fb060fe ST STM32F407VG
  54. >>28 lelong 0xada52840 Nordic NRF52840
  55. >>28 lelong 0xbfdd4eee ESP32-S2
  56. >>28 lelong 0xc47e5767 ESP32-S3
  57. >>28 lelong 0xd42ba06c ESP32-C3
  58. >>28 lelong 0xe48bff56 Raspberry Pi RP2040
  59. ### END UF2 FAMILIES
  60. >>28 default x
  61. >>>28 lelong x %#08x
  62. >8 lelong&0x2000 0 \b, file size
  63. >>28 lelong x %#08x
  64. >8 lelong &0x4000 \b, MD5 checksum present
  65. >8 lelong &0x8000 \b, extension tags present
  66. >12 lelong x \b, address %#08x
  67. >24 lelong x \b, %u total blocks