# RedMagicProbe **Repository Path**: iysheng/RedMagicProbe ## Basic Information - **Project Name**: RedMagicProbe - **Description**: 兼容 black magic probe 的硬件调试器 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: v6.99 - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2022-09-06 - **Last Updated**: 2023-09-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### Red hardware probe 这个仓库是用来开发类 black magic probe 项目的仓库,期望开发一款可以升级固件的调试器。 ![top view](misc/assets/RedMagicProbe.png) ![bottom view](misc/assets/RedMagicProbe_bottom.png) #### 原则 * 固件兼容 black magic probe 上游 * 硬件上带有自己的特点 😊 #### 进度安排 |编号|目标|完成时间| |---|---|---| |1|绘制完成原理图|2022-09-08| |2|绘制完成 PCB 并发送出去打样|2022-09-08| |3|测试可以正常识别以及烧写flash到stm32f1x,但是gd32f205x 无法正常在线调试|2022-10-11| |4|更新硬件设计文档到 Kicad V6.99 版本,消除 DRC 检查错误|2022-12-22| #### 使用步骤 1. 烧录程序 1. 首先烧录 blackmagic-dfu.bin 到 0x8000000 偏移位置,这部分存储的是 bootloader 2. 首先烧录 blackmagic.bin 到 0x8002000 偏移位置,这部分存储的是 app 2. 如果一切正常,在 Linux 端,通过 dmesg 可以看到 Black Magic Probe 的打印 ``` [453904.244629] usb 1-6.1: new full-speed USB device number 78 using xhci_hcd [453904.322564] usb 1-6.1: New USB device found, idVendor=1d50, idProduct=6018, bcdDevice= 1.00 [453904.322568] usb 1-6.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [453904.322570] usb 1-6.1: Product: Black Magic Probe v1.8.2 [453904.322571] usb 1-6.1: Manufacturer: Black Magic Debug [453904.322572] usb 1-6.1: SerialNumber: 90A777AC [453904.345333] cdc_acm 1-6.1:1.0: ttyACM0: USB ACM device [453904.345907] cdc_acm 1-6.1:1.2: ttyACM1: USB ACM device ``` 3. 测试调试,以在 Linux 端调试 rtthread.elf 为例 1. arm-none-eabi-gdb rtthread.elf ``` ▸ arm-none-eabi-gdb rtthread.elf GNU gdb (GNU Arm Embedded Toolchain 10-2020-q4-major) 10.1.90.20201028-git Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=x86_64-linux-gnu --target=arm-none-eabi". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from rtthread.elf... (gdb) target extended-remote /dev/ttyACM0 Remote debugging using /dev/ttyACM0 (gdb) monitor swdp_scan Target voltage: 3.3V Available Targets: No. Att Driver 1 STM32F1 VL density M3 (gdb) attach 1 Attaching to program: /tmp/mini_stm32/bsp/stm32/stm32f103-atk-warshipv3/rtthread.elf, Remote target 0x08008594 in rt_thread_idle_excute () at /tmp/mini_stm32/src/idle.c:153 153 while (_has_defunct_thread()) (gdb) ``` 2. 烧录程序 ``` (gdb) load # 执行 load 命令烧录程序 (gdb) compare-sections Section .text, range 0x8000000 -- 0x800e308: matched. Section .init, range 0x800e308 -- 0x800e30c: matched. Section .fini, range 0x800e30c -- 0x800e310: matched. Section .data, range 0x800e310 -- 0x800e8bc: matched. (gdb) kill Kill the program being debugged? (y or n) y [Inferior 1 (Remote target) killed] (gdb) ``` #### 致谢 硬件也参考了: https://kb.zubax.com/display/MAINKB/Dronecode+Probe+documentation