ABSURD is a Python-based GDB remote server that allows GDB to interact with the on-chip debugger (OCD) of modern AVR microcontrollers ("AVR8X") via SerialUPDI.
ABSURD is licensed under the MIT License.
- SerialUPDI programmer (USB-UART adapter with its TX and RX connected by a Schottky diode to simulate a half-duplex line)
- AVR8X microcontroller with UPDI
- MegaAVR 0-Series (
ATmega__0_) - TinyAVR 0/1/2-Series (
ATtiny__0_,ATtiny__1_,ATtiny__2_) - AVR Dx Series (
AVR___DA__[S],AVR___DB__,AVR__DD__,AVR__DU__) - AVR Ex Series (
AVR__EA__,AVR16EB__) - AVR Sx Series (
AVR32SD__) - AVR Lx Series (
AVR__LA__)
- MegaAVR 0-Series (
- pySerial Python library
Note
ABSURD has only been tested with a subset of the devices listed above. Given it is based on guesswork, overgeneralization is quite possible. At the time of writing, no experiments have been performed with SD, and LA remains a header-only device.
Transmission through a serial port may be buffered by OS or device driver. Typically, the buffer is flushed when it is full or after a certain timeout. This can cause significant delay with UPDI communication, which involves back-and-forth exchange of small packets. To mitigate this issue, minimize the buffering timeout in the way specific to OS and UART adapter in use.
Note that a "minimal" timeout like 1 ms is still much longer than a UART character or an AVR clock cycle. This limitation is inherent to the SerialUPDI approach.
- Install ABSURD with
pip install avr-absurd- Alternatively, clone this repository and install with
pip install -e .for development
- Alternatively, clone this repository and install with
- Connect MCU to PC with a SerialUPDI programmer
avr-absurd -P [serial port name]- or
python -m absurdinstead ofavr-absurdif it is not in PATH
- or
- Run
avr-gdband connect to the server withtarget extended-remote :[TCP port number] - Optional parameters
-b/--bpsbaud rate (default: 115200). This can be higher (up to 1.8 MHz) with good SerialUPDI adapters.-r/--rsp-portTCP port number for RSP (default: 3333)-s/--swbpenable software breakpoints. Note that use of software breakpoints consumes flash erase/write cycles, and is incompatible with in-application programming-v/--verboseprint more logs
- Instruction-level stepping
- Two hardware breakpoints
- Optional software breakpoints
- Wear minimized by use of instruction injection
- Break on...
- change of flow (after any skip/branch)
- interrupt
- external trigger
- Read/write access to register file, RAM and peripheral SFRs
- Flash programming through
loadcommand- Other NVMs (EEPROM/User Row/Boot Row/Fuses) are not supported
- OCD v0 (Tiny 0/1) support
- Interrupt handling during stepping
- RSP packet checksum handling
- Check auto-detected chip identity/parameters against specified one
- Chip database to support it
- Chip parameter override
- Breaking API change were made to internals
- My guesswork on OCD registers is available here.