unleashed-firmware/applications/plugins/dap_link
あく 984d89c6d0
Furi: smaller crash routine (#1912)
* Furi: smaller crash routine
* Furi: small fixes
* Furi: cleanup check routines, more assembly code, force inline of __furi_halt_mcu
* SubGhz: cleanup residual line mess
* Documentation
* Dap-link: fix help
* Furi: replace __furi_halt_mcu with HALT_MCU macros
* Furi: disable IRQ earlier in crash handler
* Furi: properly handle masked mode when detecting ISR
* Ble: allow 0 length feed in rpc_session_feed
* Format sources
* Furi: better crash logic explanation.
* Furi: some grammar in check.h

Co-authored-by: SG <who.just.the.doctor@gmail.com>
2022-10-24 20:50:34 +10:00
..
gui Furi: smaller crash routine (#1912) 2022-10-24 20:50:34 +10:00
icons CMSIS DAP/DAP Link Debugger (#1897) 2022-10-20 20:42:55 +09:00
lib CMSIS DAP/DAP Link Debugger (#1897) 2022-10-20 20:42:55 +09:00
usb CMSIS DAP/DAP Link Debugger (#1897) 2022-10-20 20:42:55 +09:00
application.fam CMSIS DAP/DAP Link Debugger (#1897) 2022-10-20 20:42:55 +09:00
dap_config.h CMSIS DAP/DAP Link Debugger (#1897) 2022-10-20 20:42:55 +09:00
dap_link.c CMSIS DAP/DAP Link Debugger (#1897) 2022-10-20 20:42:55 +09:00
dap_link.h CMSIS DAP/DAP Link Debugger (#1897) 2022-10-20 20:42:55 +09:00
dap_link.png CMSIS DAP/DAP Link Debugger (#1897) 2022-10-20 20:42:55 +09:00
README.md CMSIS DAP/DAP Link Debugger (#1897) 2022-10-20 20:42:55 +09:00

Flipper Zero as CMSIS DAP/DAP Link

Flipper Zero as a Free-DAP based SWD\JTAG debugger. Free-DAP is a free and open source firmware implementation of the CMSIS-DAP debugger.

Protocols

SWD, JTAG , CMSIS-DAP v1 (18 KiB/s), CMSIS-DAP v2 (46 KiB/s), VCP (USB-UART).

WinUSB for driverless installation for Windows 8 and above.

Usage

VSCode + Cortex-Debug

Set "device": "cmsis-dap"

BluePill configuration example
{
  "name": "Attach (DAP)",
  "cwd": "${workspaceFolder}",
  "executable": "./build/firmware.elf",
  "request": "attach",
  "type": "cortex-debug",
  "servertype": "openocd",
  "device": "cmsis-dap",
  "configFiles": [
      "interface/cmsis-dap.cfg",
      "target/stm32f1x.cfg",
  ],
},
Flipper Zero configuration example
{
  "name": "Attach (DAP)",
  "cwd": "${workspaceFolder}",
  "executable": "./build/latest/firmware.elf",
  "request": "attach",
  "type": "cortex-debug",
  "servertype": "openocd",
  "device": "cmsis-dap",
  "svdFile": "./debug/STM32WB55_CM4.svd",
  "rtos": "FreeRTOS",
  "configFiles": [
      "interface/cmsis-dap.cfg",
      "./debug/stm32wbx.cfg",
  ],
  "postAttachCommands": [
      "source debug/flipperapps.py",
  ],
},

OpenOCD

Use interface/cmsis-dap.cfg. You will need OpenOCD v0.11.0.

Additional commands:

  • cmsis_dap_backend hid for CMSIS-DAP v1 protocol.
  • cmsis_dap_backend usb_bulk for CMSIS-DAP v2 protocol.
  • cmsis_dap_serial DAP_Oyevoxo use DAP-Link running on Flipper named Oyevoxo.
  • cmsis-dap cmd 81 - reboot connected DAP-Link.
Flash BluePill
openocd -f interface/cmsis-dap.cfg -f target/stm32f1x.cfg -c init -c "program build/firmware.bin reset exit 0x8000000"
Flash Flipper Zero using DAP v2 protocol
openocd -f interface/cmsis-dap.cfg -c "cmsis_dap_backend usb_bulk" -f debug/stm32wbx.cfg -c init -c "program build/latest/firmware.bin reset exit 0x8000000"
Reboot connected DAP-Link on Flipper named Oyevoxo
openocd -f interface/cmsis-dap.cfg -c "cmsis_dap_serial DAP_Oyevoxo" -c "transport select swd" -c "adapter speed 4000000" -c init -c "cmsis-dap cmd 81" -c "exit"

PlatformIO

Use debug_tool = cmsis-dap and upload_protocol = cmsis-dap. Documentation. Remember that Windows 8 and above do not require drivers.

BluePill platformio.ini example
[env:bluepill_f103c8]
platform = ststm32
board = bluepill_f103c8
debug_tool = cmsis-dap
upload_protocol = cmsis-dap