Wellys Dev

  • Home
  • Search/Topics
  • Writings
  • About
  • 2021-08-21
    Debugging in C Code on the RP2040: Using gdb - Setup

    Where I show a simple method of using gdb to debug code on the RP2040 (Pi Pico board).

    Sources

    • Raspberry Pi Pico SDK: Raspberry Pi Pico SDK
    • Raspberry Pi Pico Pinout
    • GDB Documentation
    • Guide to Faster, Less Frustrating Debugging - Norman Matloff
    • gdb Resources

    Setup .gdbinit

    The Guide recommends at the very least, add “target remote localhost:3333” to your .gdbinit file. To make our edit/compile/link/load round trip easy, I recommend the following for your .gdbinit:

  • 2021-08-20
    Developing in C on the RP2040: Linux

    Where I begin to develop code in C on the RP2040.

    Sources

    • Raspberry Pi Pico SDK: Raspberry Pi Pico SDK
    • Raspberry Pi Pico Pinout
    • Getting Started with Pico
    • Shawn Hymel on Digikey

    Introduction

    I like using Forth to develop code on embedded microcontrollers, however at times, I’ll have a project that requires a more supportive framework. In this case, C is a superior choice if I need the execution speed of Forth and the framework of microPython. This requires a significant investment in building the tools required and skills to use those tools, to develop in C.

  • 2021-03-20
    gdb Resources

    All of the resources found related to gdb (particularly, related to the RP2040) and how to use it.

    GNU gdb documentation

    • GDB: The GNU Project Debugger
    • Online User Manual: Debugging with GDB
    • PDF User Manual: Debugging with GDB

    gdb Tutorials

    • Guide to Faster, Less Frustrating Debugging
    • CSE 351: GDB (Gnu DeBugger)
    • Quick Guide to gdb: The GNU Debugger
    • Beej’s Quick Guide to GDB
    • gdb Debugger Tutorial
    • gdb Tutorial Site
    • Hackaday: LOCAL AND REMOTE DEBUGGING WITH GDB
    • Hackaday: BEGINNER’S LOOK AT ON-CHIP DEBUGGING
    • 8 gdb tricks you should know
    • Debugging Firmware with GDB
    • GDB — Basics
    • 10 Things You Can Only Do With gdb
    • GDB Tutorial: Some Cool Tips to Debug C/C++ Code
    • Advanced GDB Usage

    Cheat Sheets

    • YoLinux: GNU GDB Debugger Command Cheat Sheet

    Tools to enhance gdb

    • gdb-dashboard
    • pyrsp: simple wrapper around the GDB Remote serial protocol
    • gdbundle - GDB and LLDB’s Missing Plugin
    • Visual debugging using gdbgui

    AVR gdb

    • AVR-GDB Tutorial
    • avr-gdb Notes
    • man avarice

    AVR gdb Notes

    1. Check the version number on avr-gdb as of December 2021, it is 11.1. On Ubuntu, the latest version is 8.1 from 2018 which had quite a few bugs. Attempted to build it manually (which failed), so I spun up a Manjaro (Arch Linux) instance to get the latest. Crazy, I know.
    2. Start avarice in a separate window using, then launch gdb in another window:
      avarice -g -w -d -P atmega328p :3333 	# window 1
      avr-gdb -tui							# window 2
    3. If avarice crashes on startup, cycle power on both the debugger (Dragon) and the target (Uno)

    Pico (RP2040) gdb

    • Debugging the BBC micro:bit with pyOCD and GDB
    • Raspberry Pico: Simple Debugging with just one Device
    • Pico-debug
    • PicoReg: real-time diagnostics for the Pi Pico using SWD
  • 2021-03-04
    Developing in C on the AVR ATmega328P

    Introduction

    While the Arduino tool set, (both the Arduino IDE and Arduino software framework) are outstanding for quickly developing a working prototype, they do so with a combination of a graphical-user-interface (GUI), the C++ language and Arduino-only classes. This in itself, isn’t a problem, one can be quite efficient and productive using this approach.

    This approach is an issue if you are at a university or job which expects a standards-based C language proficiency. It is also an issue, if your class or job, requires understanding how to use command-line-interface (CLI)-based tools. The C language, and not C++, is the basis of a significant number of embedded systems development.

  • 2021-03-01
    C: Developing in C on the RP2040

    A set of entries which comprise a course for learning how develop C programs for the RP2040.

    Entries

    1. Developing in C on the RP2040: Read First
    2. Developing in C on the RP2040: Linux
    3. Developing in C on the RP2040: macOS
    4. Developing in C on the RP2040: Windows
    5. Developing in C on the RP2040: Using gdb - Setup
    6. Developing in C on the RP2040: Using gdb - Hints
    7. Developing in C on the RP2040: New Project
    8. Developing in C on the RP2040: Using gdb - Deep Dive
    9. Developing in C on the RP2040: Exploring Blink
Page 8 of 8
Copyright © 2025 Lief Koepsel
  • Home
  • Search/Topics
  • Writings
  • About