{"id":13830725,"url":"https://github.com/devanlai/dap42","last_synced_at":"2025-07-09T12:31:11.941Z","repository":{"id":144772832,"uuid":"43793227","full_name":"devanlai/dap42","owner":"devanlai","description":"CMSIS-DAP debugger firmware for STM32F042Fx and STM32F103xx","archived":false,"fork":false,"pushed_at":"2023-08-07T03:26:36.000Z","size":367,"stargazers_count":189,"open_issues_count":7,"forks_count":69,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-08-04T10:03:50.659Z","etag":null,"topics":["cmsis-dap","debugger","firmware","stm32"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devanlai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-07T03:32:46.000Z","updated_at":"2024-08-03T19:42:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"cc3bdc14-2196-469f-b3f5-07f0874395e0","html_url":"https://github.com/devanlai/dap42","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devanlai%2Fdap42","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devanlai%2Fdap42/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devanlai%2Fdap42/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devanlai%2Fdap42/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devanlai","download_url":"https://codeload.github.com/devanlai/dap42/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225539509,"owners_count":17485342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmsis-dap","debugger","firmware","stm32"],"created_at":"2024-08-04T10:01:06.737Z","updated_at":"2025-07-09T12:31:11.927Z","avatar_url":"https://github.com/devanlai.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# dap42\nThe dap42 project is an open-source firmware and [hardware design](https://github.com/devanlai/dap42-hardware) for an inexpensive, minimalist CMSIS-DAP based debug probe based on the [STM32F042F6](http://www.st.com/web/catalog/mmc/FM141/SC1169/SS1574/LN1823/PF259617) in a TSSOP-20 package.\n\nThis project is stable - it has been proven in the field by a few dozen users and all core functionality has been tested.\n\n## Current features\n### Firmware\n* [Serial Wire Debug](https://developer.arm.com/documentation/ihi0031/a/The-Serial-Wire-Debug-Port--SW-DP-/Introduction-to-the-ARM-Serial-Wire-Debug--SWD--protocol) (SWD) access over [CMSIS-DAP 2.0](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) protocol via HID interface or bulk interface (tested with [OpenOCD](https://openocd.org), [LPCXpresso](http://www.nxp.com/pages/:LPCXPRESSO) and [pyOCD](https://pyocd.io/)).\n* CDC-ACM USB-serial bridge\n* [Device Firmware Upgrade](https://www.usb.org/sites/default/files/DFU_1.1.pdf) (DFU) over USB (detach-only, switches to on-chip [DFuSe](http://dfu-util.sourceforge.net/dfuse.html) bootloader).\n* [Serial Line CAN](https://elixir.bootlin.com/linux/latest/source/drivers/net/can/slcan/slcan-core.c) (SLCAN) interface - Silent mode, RX only.\n\n## Flash instructions\nThe default method to upload new firmware is via [dfu-util](http://dfu-util.sourceforge.net/). The Makefile includes the `dfuse-flash` target to invoke dfu-util. dfu-util automatically detaches the dap42 firmware and uploads the firmware through the on-chip bootloader.\n\nTo flash via another debugger, use `make flash`.\n\nFor detailed flashing instructions, see [FLASHING.md](./FLASHING.md)\n\n### STM32F103\nThe dap42 firmware can also target the STM32F103 chip.\n\nTo build firmware for STLink/v2 knockoff designs, use the `STM32F103` target or `STM32F103-DFUBOOT` target when using the [dapboot](https://github.com/devanlai/dapboot) bootloader. The CDC UART is connected to the `SWIM` pin (`PB11`) as an RX-only input.\n\nTo build firmware for the \"bluepill\" dev board, use the `STM32F103-BLUEPILL` or `STM32F103-BLUEPILL-DFUBOOT` targets.\n\nThe pin mapping is as follows:\n\n| Signal | Pin  |\n| ------ | ---- |\n| SWDIO  | PB14 |\n| SWCLK  | PB13 |\n| RESET  | PB0  |\n| TX     | PA2  |\n| RX     | PA3  |\n\nNote: due to hardware limitations, all STM32F103 targets as implemented are limited to one of either the CMSIS-DAP v1 HID interface or the CMSIS-DAP v2 bulk interface.\nBy default, all STM32F103 targets use the v2 bulk interface.\nIf you prefer the v1 HID interface, use the `STM32F103-HID` targets instead of `STM32F103`.\n\n## Usage\n### OpenOCD\nThe dap42 firmware has been tested with gdb and OpenOCD on STM32F042 (of course), STM32F103, and LPC11C14 targets.\n\nIn general, the probe can be used with OpenOCD just by specifying the cmsis-dap interface:\n\n    openocd -f interface/cmsis-dap.cfg -f your_config.cfg -c \"some inline command\"\n\nExample OpenOCD configurations can be found under the [openocd/](openocd/) folder.\n\n### MCUXpresso\nThe default probe detection rules used by MCUXpresso (formerly LPCXpresso) will not auto-discover generic CMSIS-DAP probes.\nTo use the dap42 probe with MCUXpresso, you can modify the detection rules by editing `probetable.csv` in your MCUXpresso installation.\n\nFor MCUXpresso version 11.4 or newer, edit `probetable.csv` under `ide/plugins/com.mcuxpresso.tools.bin.\u003c...\u003e/binaries/Scripts`:\n\n    0x1209, 0xDA42, 64, 1, 0, 0, 0, \"\", 0x0000, -1, -1\n\nIn older versions, the CSV format has one fewer entry at the end:\n\n    0x1209, 0xDA42, 64, 1, 0, 0, 0, \"\", 0x0000, -1\n\nPlease note: in the most recent version of MCUXpresso, `probetable.csv` no longer exists and does not support custom CMSIS-DAP probes.\n\n### USB-serial\n#### Windows\nOn Windows 10, the serial port works without requiring additional configuration.\n\nFor Windows XP through Windows 7, the [DAP42CDC.inf](drivers/DAP42CDC.inf) `.inf` file can be used to load the generic USB serial driver.\n\n#### Mac OSX\nOn Mac OSX version 10.7 and later, the serial port should work without requiring any additional configuration.\n\n#### Linux\nOn Linux, the serial port should be detected without requiring additional configuration.\nDepending on your distro settings, the modem manager may attempt to grab the serial port and use it as a modem.\nTo prevent this, you can define a custom udev rule to ensure that the modem manager ignores the debugger.\n\n    ATTRS{idVendor}==\"1209\" ATTRS{idProduct}==\"da42\", ENV{ID_MM_DEVICE_IGNORE}=\"1\"\n\n### Bulk interface\nOn some targets, the CMSIS-DAP v2 bulk USB interface is now enabled by default. In general on Windows it should\nautomatically bind the generic WinUSB driver through MS OS descriptors, but this may not work on very old versions\nof Windows or on machines where the USB VID/PID pair for dap42 has already been associated with an older version\nof firmware without bulk interfaces.\n\nYou can use [Zadig](https://zadig.akeo.ie/) to manually bind the WinUSB driver of the bulk interface (also the\nDFU runtime interface, if using a bootloader).\n\n## Acknowledgements\nThe dap42 project was inspired by the [Dapper Mime](http://dappermime.sourceforge.net/) CMSIS-DAP proof-of-concept project.\n\nThe dap42 USB VID/PID pair is [1209/DA42](http://pid.codes/1209/DA42/), allocated through the [pid.codes](http://pid.codes/) open-source USB PID program.\n\n## Licensing\nAll contents of the dap42 project are licensed under terms that are compatible with the terms of the GNU Lesser General Public License version 3.\n\nNon-libopencm3 related portions of the dap42 project are licensed under the less restrictive ISC license, except where otherwise specified in the headers of specific files.\n\nSee the LICENSE file for full details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevanlai%2Fdap42","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevanlai%2Fdap42","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevanlai%2Fdap42/lists"}