Skip to content

Using(basic)

mean00 edited this page Dec 29, 2025 · 16 revisions

Use

The usage is similar to the blackmagic probe.

i.e. for arm:

mon swdp_scan
attach 1

for ch32v3xx:

mon rvswdp_scan
attach 1

There are some extra commands available :

  • mon frequency XXXk : set the debug link speed. Dont go over 1000k to debug a CH32V3!!
  • mon version : display version
  • mon reset : reset the target
  • mon voltage : display the reset pin voltage
  • mon fos M0| M3 | : activate freertos support
  • mon rtt auto : activate and enable automatic configuration
  • mon redirect 1 : redirect internal logs to the log channel

Vscode/Arm

example vscode/cortexm-debug configuration (Arm)

{
              "name": "Arm",
              "cwd": "${workspaceFolder}",
              "executable": "build/demo.elf",
              "request": "launch",
              "type": "cortex-debug",
              "runToEntryPoint": "main",
              "servertype": "bmp",
              "interface": "swd",
              "gdbPath" : "xxxxxxxxxxxxxxxx/arm-none-eabi-gdb",
              "BMPGDBSerialPort" : "/dev/ttySwindleGdb3", // ttySwindleGdb4 for RP2040/RP2350
              "runToMain": true,
          },

Vscode/Riscv (CH32)

example vscodeconfiguration (CH32V3xx)

 {
  {
            "name": "RISCV",
            "type": "gdb",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "target": "${workspaceRoot}/build/demo.elf",
            "gdbpath" : "/riscv/tools8/bin/riscv-none-elf-gdb",   
            "breakAfterReset"      : "true",           
            "autorun": [        
            "target extended-remote : "/dev/ttySwindleGdb3", // ttySwindleGdb4 for RP2040/RP2350
            "set confirm off",
            "set mem inaccessible-by-default off",
            "set  architecture riscv:rv32",
            "set remotetimeout unlimited",    
            "mon reset",
            "monitor fq 1500k",// this is the maximum speed !
            "mon rvswdp_scan",
            "attach 1",
            "load ",    
            "compare-sections",            
            "hb deadEnd ",               
            "hb main"           
            ],
         },

RTT Support

mon rtt enable That's it, the output will be dumped into the 2nd (GD32) or 3rd (CH32/RP2040) ACM

Networked version (CH32V307)

There is not bootloader with that version. You need to have the Ethernet cable plugged in at boot. Then :

  • Gdb Port : 2000
  • RTT Port : 2001

Clone this wiki locally