"Normal" ARM cross-compilation for ARM microncontrollers generally consists of three or four steps:
- Use an assembler to assemble the startup code (if it is assembly) into an object file
- Use a compiler to compile any source code into object files
- Use a linker to link the object files into an .elf file
- Use objcopy to convert the .elf file into a .hex file
- Flash the .hex file
It is step #4 that I am unsure about. In the documentation for OpenOCD's flash write_image
command, it states:
The file [type] can be specified explicitly as bin (binary), ihex (Intel hex), elf (ELF file), s19 (Motorola s19). mem, or builder.
It is clear that OpenOCD supports elf files, but I don't know what this actually means. Is this only supported on some targets? Must the JTAG/SWD adapter provide some sort of objcopy-like functionality for this to work? Is it simply a holdover from the days when OpenOCD did not yet support elf files?