wuxx / nanoDAP-HS

DAPLink High Speed
GNU General Public License v3.0
113 stars 25 forks source link

Please update firmware to v0257 to support multi-drop #9

Open CoelacanthusHex opened 1 year ago

CoelacanthusHex commented 1 year ago

Openocd added multi-drop support, but it needs CMSIS-DAP support SWD_Sequeue. It means we need a firmware that is newer than this commit, for version, it is v0257. If no newer firmware, nanoDAP-HS can't debug hardware with multi-drop, such as Raspberry Pi Pico. Hope nanoDAP-HS can be better and better.

flaviut commented 1 year ago

According to the readme, the firmware is just DAPLink. You can compile it using these instructions. The command is python tools/progen_compile.py -v sam3u2c_if.

I've been unable to test myself due to some issues with drag-and-drop programming on my device, but please tell me if it works.

CoelacanthusHex commented 1 year ago

I've been unable to test myself due to some issues with drag-and-drop programming on my device, but please tell me if it works.

I tried to compile it by myself before but met the same problem.

flaviut commented 1 year ago

I spoke with wuxx on AliExpress, and I think I have the situation cleared up, at least for me. There's two debug probes models here, and the branding is confusing:

I've also done a bit of my own poking around, and I think I have a pinout for the nanoDAP debug header:

Mini-DAPLink-Debug-Probe-TYPE-C-STM32-NRF51-52-ARM-Cortex-M-MCU-JTAG-SWD-CDC jpg_Q90

CoelacanthusHex commented 1 year ago

I spoke with wuxx on AliExpress, and I think I have the situation cleared up, at least for me. There's two debug probes models here, and the branding is confusing:

* The nanoDAP is about $6, uses an GD32F150G8 MCU, and doesn't support USB Mass Storage-based flashing. wuxx said that it runs proprietary firmware, although it looks like this is it? [wuxx/nanoDAP@`master`/software](https://github.com/wuxx/nanoDAP/tree/master/software?rgh-link-date=2022-10-16T13%3A05%3A16Z)

* The nanoDAP-HS is about $15, uses an ATMEL SAM3U MCU, and supports USB Mass Storage-based flashing. I assume the upstream DAPLink works on this device.

I've also done a bit of my own poking around, and I think I have a pinout for the nanoDAP debug header:

Mini-DAPLink-Debug-Probe-TYPE-C-STM32-NRF51-52-ARM-Cortex-M-MCU-JTAG-SWD-CDC jpg_Q90

What I have is the nanoDAP-HS version, the board silkscreen is "nanoDAP-hs v1.3", and the SoC silkscreen is "Atmel ATSAM3U2C AU", but I still cannot use USB Mass Storage-based flashing with the official DAPLink firmware.

Krensi commented 1 year ago

@flaviut did you actually manage to flash the rp2040 using the nanoDAP? I plan to update the firmware of the nanoDAP as you described above. :-)

I have version V1.5 but I always get a SWD Sequence expected error when I try to flash the rp2040 with pyocd..

flaviut commented 1 year ago

Yup, I've had great luck flashing my rp2040 with the nanodap-hs. Iirc I had to pull the latest upstream changes into the port's repo.

BobbyCounts commented 7 months ago

@flaviut Is the pin configuration different from what is default in daplink for the sam3u2c target? I tried compiling the latest daplink but when I upload I get nothing.

flaviut commented 7 months ago

I wish I could answer... I went through my files and I wasn't able to find the configuration I used. Sorry :(

flaviut commented 5 months ago

I recently needed to update a new device. First I checked out the latest tagged version: git checkout v0257, then applied this patch:

diff --git a/records/tools/gcc_arm.yaml b/records/tools/gcc_arm.yaml
index 3ca532e6..0e54800d 100644
--- a/records/tools/gcc_arm.yaml
+++ b/records/tools/gcc_arm.yaml
@@ -31,6 +31,7 @@ tool_specific:
                 - -Wl,--gc-sections
                 - -Wl,--no-wchar-size-warning
                 - -Wl,--print-memory-usage
+                - -Wl,--no-warn-rwx-segment
             pre_build_script:
                 - tools/pre_build_script.py
             post_build_script:
diff --git a/source/daplink/sdk_stub.c b/source/daplink/sdk_stub.c
index e9116a63..87a2736b 100644
--- a/source/daplink/sdk_stub.c
+++ b/source/daplink/sdk_stub.c
@@ -25,3 +25,8 @@ __WEAK void sdk_init()
 {
     // Do nothing
 }
+
+void _close_r(void) {}
+void _lseek_r(void) {}
+void _read_r(void) {}
+void _write_r(void) {}

here's my bin file, which I dragged into the MAINTENANCE drive: sam3u2c_if.bin.zip