You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

This page describes, step-by-step, how to set up debugging of Pyxida firmware on the hardware itself, with the Segger JLink EDU probes.

Hardware requirements:

  • SEGGER JLink EDU probe with a USB cable
  • JTAG to Cortex-M adapter
  • ARM 9-pin to Pyxida 8-pin adapter
  • A working Pxida board

Software requirements:

  • Ozone (for debugging) - download here (pick V2.62g!!!!!)
  • platform-io 4.0.0+ (for building firmware) - download ($ pip install platformio) or upgrade ($ platformio upgrade
  • Drivers (details here)

You do not need the programmer, as the JLink probe is capable of programming the board. However, you must power the Pyxida, recommended through the programming port.

Compiling firmware

First, you need to compile the firmware. You can do that with either running 

$ platformio run -e teensy35_debug

Or, you can build/run the pio_build_debug configuration in CLion. That is equivalent to running make pio_build_debug in the directory in which you created the Makefile with cmake.

Note: there are two platformio environments, teensy35 and teensy35_debugOnly the second one will produce DWARF debug information, which is necessary for debugging.

Now, we need to upload this firmware to the board. If you have the correct version of platformio, your firmware file should be in 

[path to your pyxida-firmware repo]/pyxida/.pio/build/teensy35_debug/firmware.elf

Uploading firmware

Open Ozone and create a new project with the File > New > New Project Wizard.

 

 

 

 

We are using the MK64fx512vll12 microprocessor. In the first step, select the MK64fx512xxx12 chip family, and leave peripherals blank.

In the next one, select JTAG, 1MHz, USB, and leave Serial No blank - all of this should be the default anyway.

In the third one, browse to find the .elf file you have just compiled.

Debugging

Now you are all set to debug like you would any other chip with SEGGER! If all the debug information was compiled with the code, Ozone should be able to open up the correct files. If you want to set a breakpoint in a particular C++ file, just open it in Ozone (Ctrl-O or File > Open).

The most important commands are in the top left corner - to upload, pause, resume and restart execution. There, you can also find Step Into/Over/Out while debugging.

Ozone also allows you to see Global data, Local data, set watches, see function addresses, raw memory and a lot more - pretty much all you need

Troubleshooting

This section is still fairly empty and will be filled as people report their issues with this.

If you are getting build errors with pio_build_debug due to "multiple TinyGPSPlus" libraries, you can fix this in the platformio.ini file. (Common in windows users)

  • Navigate to "lib_deps = " under "teensy35_debug" in platformio.ini, and change "TinyGPSPlus" to its library ID "1655", and then building should work.
  • There are multiple TinyGPSPlus libraries that are conflicting, so specifying this value will install the correct version for build. If you change the ID back to "TinyGPSPlus" it should still work since you now have the correct library installed for future builds.

 If a file is not found or a file you know is a part of the codebase, does not allow you to set breakpoints, check:

  • There is not a #line macro. Those will mess up debugger references, so don't ever use them.

  • No labels