SushiBits / DAP42-Firmware

CMSIS-DAP debug probe based on STM32F042
Other
10 stars 6 forks source link

Need document how to compile a working JTAG debugger #1

Open sztsian opened 4 years ago

sztsian commented 4 years ago

Hi,

First thanks for the great work of SushiBits. I'm just a hobbyist (and a newbie) so don't know much about embedded. Now that there is a new chip GD32VF103 which is RISC-V based, and said to be pin-to-pin compatible with STM32F103, so I am thinking if I can get it working with some arduino compatible board and then learn about it, so I find SushiBits. However I cannot get the DAP42 firmware working.

From the branch name, I think the sb1 branch is for the SushiBits, so I switched to it and installed GNU MCU Eclipse to compile. Given I did not find a .cproject for compiling, I copied it from the master branch. After flashing into STM32F042F6P6, system can detect it in USB

$ lsusb ...... Bus 003 Device 008: ID 0002:d401 Ingram
...... $ dmesg | tail
[29807.595671] usb 3-4.1.1.2: USB disconnect, device number 7 [29807.599706] cdc_acm 3-4.1.1.2:1.1: failed to set dtr/rts [29811.979782] usb 3-4.1.1.2: new full-speed USB device number 8 using xhci_hcd [29812.169925] usb 3-4.1.1.2: New USB device found, idVendor=0002, idProduct=d401, bcdDevice= 0.10 [29812.169932] usb 3-4.1.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=254 [29812.169936] usb 3-4.1.1.2: Product: One Pro STM32F103 with CMSIS-DAP [29812.169938] usb 3-4.1.1.2: Manufacturer: SushiBits [29812.169940] usb 3-4.1.1.2: SerialNumber: FFFC1C12 [29812.182598] hid-generic 0003:0002:D401.0004: hiddev97,hidraw2: USB HID v1.11 Device [SushiBits One Pro STM32F103 with CMSIS-DAP] on usb-0000:00:14.0-4.1.1.2/input0 [29812.183078] cdc_acm 3-4.1.1.2:1.1: ttyACM0: USB ACM device

However, openocd do not work. I am trying against a GD32F103C8 ( the ARM Cortex M3 one, which IIUC is compatible with STM32F103C8)

$ openocd -f interface/cmsis-dap.cfg -f target/stm32f1x.cfg Open On-Chip Debugger 0.10.0 Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : auto-selecting first available session transport "swd". To override use 'transport select '. adapter speed: 1000 kHz adapter_nsrst_delay: 100 none separate cortex_m reset_config sysresetreq Info : CMSIS-DAP: SWD Supported Info : CMSIS-DAP: JTAG Supported Info : CMSIS-DAP: Interface Initialised (SWD) Info : CMSIS-DAP: FW Version = 2.0.0 Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 1 nTRST = 1 nRESET = 1 Info : CMSIS-DAP: Interface ready Info : clock speed 1000 kHz in procedure 'init' in procedure 'ocd_bouncer'

$ openocd -f interface/cmsis-dap.cfg -c "transport select jtag" -f target/stm32f1x.cfg Open On-Chip Debugger 0.10.0 Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html jtag adapter speed: 1000 kHz adapter_nsrst_delay: 100 jtag_ntrst_delay: 100 none separate cortex_m reset_config sysresetreq Info : CMSIS-DAP: SWD Supported Info : CMSIS-DAP: JTAG Supported Info : CMSIS-DAP: Interface Initialised (JTAG) Info : CMSIS-DAP: FW Version = 2.0.0 Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 1 nRESET = 1 Info : CMSIS-DAP: Interface ready Info : clock speed 1000 kHz Info : cmsis-dap JTAG TLR_RESET Info : cmsis-dap JTAG TLR_RESET Error: JTAG scan chain interrogation failed: all ones Error: Check JTAG interface, timings, target power, etc. Error: Trying to use configured scan chain anyway... Error: stm32f1x.cpu: IR capture error; saw 0x0f not 0x01 Info : cmsis-dap JTAG TLR_RESET Warn : Bypassing JTAG setup events due to errors Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Could not initialize the debug port ^C

I tried to flash the origin DAP42 by Devan Lai, it works fine, and I can download program into the GD32F103. So I believe it's not my soldering issue.

So can you point me if it is possible to run DAP42 with JTAG support in STM32F042F6P6? If so, can you point me how can I build the firmware (or can you provide me a working firmware)?

Thanks.

xcvista commented 4 years ago

This project is incomplete: the CMSIS-DAP USB transport is known to be broken. If you know how to work with bare metal STM32 and libusb_stm32 (the USB driver library I am using) I am welcoming your contribution.