Add debug information to your target application executable (*.hex, *.s19 etc.)

Although this step is optional, it enables the most exciting feature of ONEinspect. With debug information stored directly in your microcontroller FLASH (or other type of NVM) ONEinspect will always know where to find all static variables and other symbols. In ONEinspect, debug info loaders take care of converting debug information produced by your compiler toolchain (DWARF, COFF etc.) to the debug information format needed by ONEinspect. This specific debug information format is a very compact subset of debug information produced by your linker. It is further compressed with very high compression ratio to occupy a really small amount of your FLASH (typically only few kilobytes). The procedure of adding debug info to your application executable is simple:

  1. Configure your linker to produce application file  (*.hex, *.s19, eg. input.hex) and debug info file (*.elf, *.axf, *.out, eg. debug_info.elf). You must enable debug info even for your release configuration (beware that some compiler optimizations may optimize certain symbols out).
  2. Define a postbuild step in your IDE. Some IDEs allow only one postbuild step, in such case you can use system batchfile to execute more commands if you need to do so. Inside the postbuild step sequence execute following command:

FormatConverter input.hex output.hex -d debug_info.elf

This command ensures that output.hex will contain debug information needed by ONEinspect. You can then download the output.hex to your embedded system. ONEinspect will then (after nearest Reset Target command) upload this debug info to see where which variables and symbols were allocated by the linker.

Specific callback function in Target Library tells ONEinspect where the debug info is located (you may configure this as well).

Additional parameters can be specified to force FormatConverter utility to generate CRCs, code size information, shift debug info to specified address in FLASH etc. See this chapter about more info about the FormatConverter utility.

If you omit this step (eg. small amount of remaining FLASH, safety reasons etc.) you can still import debug information to ONEinspect from the linker output file (here debug_info.elf). But you must take care which debug info file is compliant to the application version loaded into your embedded system.