title: Do I need to use objcopy before flashing my ARM microcontroller with OpenOCD?
body: <p>"Normal" ARM cross-compilation for ARM microncontrollers generally consists of three or four steps:</p>
  
  <ol>
  <li>Use an assembler to assemble the startup code (if it is assembly) into an object file</li>
  <li>Use a compiler to compile any source code into object files</li>
  <li>Use a linker to link the object files into an .elf file</li>
  <li>Use objcopy to convert the .elf file into a .hex file</li>
  <li>Flash the .hex file</li>
  </ol>
  
  <p>It is step #4 that I am unsure about. In the documentation for OpenOCD's <code>flash write_image</code> command, it states:</p>
  
  <blockquote>
    <p>The file [type] can be specified explicitly as bin (binary), ihex (Intel hex), elf (ELF file), s19 (Motorola s19). mem, or builder.</p>
  </blockquote>
  
  <p>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?</p>