I'm in the process of developing a device driven by an STM32F030C8T6.

I want this to be programmable over USB (similar to ST-Link) to make development easier.

I'm led to believe that ARM DAPLink provides this sort of functionality.

My understanding of the process to integrate this is as follows:

  1. Design my main circuit (including the ARM chip (U1) for that).
  2. Add a secondary ARM chip (U2) to act as the DAPLink controller.
  3. Connect two GPIO pins of U2 to the SWD_CLK and SWD_IO pins of U1.
  4. Connect U2 to a USB interface
  5. Flash DAPLink to U2 with a SWD Programmer
  6. Flash application to U1 via USB and U2.

However, the documentation doesn't seem to be the best, and I can't find a reference implementation so, I'd apprreciate an answer that covers the following:

  1. Is the above procedure roughly correct? If not, the premise of this whole question is wrong...
  2. Is there a minimal reference implementation I can use for Step 2 above?
  3. Is Step 5 above permanent, or would it need to be repeated each time I power-cycle the device? I'm not sure if ST32s have non-volatile storage on-board.
  • \$\begingroup\$ Why do you want to integrate a custom JTAG/SWD adapter onto custom PCB? Normally you would buy an ST-Link and use it to develop any amount of custom boards as long as the custom board has a standard JTAG/SWD connector. And that is necessary only if you want to debug over JTAG/SWD. These MCUs have bootloaders so if you only need to update firmware it can be done over UART. \$\endgroup\$
    – Justme
    Sep 17 at 23:58
  • \$\begingroup\$ @Justme - I just think it would be quite nice to be able to reprogram and debug my design without the need for a separate bit of hardware that I will inevitably lose. Plus, it's a bit of a learning exercise too. Ideally, I could do with having full debugging but I didn't know you could program them over uart, I thought it had to be done over SWD \$\endgroup\$ Sep 18 at 0:12
  • \$\begingroup\$ I don't see why it would make sense. For a small project with this small MCU, the debugging interface requires a bigger and more expensive MCU than the target, plus extra components, and space on PCB. \$\endgroup\$
    – Justme
    Sep 18 at 0:15
  • \$\begingroup\$ You can't see it being useful not needing a separate piece of hardware to program/debug a device? \$\endgroup\$ Sep 18 at 0:16
  • \$\begingroup\$ No. Because like I said, you only need debugger for debugging. Firmware updates are possible without debugger. If you use a larger MCU with USB, you can directly use the USB for updating the firmware. An ST-Link is very cheap too, and you only need one. \$\endgroup\$
    – Justme
    Sep 18 at 0:18


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.