Search code examples
remote-debuggingstm32buildroot

stm32f429 buildroot remote-debugging


there

I just learned how to use buildroot and followed one of the tutorials to flash the built images of linux kernel, U-Boot, etc. to a beagle bone. It's all good and fine. So I applied buildroot on the stm32f429-disc1 and flashed the images to the board. There is a bug on the busybox and I want to debug it. The question is how would I modify the openocd script below so that I can debug the booting process, presumably with gdb (server) open in another terminal ?


flash:
    cd $(dir_buildroot)/output/build/host-openocd-0.10.0/tcl && ../../../host/usr/bin/openocd \
    -f board/stm32f429discovery.cfg \
    -c "init" \
    -c "reset init" \
    -c "flash probe 0" \
    -c "flash info 0" \
    -c "flash write_image erase ../../../images/stm32f429i-disco.bin 0x08000000" \
    -c "flash write_image erase ../../../images/stm32f429-disco.dtb 0x08004000" \
    -c "flash write_image erase ../../../images/xipImage 0x08008000" \
    -c "reset run" -c shutdown

I've always been using Atollic Truestudio under windows to debug stm32 boards, and Atollic makes it super easy to debug the bootloader, etc. I googled a lot of tutorials, but it seems to me that most of them are to setup for debugging applications in the user space. I am using Linux as the host machine, and I believe all I need are st-link/v2-1, openocd and gdb ?

Any comment is appreciated.

Regards, Eric


Solution

  • To debug userspace applications, you will not use OpenOCD, but rather pure software debugging, using gdb and gdbserver. You can read https://bootlin.com/doc/training/buildroot/buildroot-slides.pdf starting from slide 275 for more details.