From: <kri...@te...> - 2020-01-16 12:28:47
|
Hi Antonio, First of all many thanks for getting the SWDAP probe functioning with OpenOCD ^_^. Probe hardware problem ----------------------- I've replaced the three 470Ω resistors with 24Ω resistors (see https://github.com/ARMmbed/mbed-HDK-Eagle-Projects/issues/1#issuecomment-575122948) Probe firmware selection ------------------------- The firmwares for the SWDAP probe can be found at: https://github.com/ARMmbed/DAPLink/releases The firmware naming convention is: [Version]_[Probe Chip]_[Target Chip]_[Offset].bin The "Probe chip" must match the chip on the probe itself. For the SWDAP, that's the LPC11U35. The "Target Chip" must only match your target if you're planning to use the drag-and-drop flashing feature. But since I'm going to flash with OpenOCD (not through drag-and-drop in the file explorer), this "Target Chip" field doesn't matter. The latest v0254 release has a "general" firmware being "target-agnostic" (the target-field in the name is empty). As I'm not using the drag-and-drop flashing, this choice makes most sense to me. So I've downloaded the "0254_release_package_f499eb6e.zip" from the releases page. After unzipping, I choose the target-agnostic "0254_lpc11u35_0x0000.bin" firmware binary and put that on my SWDAP probe. Note: Here is explained how exactly I "put" this firmware on my SWDAP probe: https://electronics.stackexchange.com/questions/465187/how-to-update-the-swdap-firmware Probe failure with OpenOCD --------------------------- I'm happy to read in your mail that you successfully flashed your target chip with your SWDAP probe and OpenOCD: > Then, with the HW fix, I succeed to run the interface with any FW > version from v0240 to v0254 available in > https://github.com/ARMmbed/DAPLink/releases > I have used as target a STM32F411, and the FW I have flashed is always > the one named > 02XX_lpc11u35_lpc824xpresso_0x0000.bin > that seams compatible with the STM32 (there is no specific one for STM32!) > All these FW are either cmsis-dap V1.00 or V1.10 Unfortunately, I still have a failure in OpenOCD when I attempt to flash. OpenOCD outputs the following: $ Open On-Chip Debugger 0.10.0+dev-00973-g80f1a92bd (2019-12-02-17:58) $ Licensed under GNU GPL v2 $ For bug reports, read $ http://openocd.org/doc/doxygen/bugs.html $ swd $ srst_only separate srst_nogate srst_open_drain connect_deassert_srst $ $ Error: CMSIS-DAP command CMD_INFO failed. Maybe because the probe firmware could be cmsis-dap V2 instead of cmsis-dap V1? The problem is: I don't know if the firmware is cmsis-dap V1 or cmsis-dap V2. I have no idea where I can see that particular information. On the release page of the probe's firmwares, I simply download the zipped folder "0254_release_package_f499eb6e.zip". I don't know if that's cmsis-dap V1 or V2. Patching OpenOCD ----------------- It is truly amazing you were able to patch OpenOCD: > cmsis-dap v2 is a game changer! Does not use USB HID anymore but USB > bulk! The driver in OpenOCD does not support it! > The cmsis-dap messages seams the same, but the protocol below is different. > I have sniffed the USB communication by pyocd and quickly patched > OpenOCD to behave in the same way. It works fine. > I have just pushed in gerrit a test "work-in-progress" proof-of-concept. > http://openocd.zylin.com/5394 > It will require some additional work before being ready for merge, but > it's functional. Unfortunately, I don't know how to build OpenOCD for Windows with your patch in it. The way I build OpenOCD is simply following this guide: https://www.playembedded.org/blog/building-openocd-under-windows-using-msys2/ Perhaps I should change a few commands in the guide to include your patch. But I don't know how. Any help on this is highly appreciated :-) Again many many thanks for your help. I appreciate it very much. Kind greetings, Kristof > Hi Kristof, > > thanks for the SWDAP device you have shipped to me. I succeed to make > it working with OpenOCD. > > First of all, a critical HW issue, already logged in > https://github.com/ARMmbed/mbed-HDK-Eagle-Projects/issues/1 > You need to replace the resistors R9, R11 and R13, otherwise the > interface will not work properly, even with the original cmsis-dap FW > programmed in SWDAP. > Without this change I get errors even with adapter speed at 1 kHz. > > Then, with the HW fix, I succeed to run the interface with any FW > version from v0240 to v0254 available in > https://github.com/ARMmbed/DAPLink/releases > I have used as target a STM32F411, and the FW I have flashed is always > the one named > 02XX_lpc11u35_lpc824xpresso_0x0000.bin > that seams compatible with the STM32 (there is no specific one for STM32!) > All these FW are either cmsis-dap V1.00 or V1.10 > > In the same repository there are FW that are instead cmsis-dap v2 ! > But only one is available for SWDAP, 0254_lpc11u35__0x0000.bin > Other interfaces support cmsis-dap v2 from earlier FW revision but I > do not have them! > > In version 0254 there is also a FW for ST-Link HW > (0254_stm32f103xb__0x0000.bin) but without the bootloader! I have > recompiled it to test also this HW. > It also uses cmsis-dap v2 > > cmsis-dap v2 is a game changer! Does not use USB HID anymore but USB > bulk! The driver in OpenOCD does not support it! > The cmsis-dap messages seams the same, but the protocol below is different. > I have sniffed the USB communication by pyocd and quickly patched > OpenOCD to behave in the same way. It works fine. > I have just pushed in gerrit a test "work-in-progress" proof-of-concept. > http://openocd.zylin.com/5394 > It will require some additional work before being ready for merge, but > it's functional. > Would you mind testing it on your side? (after replacing the > resistors, of course). > > Antonio |