Skip to content

Commit

Permalink
[build] Add STM32 and SAM support to ELF2UF2 tool
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Rush authored and salkinium committed Jun 20, 2023
1 parent 07d4b7f commit b05df3e
Show file tree
Hide file tree
Showing 2 changed files with 195 additions and 124 deletions.
20 changes: 12 additions & 8 deletions src/modm/board/feather_m4/module.md
Expand Up @@ -65,12 +65,16 @@ The Feather M4 has a [UF2](https://github.com/microsoft/uf2) bootloader. By
using a utility to convert the '.elf' files (generated by scons or make) to
'.uf2' files, it is then possible to copy the uf2 file directly to the board.

One of the more common tools for this conversion is ['uf2conv.py'](https://github.com/microsoft/uf2/tree/master/utils) (although the elf file needs to be converted to a
binary or hex file first). The converter that is supplied with modm, 'elf2uf2.py',
is ONLY for the rp2040, and will not work here.

However, the bootloader on the Feather is compatible with [BOSSA](https://www.shumatech.com/web/products/bossa); so the easiest method when working with modm is to use
'scons program-bossac' or 'make program-bossac' to load your program into
flash. (Be sure to press the reset button twice to get the board into bootloader
mode before flashing.)
In modm, the conversion utility is called 'elf2uf2.py' (in tools/modm_tools),
and is incorporated into the build system. Use 'scons uf2' or 'make uf2' to
create the uf2 file.

Alternatively, the bootloader on the Feather is compatible with [BOSSA](https://www.shumatech.com/web/products/bossa);
so another method is to use 'scons program-bossac' or 'make program-bossac' to
load your program into flash.

With either method, you must press the reset button twice to get the board into
bootloader mode before flashing with BOSSA or UF2 copying. (In bootloader mode,
a volume named FEATHERBOOT will be mounted; and that is where the UF2 file
should be copied.)

0 comments on commit b05df3e

Please sign in to comment.