title: How do I generate a binary file of the stm32 code?
body: <p>I am building a firmware updater for an STM32 MCU. I have so far programmed bootloader software on the device, separate from the main application in FLASH. </p>
  
  <p>What I need to do is generate a binary file which will be the replacement code for the main application in FLASH. This means I can transfer the file over UART and overwrite the main application. How do I go about producing such a file? </p>
  
  <p>The code was programmed using the stm32CubeIDE which generates an .elf file after building. I will add a header to this binary code before transmitting over UART.</p>
  
  <p>Thank you very much in advance for your help, </p>
  
  <p>Harry</p>