Embedded Computing
  • About
  • Blog
  • Hardware
    • Which Platform?
    • Controller Platforms >
      • Adafruit Platform
      • Arduino Plaform
      • BBC micro:bit
      • Espressif Platform
      • iLabs Platform
      • Raspberry Pi Platform (MCU)
      • Seeed Platform
      • Silicon Labs Platform
      • Teensy Plaform
    • Computer Platforms >
      • BeagleBone Platform
      • Raspberry Pi Platform (SBC)
      • UDOO Platform
    • Peripherals >
      • Shields
      • Grove System
      • Sensors
      • Actuators
    • Displays >
      • E-Paper Displays
      • Reflective Displays
      • TFT Displays
      • LCD Displays
    • Legacy Platforms >
      • chipKIT Plaform
      • 4D Systems Platform
      • Intel Platform
      • LaunchPad Plaform
      • BoosterPacks for LaunchPads
      • LightBlue Bean
      • Maple Plaform
      • Mediatek Platform
      • Microsoft Azure IoT DevKit
      • Particle Platform
  • Software
    • Exploring RTOS with Galaxia >
      • Event Library
      • Semaphore Library
      • Mailbox Library
      • Timer Library
      • Clock Library
      • SWI Library
      • Task Library
    • Ultra-Low Power with EnergyTrace >
      • Ultra-Low Power with MSP430
      • Ultra-Low Power with Energia MT and Galaxia
    • Using Integers Instead of Reals
    • Going Python?
  • IoT
    • IoT Platforms: Which Hardware? >
      • Matter with Silicon Labs MG24
    • IoT Services: Which Solution? >
      • Recommended IoT Solutions
      • Platform-Specific IoT Solutions
      • Other IoT Solutions
      • Not tested IoT Solutions
      • Notification Solutions
    • Get Date and Time from Internet with NTP
    • Fast and Easy WiFi Connection with QR-Code
  • Tools
    • How to Start?
    • Reference >
      • Asking for Help
      • Boards Pins Maps
      • Ruler
      • Boards and Plugs
      • I²C Logic Level Converter
      • Standards for Connectors
    • Training >
      • Texas Instruments Workshops
      • Embedded Systems: Shape The World — MOOC edX UTAustinX UT.6.02x
      • Embedded Systems - Shape The World: Microcontroller Input/Output — MOOC edX UTAustinX UT.6.10x
      • Embedded Systems - Shape The World: Multi-Threaded Interfacing — MOOC edX UTAustinX UT.6.20x
      • Real-Time Bluetooth Networks: Shape the World — MOOC edX UTAustinX UT.RTBN.12.01x
      • Systems Thinking with Texas Instruments Robotics System Learning Kit
    • Books >
      • Getting Started with the MSP430 LaunchPad
      • Getting Started with Arduino
      • Arduino Cookbook
    • IDE >
      • The Battle of IDEs
      • More Options
      • Assessing the Next Generation of IDEs
      • Tools for Documentation
    • Equipment >
      • Saleae Logic Analyser
      • Rigol DS1102E Oscilloscope
      • XDS110 Debug Probe with EnergyTrace​
      • Segger J-Link Programmer-Debugger
      • Nordic Power Profiler Kit II
  • Projects
    • Libraries >
      • Master I²C Software Library
      • Date and Time Library
      • highView Library Suite
      • Others Libraries
    • smartDevices >
      • I²C smartColours Smart Sensor
      • I²C smartRFID Smart Sensor
      • I²C smartLED Display
      • I²C smartControls Smart Device
      • I²C smartWiFi Smart Device
      • I²C smartBLE Smart Device
      • I²C smartNode Smart Device
    • IoT Projects >
      • Remote E-Paper Weather and Message Board
      • Typie-Walkie with LoRa and E-Paper Screen
      • Typie-Walkie with E-Paper Screen
      • Remote e-Paper Pictures Panel
      • Remote e-Paper Messages Panel
      • Industrial IoT Project
      • Remote Contactless Temperature Monitor
      • Using Node-RED for IIoT
      • Low Power Home Network Weather Monitoring
      • Updated Low Power Home Network Weather Monitoring
      • Weather and Security Station with Blynk
      • SensorTag to Blynk Using Node-RED
      • Pervasive Reporting
    • AI Projects >
      • Colour Recognition with Neural Network
    • Other Projects >
      • Air Quality Monitoring
      • Driving a Large E-Paper Display with a Compact Xiao RP2040
      • Low-Power E-Paper Weather Station
      • Portable Particulate​ Matter Monitor
      • FRAM-based E-Paper Screen Controller
      • General Purpose 3.5" Screen
      • Colour Recognition with Neural Network
      • A Low Power Weather Station
      • Digital Volt-Amp-Watt Meter
      • Mobile Measurement with LCD Display
      • Screen with SRAM for GUI
      • Volt-Amp-Watt-Meter for Grove
      • Multi-Touch Project with CapTIvate

Debugging against the Pico Board

There are different ways to carry debugging against the Raspberry Pi Pico:
  • Using the second core of the same Pico,
  • Using a second Pico board,
  • Using a Raspberry Pi 4B,
  • Using a standard programmer-debugger like .
​
Picture

Using the second core of the same Pico

Since the RP2040 features two cores, why not using one core to debug the other? This is the interesting approach to get a first look at debugging.

Alas, I couldn't manage to run the debugger and debug the application at the same time. I may have missed one step in the procedure.  

Using a second Pico board

As the Pico goes for USD4, why not using a second Pico as a programmer-debugger? 

Called PicoProbe, this solution works very well. The first Pico is turned into a programmer-debugger after flashing an executable available as a UF2 file. Then it is connected to the second Pico, the target. The programmer-debugger also reroutes the serial port from pin 0 and 1 of the target.

The Serial port of the target is no longer Serial on the USB port, by Serial1 on pins 0 and 1.
Picture

Using the Raspberry Pi Debug Probe

The Raspberry Pi Debug Probe offers a cleaner alternative. It offers two ports, one for programming and debugging, and another for the serial console, with the corresponding cables. It also includes a USB cable.

The cables come with different plugs, fool-proof 3-way JST-SH, and standard male and female 0.1". The 3-way JST-SH cable plugs directly into the JST-SH connector now featured on the Pico boards with headers, Pico H and Pico WH.

The Debug Probe is based on the RP2040 MCU and provides the same features: upload and debug, and serial console on Serial1. However, it does not power the target board.

As always with Raspberry Pi, documentation is comprehensive and excellent. At USD12, it is an excellent choice. 

Using a Raspberry Pi 4B

I haven't tested this solution.

Using a standard programmer-debugger

The standard tools include the openOCD server, the GDB client and a Segger J-Link programmer-debugger.

I faced various issues, but found fixes for all of them:
  • As a multi-core MCU, the RP2040 requires the SWD multi-drop feature, which is available on Segger J-Link probes starting version 10. My Segger J-Link probe was version 9, so it didn't support it. This was fixed by using a more recent Segger J-Link probe or the Segger J-Link Edu mini.
Picture
  • Similarly, the Arduino port relies on mbed, which is surprisingly not supported by Segger. Using the excellent arduino-pico by Earle F. Philhower, actually based on the RP2040 SDK, brought stability and allowed debugging.
  • The standard version of OpenOCD doesn't support the RP2040. A special branch on the Raspberry Pi fork of OpenOCD solves the issue.
As an extra benefit, debugging is launched right from Visual Studio Code.
Picture

Links

  • Boards package arduino-pico by Earle F. Philhower
  • ​Raspberry Pi Debug Probe
  • Raspberry Pi fork of OpenOCD
  • Raspberry Pi official documentation
  • Debugging using another Raspberry Pi Pico
Picture

​Posted: 21 Apr 2022
Updated: 09 Feb 2024
Powered by Create your own unique website with customizable templates.