CMSIS-DAP debugger port to STM32

ARM publish new CMSIS-DAP debug interface software (link to Keil).
This is initial port to STM32F103C8 processor.
Based on STM32 RF adapter (second board in post w/o RF parts).

Extract CMSIS_DAP_STM32.rar to CMSIS_DAP folder.
See DAP_config.h for pin definition and usbd_STM32F103.c for pin definitions.


39 comment(s) so far

  1. Dear Sir,

    I've got the STM32 CMISIS-DAP source code load the firmware into my custom Jtag cable. However, when programming the target, the verify error message appears. I'm using Keil V4.70, many thank for your help.

    Best Regards

  2. I can't help you because not a telepathist.

    Try use last version from github.

    Best wishes

  3. I can't help you because not a telepathist.

    Try use last version from github.

    Best wishes

  4. Dear Sir,

    Problem solved.

    I've built my own hardware and it works fine.

    Many thanks for your sharing source code...

    The bellow link is my project resource...


  5. I'm very glad to help you.

    Good luck

  6. Hi,

    I just tried your code with my board, there is an USB error like "The drivers for this device are not installed. (Code 28)"

    As I checked with USBViewer, the error is :

    Open Pipes: 0

    *!*ERROR: No open pipes!

  7. HI, you need check signal for pull-up D+ line, PA11 and PA12 usually use for STM32 MCU but pull-up may be diffirent. See HW folder for schematics and FW for pins definitions.

  8. Update driver from Device manager and use inf file


  9. Dear Admin,

    Thanks very very much! I updated the driver does fix this error, and I can see my CDC device now, but strange thing is my HID device still not available, only CDC device found.

  10. HID device added as HID device. Easy way to check - open in Keil IDE

  11. Hi thanks! I found it! But still their is a device USB DCI not installed properly and I am not sure how to install it!

  12. I can only suggest connect debugger and check protocol inside CMSIS adapter firmware

  13. Hi, I noticed that you are adding support for ST-Link V2 hardware (V3). Does it work? Thanks.

  14. Yes, i use cheapest ST-Link V2 adapters for CMSIS-DAP

  15. Hi, thank you for the great job. I tested your f/w on stm32f072b-disco board (with st-link v2). It works on uv4 (win xp) & latest openocd (ubuntu 12.04).

    BTW, does your f/w work for st-link v2-1 (with Tx/Rx)?

  16. hi, i am getting RDDI-DAP error while flashing code to stm32Discovery board.can you have solution for that

  17. No, i can't help

  18. Hello,

    Can you add some compiled firmware images to github? I would like to flash my mini st-link v2 devices with the CMIS-DAP firmware without having to setup the Keil toolchain.

  19. Wow, that's fast! Thanks! I'll try to flash some ST-LINK V2 mini adapters from aliexpress. How did you program yours? I'm thinking of using the on board swd interface. Do you know a way to use the usb interface?

  20. I have just programmed a ST-LINK V2 mini adapter with the cmsis-dap firmware. Then I used CooCox CoFlash to connect to a STM32F030 device using swd which succeded! Great!

    Thanks a lot!

  21. Here is a link to some info about programming the ST-LINK V2 mini adapters with the CMSIS-DAP firmware.. mvdlande.wordpress.com/.../cmsis-dap-on-a-

  22. OK - good luck in programming

  23. Question about AXI-AP?

    I have a problem with access memory (read/write data)"Sram" using the CMSIS-DAP protocol.The access port used is AXI-AP.

    Although I can read/write data when I used AHB-AP and APB-AP.

    So can you help me about this problem if we have another configuration within the register CSW or TAR or barrier transaction?

    you find below the code of function read data that i used:

    // RDDI-DAP Read Data

    // adr : Address

    // val : Pointer to Value

    // return : 0 - Success, else Error Code

    static int RDDI_DAP_ReadData (DWORD adr, DWORD *val) {

    int status;

    int regID[2];

    int regData[2];

    if (rddiHandle == NULL) return (RDDI_DAP_ERROR_INTERNAL);

    // TAR = adr

    regID[0] = DAP_AP_REG_TAR;

    regData[0] = adr;

    // DRW read

    regID[1] = DAP_AP_REG_DRW | DAP_REG_RnW;

    // R/W DAP Registers

    status = rddi_DAP_RegAccessBlock(rddiHandle, rddiDAP_ID, 2, regID, regData);

    status = RDDI_DAP_CheckStatus(status);

    if (status) return (status);

    *val = regData[1];

    return (0);


  24. Can't help you because not use.

  25. Can you add flash on the CMSIS-DAP based on STM32?

  26. Hello,

    I tried CMSIS-DAP on ST-LinkV2 dongle using Keil but found some issues with nRESET signal: the target could not reset nor I could use the "attach under reset" debugger option. The logic analyzer could not see any activity on this signal either.

    I checked where the nRESET pin is connected on this board and sorted out that it is hooked to PB6 (Pin 42), and not PB0 as reported in the code.

    I changed to correct pin and now it's working like a charm. Is the dongle I have yet a different hardware version ? Or is there actually a minor bug in the code ?

    Thanks for your attention



  27. Hello,

    I have various version of dongle - so may be make a mistake.

    I'll review and fix



  28. Great work, many thanks !

    I'll try to turn the Chinese board described here: github.com/.../2_-Board-descri into CMSIS-DAP with your software to show to my friend (we share hobby to make small things with MCU).

    I hope that your version for STLink.v21 will work there.

    I'll try the hex, since I work with GCC and don't have uVision to compile it myself.

    Still wonder where to wire the target swd clock and target swd data - probably T_JTCK(PA5 or PB13 - same signal name@STLink.v21.pdf) and T_SWO (PA10).

  29. Question about CMSIS-DAP debugger port to STM32

    Build target 'STM32F103C8'

    compiling system_stm32f10x.c...

    system_stm32f10x.c(65): error: #5: cannot open source input file "stm32f10x.h": No such file or directory

    #include "stm32f10x.h"

    system_stm32f10x.c: 0 warnings, 1 error

    assembling startup_stm32f10x_md.s...

    compiling usb_config.c...

    usb_config.c(502): error: #5: cannot open source input file "usb_lib.c": No such file or directory

    #include <usb_lib.c>

    usb_config.c: 0 warnings, 1 error

    compiling usbd_STM32F103.c...

    usbd_STM32F103.c(14): error: #5: cannot open source input file "RTL.h": No such file or directory

    #include <RTL.h>

    usbd_STM32F103.c: 0 warnings, 1 error

    compiling main.c...

    main.c(23): error: #5: cannot open source input file "RTL.h": No such file or directory

    #include <RTL.h>

    main.c: 0 warnings, 1 error

    compiling usbd_user_hid.c...

    usbd_user_hid.c(13): error: #5: cannot open source input file "RTL.h": No such file or directory

    #include <RTL.h>

    usbd_user_hid.c: 0 warnings, 1 error

    compiling DAP.c...

    DAP.c: Error: #5: cannot open source input file "..\DAP.c": No such file or directory

    ..\DAP.c: 0 warnings, 1 error

    ".\build\CMSIS_DAP.axf" - 6 Error(s), 0 Warning(s).

    Target not created

  30. Hi,

    correct include paths.

  31. Hi, X893,

    I have some problem when I test your CMSIS-DAP code on my STM32 board. When I flash the code into my STM32 board, I can see the COM4 interface in my PC, but I can not see the HID device. Do you mind give your e-mail address to me, I want to communicated with you easily. Thanks. Please forgive my poor English. I hope you can understand it.

  32. Hello, do you have any interest in porting your project to make, compile & link with GNU tools ( makefile, arm-gcc-none-eabi ) ?

  33. no, i havn't

  34. good

  35. Hi, any chance on having the MSC too?

    Drag and drop flash as disk functionality?

  36. Hi,

    Please help me. I'd like to flash mini st-link v2 to cmsis-dap. I'm using openocd 0.11.0+dev. Which .cfg file should be used for "target"?

  37. I never use OpenOCD

Post your comment

Thanks for your comments

  • Comment



Subscribe to x893 blog Subscribe