There are several file types used when programming and debugging embedded systems. These files are common across many different processors and software products and not exclusive to Cortex-M MCUs or the software used in this book.
Executable and Linkable Format (ELF) files are an executable format that has the ability to store more than the straight *.bin or *.hex files commonly flashed directly into an MCU's ROM. The *.elf files are similar to the *.hex files in that they contain all of the binary machine code necessary to load a fully functional project onto a target MCU. The *.elf files also contain links to the original source code filenames and line numbers. Software such as Ozone uses these links to display source code while debugging the application:
- *.bin: A straight binary file (just 1s and 0s). This file format can be directly "burned" into an MCU's internal flash memory, starting at a given address.
- *.hex: Usually a variant of Motorolla S-record format. This ASCII-based file format contains both absolute memory addresses and their contents.
- *.elf: Contains both the executable code as well as a header that is used to cross-reference each memory segment to a source file. This means a single ELF file contains enough information to program the target MCU and also cross-reference all of the source code used to create the binary memory segments.
- *.svd: Contains information that maps registers and descriptions to the memory map of the target device. By providing an accurate *.svd file, Ozone will be able to display peripheral views that are very helpful when troubleshooting MCU peripheral code.
C:STSTM32CubeIDE_1.2.0STM32CubeIDEpluginscom.st.stm32cube.ide.mcu.productdb.debug_1.2.0.201912201802 esourcescmsisSTMicroelectronics_CMSIS_SVD.
There are other file types used in embedded systems' development as well. This is by no means an exhaustive list—just the ones we'll be using most in the context of the example projects.