Posts

Showing posts with the label debugging

PX4 development - building, flashing and debugging with debugger (like a PRO)

Image
 This is the next tutorial that brings a bit more expertise into PX4 Autopilot debugging from an embedded software developer perspective. It will explain how to use J-Link debugger to debug PX4 Autopilot code in Eclipse IDE. If you didn't already see the previous tutorial, please go there, first phase of PREPARING is mandatory to be done so we can continue here. Link to previous tutorial: https://igor-misic.blogspot.com/2022/06/px4-development-building-flashing-and.html Everything in this tutorial is tested and reproduced at Kubuntu 22.04 LTS (It works the same for Ubuntu as well).

PX4 development - building, flashing and debugging without debugger (Arduino developers style)

Image
 This is a short tutorial that will explain how to build PX4 Autopilot, flash and debug it at the PX4 FMU (Flight Management Unit) without a debugger. Everything in this tutorial is tested and reproduced at Kubuntu 22.04 LTS (It works the same for Ubuntu as well). Preparation Let's start with cloning PX4 Autopilot > git clone https://github.com/PX4/PX4-Autopilot.git After the repository is cloned make sure you initialize all submodules. You would like to keep using this GIT commands when you jump between branches in PX4, otherwise, you can experience issues like missing modules while building. > cd PX4-Autopilot > git submodule sync > git submodule update --init --recursive And that is it we are almost ready to build our PX4 firmware. You need to know what board (FMU) you possess. Let's guess you have Pixracer. Pixracer is fmu-v4 board. Figure 1 - px4_fmu-v4 board source tree

IMBootloader - STM32H7xx / Mateksys H743-SLIM

Image
IMBootloader  is now supporting STM32H7xx microcontrollers. Development is done with  Mateksys H743-SLIM . IMBootlaoder has an IMLedBlink example for this board.   

NXP S32K + Eclipse + J-Link = debugging

Image
An image with setup needed to debug S32K from NXP. Pretty much similar to STM32 MCUs but these " Other options " where you add " r g q " are important. Don't know what they do but without it, you will not be able to do proper inline debugging.  

Flashing/debugging/running code at external memory in the memory-mapped mode

Image
  STM32 microcontrollers have special capabilities running code directly from external flash. To make it possible STM32 made a special set of instructions called memory-mapped mode where the microcontroller is reading instructions from the external flash. Since to read data from an external flash can take some time there is QSPI protocol witch basically four wires used as SPI MISO (Master Input Slave Output) to make throughput 4x time faster than classical SPI.   Figure 1 - Illustration of STM32H750 connected to W25Q128JV 

Eclipse + Black Magic Probe + Embsysregview

Image
Is there a chance to use the Black Magic Probe with Eclipse and see the peripheral registers. Short answer: Yes it is. For peripheral registers, you will need the Embsysregview Eclipse plugin. If you have a problem to install it check my last blog post .  How setup BMP? Go to: Run -> Debug configurations -> GDB Hardware Debugging and select New Launch configuration on the top left corner. Select everything as it is on images (my example is for miniblink, you do it for your). Image 1 - Main

Example - miniblink on Pixracer

Image
I have created my new repo pixracer-examples in the hope I'll find a time to create as much as possible examples for Pixracer. For now, I've created miniblink. Link to repo: https://github.com/Igor-Misic/Pixracer-examples Editor: Visual Studio Code (include building and debugging config) Debugger: Black Magic Probe

Config for VS Code debugger and Black Magic Probe + Pixracer

Image
Maybe you like VSC but you don't know how to config. I have tried many different configs and find out this work best for me. I have tested it with miniblink from libopencm3 . Configuration: { "version" :  "0.2.0" , "configurations" : [ { "name" :  "(gdb) Launch" , "type" :  "cppdbg" , "request" :  "launch" , "miDebuggerPath" :  "arm-none-eabi-gdb" , "targetArchitecture" :  "arm" , "program" :  "${workspaceFolder}/miniblink.elf" , "args" : [], "stopAtEntry" :  false , "cwd" :  "${workspaceRoot}" , "environment" : [], "externalConsole" :  true , "MIMode" :  "gdb" , "setupCommands" : [ {  "text"  :  "target extended-remote /dev/ttyACM0" }, {  "text"  :  "monitor tpwr ...

How connect Pixracer with Black Magic Probe

Image
Here is how to connect your Pixracer with Black Magic Probe. You can see images with proper wiring.

Debugging EK-TM4C123GXL with Visual Studio Code on Linux

Image
If you have TM4C123G LaunchPad Evaluation Kit and you like Visual Studio Code here is how to setup debugging on this board. This is the tutorial how to do that on clean Ubuntu 16.04 LTS. ARM GCC Compiler Setup Download the latest GCC cross compiler for the ARM from here:  https://launchpad.net/gcc-arm-embedded/+download In the time of writing this text, the last one is    gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 Run this commands in Linux console. wget https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q3-update/+download/gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 tar -jxf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 rm gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 exportline="export PATH=$HOME/gcc-arm-none-eabi-5_4-2016q3/bin:\$PATH" echo $exportline >> ~/.profile source ~/.profile sudo dpkg --add-architecture i386 sudo apt-get update sudo apt-get install libc6:i386 lib32ncurses5 Without i386 architecture ...