5 years ago.

Use CMSIS DAP Interface to program/debug a STM32 board?

Hi, we are developing 3, lost cost STM32 based boards. For details, see this page: http://forum.modtronix.com/index.php?topic=2197.msg10061#msg10061

For programming, we would like an optional small daughter board that can plug into this board (see link above for details). For this small board, we can either:

1) Copy the circuit use on STM32 Nucleo boards, Will provide ST-Link(program/debug), Virtual Serial Port and Mass Storage device for programming.

2) Use the mbed CMSIS-DAP Interface Firmware. Will provide CMSIS-DAP(program/debug), Virtual Serial Port and Mass Storage device for programming.

For option 1, we are currently trying to get a reply from ST if they will allow us to do that.

For option 2, it seems like the current CMSIS-DAP Interface firmware will not support programming a STM32 processor? Is this correct?

Does anyone know if the current CMSIS-DAP Interface firmware allows for programming/debugging STM32 chips? If not, how much work will it be to get that to work.

Question relating to:

CMSIS-DAP supports ST microcontrollers. We have tested this already.

posted by Reinhard Keil 21 Nov 2014

Hi, thanks for reply! But, are you talking about the "CMSIS-DAP Interface Firmware", or just CMSIS DAP? I am new to CMSIS-DAP, so excuse me if my question doesn't make too much sense. I need to be able to program/debug a STM32 chip using the "CMSIS-DAP Interface Firmware" available on mbed.

posted by modtronix H 21 Nov 2014

More detail on what I want to do. I want to embed the "CMSIS-DAP Interface Firmware" on my board. See this page: http://developer.mbed.org/handbook/cmsis-dap-interface-firmware My board has a STM32L151 chip. So, I need to implement the "CMSIS-DAP Interface Firmware" on my board. For example, using the LPC11U35 chip. The LPC11U35 chip will be programmed with the "CMSIS-DAP Interface Firmware" made available by mbed. The SWDIO/SWCLK/NRST/UART TX/UART RX pin pins of the LPC11U35 chip is connected to my STM32L151 chip.

My question is, will this work? Does the current "CMSIS-DAP Interface Firmware" support STM32 chips? From reading documentation, and looking at "CMSIS-DAP Interface Firmware" source code, it does NOT seem like it will work? It does not seem to support STM32 chips.

posted by modtronix H 21 Nov 2014

1 Answer

5 years ago.

So it seems like the part of the CMSIS-DAP firmware which won't work for you is the MSD portion since it contains no code to program the FLASH on these parts. What if you just get the virtual serial port and core SWD debugger support up and running though. I see that pyOCD contains some code which would allow programming of STM32F103RC devices if basic SWD debugging support is working. Maybe you could start with this and extend/port for your particular device?


Accepted Answer

Adams answer is correct. As long as the chips support a standard hardware reset using the CMSIS-DAP code base you can get all functionality minus the drag and drop programming.

To add drag and drop programming to this code base have a look at these guides.

  1. http://developer.mbed.org/handbook/cmsis-dap-interface-firmware#supporting-a-new-target
  2. http://developer.mbed.org/handbook/cmsis-dap-interface-firmware#flash-algorithms
  3. http://www.keil.com/support/man/docs/uv4/uv4_fl_flash_algorithms.htm

Looks like I need to spend some time cleaning these docs up a bit D:

posted by Sam Grove 22 Nov 2014