Skip to content

Debugging Embedded systems

Jorge Pérez edited this page Nov 11, 2024 · 6 revisions

Note

The contents of this page were mostly taken from the chapter Debugging Tools for Real-Time Systems

File types

File extension Meaning What is it for
.bin Binary file. Executable machine code. (For the correct processor arch)
.hex Hex file Contains both absolute memory addresses and their contents
.elf Executable and Linkable Format 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.

If you want to debug code, you NEED .elf files

Segger VS ST-Link

One of the fun facts about STM-32 boards, is that they are comprised of two elements, the board, whith all your peripherals and MCU, and a ST-Link, that you normally use to program the board, tho, they are completely independent system, if you break your board in two, you might as well use the ST-Link somewhere else.

image

Few key points

  • J-Link is like Segger's ST-Link

ST-Link

Segger

Buy the Segger EDU

Convert the on-board ST-Link to Segger probe.

How to generate an .svd file

https://arm-software.github.io/CMSIS_5/SVD/html/svd_SVDConv_pg.html

Probable link to stm32 f3 https://github.com/STMicroelectronics/STM32CubeF3/tree/master/Drivers/CMSIS/docs/SVD/html

TODO:

  • Check how to use configASSERT
  • Check how to use assert_param

Check the whole book:

Hands-On RTOS with Microcontrollers

Clone this wiki locally