Skip to content

CMSIS-DAP debugger firmware for STM32F042Fx and STM32F103xx

License

Notifications You must be signed in to change notification settings

unwireddevices/dap42

 
 

Repository files navigation

dap42

The dap42 project is an open-source firmware and hardware design for an inexpensive, minimalist CMSIS-DAP based debug probe based on the STM32F042F6 in a TSSOP-20 package.

This project is stable - it has been proven in the field by a few dozen users and all core functionality has been tested.

Current features

Unwired Devices

UMDK-RF target was added to support UMDK-RF v.1.07 board by Unwired Devices. make UMDK-RF to build it.

Changes:

  • BOOT0 pin disabled, power up board with BOOT0 tied to GND to enter STM32 DFU
  • UMDK-RF specific functions added (power control, target BOOT0 control etc.)
  • Current consumption measurements on boards equipped with INA214 sensor and shunt resistor

Firmware

Flash instructions

The default method to upload new firmware is via dfu-util. 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.

To flash via another debugger, use make flash.

For detailed flashing instructions, see FLASHING.md

STM32F103

The dap42 firmware can also target the STM32F103 chip. The CDC UART is connected to PB11 (the SWIM pin on certain STLink/v2 knockoff designs) as an RX-only input.

Usage

OpenOCD

The dap42 firmware has been tested with gdb and OpenOCD on STM32F042 (of course), STM32F103, and LPC11C14 targets.

In general, the probe can be used with OpenOCD just by specifying the cmsis-dap interface:

openocd -f interface/cmsis-dap.cfg -f your_config.cfg -c "some inline command"

Example OpenOCD configurations can be found under the openocd/ folder.

LPCXpresso

As of LPCXpresso 8.0.0, the default probe detection rules will not auto-discover generic CMSIS-DAP probes. To use the dap42 probe with LPCXpresso, you can modify the detection rules by editing lpcxpresso/bin/Scripts/probetable.csv in your LPCXpresso installation.

Add the following line to probetable.csv:

0x1209, 0xDA42, 64, 1, 0, 0, 0, "", 0x0000, -1

USB-serial

Windows

On Windows 10, the serial port works without requiring additional configuration.

For Windows XP through Windows 7, the DAP42CDC.inf .inf file can be used to load the generic USB serial driver.

Mac OSX

On Mac OSX version 10.7 and later, the serial port should work without requiring any additional configuration.

Linux

On Linux, the serial port should be detected without requiring additional configuration. Depending on your distro settings, the modem manager may attempt to grab the serial port and use it as a modem. To prevent this, you can define a custom udev rule to ensure that the modem manager ignores the debugger.

ATTRS{idVendor}=="1209" ATTRS{idProduct}=="da42", ENV{ID_MM_DEVICE_IGNORE}="1"

Planned features

Firmware

  • CMSIS-DAP 1.10 support
  • Command queueing (command level, not packet level)
  • Serial Wire Output (SWO) trace support
  • CMSIS-DAP 2.0 support
  • Bulk endpoints for higher throughput
  • WebUSB compatibility

Hardware

  • Simultaneous USB-serial bridge and SWO trace using an STM32F042K6 in an LQFP-32 package with both UARTs pinned out.
  • Level-shifting/protective tri-state buffer between the probe and target SWD port.

Acknowledgements

The dap42 project was inspired by the Dapper Mime CMSIS-DAP proof-of-concept project.

The dap42 USB VID/PID pair is 1209/DA42, allocated through the pid.codes open-source USB PID program.

Licensing

All contents of the dap42 project are licensed under terms that are compatible with the terms of the GNU Lesser General Public License version 3.

Non-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.

See the LICENSE file for full details.

About

CMSIS-DAP debugger firmware for STM32F042Fx and STM32F103xx

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 95.0%
  • Makefile 4.7%
  • Shell 0.3%