Commit Graph

119 Commits

Author SHA1 Message Date
Jonathan Bell
466432c5eb Debugprobe release v2.2.3 debugprobe-v2.2.3 2025-07-07 15:00:38 +01:00
Jonathan Bell
9f44aa79cb submodules: delete CMSIS_5 from the repository
See https://github.com/raspberrypi/pico-setup/issues/57

Clones of debugprobe or invocations of pico-setup.sh frequently
encounter errors relating to bandwidth budgets. These sporadic errors
are due to the large size of the CMSIS_5 repo clone exhausting the
bandwidth quotas on Github, so drop this in favour of a downstream copy
of the relevant CMSIS-DAP firmware files.

Users are advised to delete and regenerate the build directory.

Optionally, reclaim filesystem space by removing .git/modules/CMSIS_5
and all subdirectories.
2025-07-07 14:52:52 +01:00
Jonathan Bell
c8d5b552b6 CMakelists.txt: use downstream copies of CMSIS_5 files
This change will require re-running cmake in the build directory.
2025-07-07 14:52:52 +01:00
Jonathan Bell
d91503b68c Add downstream copies of CMSIS_5 files relevant to CMSIS-DAP firmware
From tag v2.0.0. Not used in the project yet.
2025-07-07 14:52:52 +01:00
Jonathan Bell
61eae8217c Remove spurious file 2025-05-14 14:50:22 +01:00
Jonathan Bell
aa17d6d982 probe: correct SWCLK calculations
Use the actual clk_sys frequency and Round divisors up, otherwise high
swclk speeds get significantly overclocked.
2025-05-14 14:16:56 +01:00
graham sanderson
a7b796d5e6 Revert "Fix variable pathname spacing"
This reverts commit 1abda4c329.
2025-05-14 13:15:45 +01:00
P33M
3a356ea346 Update README.md 2025-03-27 15:53:56 +00:00
Jonathan Bell
c70815a297 Debugprobe release v2.2.2
Point release to address high uart TX baud rate corruption, at the
expense of throughput.

Also skip over an attempt at UART/SDK optimisation that caused issues
for users.
2025-03-13 16:36:24 +00:00
Jonathan Bell
f601757084 Revert "cdc_uart: performance optimisations"
This reverts commit 83e28db1d3.
2025-03-13 11:11:27 +00:00
TankedThomas
1abda4c329 Fix variable pathname spacing
Signed-off-by: TankedThomas <TankedThomas@users.noreply.github.com>
2025-03-11 09:50:23 +00:00
Jonathan Bell
83e28db1d3 cdc_uart: performance optimisations
For RX, do burst reads without the SDK wrapper function which checks
the FIFO flags for each read.

For TX, avoid waiting for the FIFO to have space available, which
causes significant thread stalls. Use a slightly pessimistic estimate
of the number of bytes the TX FIFO should consume and only write up to
that number.

Also, there's no point tracking whether or not the scheduler parked the
thread in a call to xTaskDelayUntil - missing a scheduler tick can't be
recovered from.
2025-01-17 15:14:06 +00:00
Jonathan Bell
3d58384754 cdc_uart: work around suspected TinyUSB FIFO bug
UART TX corruption has been observed at high baud rates. It seems to be
related to thread preemption when a buffer is pushed to the CDC FIFO
while another task is reading/updating FIFO pointers.

If set to 1x wMaxPacket bytes, the FIFO push only occurs when it is
completely empty. This avoids the bug at the cost of some amount of
throughput, usually 1-2 USB packet times plus inter-packet delay.
2025-01-17 15:03:02 +00:00
Jonathan Bell
818ed79f4b Fixes for #160 and #159 2025-01-09 16:34:30 +00:00
Jonathan Bell
53875ec320 Debugprobe release v2.2.1
This release is a point release because unknown/stale submodule(s)
caused a regression with long UART TX strings that subsequently could
not be reproduced.

The build artifacts for this release were compiled on a Raspberry Pi 5
running Raspberry Pi OS (Debian 12) instead of Ubuntu 22.04 on amd64.
debugprobe-v2.2.1
2025-01-09 14:49:12 +00:00
Jonathan Bell
9226fac61a Debugprobe release v2.2.0 debugprobe-v2.2.0 2024-12-03 13:16:13 +00:00
Jonathan Bell
06c7792560 main: kludge for Pi 5 reboot crashes
The Pi 5 bootloader will leave devices it doesn't care about in the
Addressed state, so tud_mount_cb never gets called. Handoff from the
bootloader to Linux causes a suspend event followed by Reset.

Check if the interface association was configured on entry to Suspend or
Resume. Also, TinyUSB doesn't expose Bus Reset events for whatever
reason, so there's nothing that tears down the interface threads.
2024-12-03 11:48:25 +00:00
Jonathan Bell
1752f2a61b CMmakeLists.txt: add pico2 variant target naming 2024-11-29 10:02:49 +00:00
Jonathan Bell
e887004fdf Debugprobe release v2.1.0 debugprobe-v2.1.0 2024-11-27 15:48:41 +00:00
Jonathan Bell
df68d70400 Fix PORT_SWD/PORT_OFF mismatch - do GPIO setup in each 2024-11-27 15:48:41 +00:00
Jonathan Bell
0c84dd0dc1 FreeRTOS: use upstream port again, RP2350 support has landed
But the RP2350 kernel import is broken, use copy from pico-examples 2.1.0
2024-11-27 15:10:38 +00:00
Jonathan Bell
4238b780c2 main: handle RP2040's broken USB error handling
RP2040-E15 can also be triggered if a Debug Probe is connected to a
board with a floating ground. Typically this causes port ESD protection
to temporarily activate, meaning the Dp/Dm state gets corrupted. If this
happens in the middle of a handshake packet, the SIE can lock up.

The only way to detect this case is if SOF_RD stops advancing without a
corresponding suspend interrupt - so add a watchdog thread that forces a
disconnect if the hardware stops reporting frame counts.

This is disruptive, but immediate notification that the probe broke is
preferable to silently failing until the next character is sent by the host.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2024-11-27 14:19:33 +00:00
Jonathan Bell
189e367332 main: add callbacks for discrete USB states
We can save more power by parking threads when suspended, and threads
should be deleted when disconnected.

Also fix an inefficiency in usb_thread wakeups when the device is yet to
be configured, but is addressed - slowing down control transfers.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2024-11-27 14:19:33 +00:00
Jonathan Bell
d9c507f579 dap_edpt_driver: handle deinit properly
Zap pending buffers if the interface went away.
Also fix -Wformat warnings.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2024-11-27 14:19:33 +00:00
Jonathan Bell
6d2f83e30c cdc_uart: be more careful about when the thread gets parked or resumed
tud_cdc_connected tests dtr, not rts - so we should do the same.

Don't unconditionally wake the uart thread when set_line_coding happens
- Windows frequently calls this after every linestate change, including
device close.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2024-11-27 14:19:33 +00:00
Jonathan Bell
1182803822 probe: revert pins to Hi-Z when PORT_OFF is called
Alternative implementation of #146
Fixes #146
2024-11-27 14:10:51 +00:00
Andrew Burge
65b1e73589 Where enabled: Add calls to set the various xxx_LED status lines as GPIO outputs
Signed-off-by: Andrew Burge <andrew.burge@raspberrypi.com>
2024-11-27 11:03:04 +00:00
Jonathan Bell
152f85d2ec Specify MIT license as the project's default.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2024-11-27 10:58:50 +00:00
Jonathan Bell
d85fd1f58d Remove unattributed contributions from the project
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2024-11-27 10:45:59 +00:00
Jonathan Bell
8f5d6fcc9f Clarify pico_sdk_import.cmake license
This file was copied from the pico-sdk, which is a BSD 3-Clause project.
2024-11-20 11:21:58 +00:00
Jonathan Bell
9aed4ca509 Add license and copyright to probe_oen.pio
This file is directly attributable to Raspberry Pi.
2024-11-20 11:12:09 +00:00
Jonathan Bell
e4585d551a probe: don't include pio headers directly 2024-11-07 15:13:03 +00:00
Jonathan Bell
46b9613d14 Update to support building for Pico 2
- Update CMSIS to 5.7.0
- Update FreeRTOS to downstream commit aa52f214d

Note: for an existing repository clone, you must run
git submodule update --init
and delete and regenerate your build/ directory.
2024-08-08 14:40:22 +01:00
Jonathan Bell
2bbe900d68 Debugprobe release 2.0.1 debugprobe-v2.0.1 2024-04-16 13:43:17 +01:00
tanxiao
7410b45e1d rename PROBE_IO_SWDIOEN to PROBE_IO_OEN 2024-03-26 19:12:28 +00:00
tanxiao
920f717e71 Add pin names to binary information 2024-03-26 19:12:28 +00:00
Taylor Alexander
34a4ba0e01 Fix incorrect LED ifdefs 2024-03-26 19:11:14 +00:00
Jonathan Bell
0476e9cae5 cdc_uart: add missing clear-break reset of TX LED 2024-03-19 14:49:41 +00:00
Jonathan Bell
c0ff91421a Debugprobe release 2.0 debugprobe-v2.0 2024-03-18 16:37:56 +00:00
Jonathan Bell
b5962e0818 Fix builds for which UART_TX_LED aren't defined 2024-03-18 16:37:56 +00:00
Jonathan Bell
ddc028fe18 cdc_acm: turn on UART_TX LED when sending break signals
Software typically asserts line break for an extended period
(e.g. PuTTY will assert continuously until the next keypress), so
provide feedback via the LED.

Also declare variables used in both tinyusb callback and uart_thread context
as volatile.
2024-03-18 16:01:35 +00:00
Jonathan Bell
af2540b045 cdc_uart: add CTS/RTS configuration options to board_example_config
For high data rate applications it's desirable to use hardware flow control
to prevent characters getting dropped when faced with the vagaries of RTOS
and kernel latencies. Adding PROBE_UART_HWFC enables the UART's CTS/RTS pins,
and SET_LINE_STATE messages no longer affect the RTS pin.
2024-03-18 16:01:35 +00:00
Jonathan Bell
d5047e7ef8 cdc_uart: add break handling
Implement break set/unset and declare the interface as capable of sending
line breaks.
2024-03-18 16:01:35 +00:00
geekman
a7aa0766f0 Make target reset functionality work out-of-the-box (#123)
* Fix up target reset functionality.

- Correct GPIO direction logic error in `probe_assert_reset`
- Remember to de-assert nRESET on deinit

* board_pico_config: use pin 1 for reset

This pin is normally used for UART debug output, but that is
undocumented. Repurpose it as reset output.

Signed-off-by: Sean Cross <sean@xobs.io>

* main: move stdio_uart_init() before DAP_Setup()

When using GP1 as a reset line, this is necessary to overwrite the
stdio function call from reusing the pin as a debug output.

Signed-off-by: Sean Cross <sean@xobs.io>

---------

Signed-off-by: Sean Cross <sean@xobs.io>
Co-authored-by: Sean Cross <sean@xobs.io>
2024-03-18 15:12:46 +00:00
David Lynch
b09854c639 fix: Corrected typo in preprocessor ifdef
* Changed PROBE_UART_RX_LED to PROBE_UART_TX_LED in ifdef to control TX LED
2024-03-18 09:33:57 +00:00
Jonathan Bell
327e15f176 board_debug_probe_config.h - nit 2024-02-05 16:17:46 +00:00
Jonathan Bell
62f4a31335 Update README.md 2024-02-05 16:17:46 +00:00
Jonathan Bell
abf675ca8c More renaming
- Prefix DAP-specific defines with DAP_
- PROBE_ defines refer to config options selected by a board type
2024-02-05 16:17:46 +00:00
Jonathan Bell
d0c03d2564 Rename picoprobe to debugprobe
Picoprobe is a registered trademark. Rename to debugprobe, and make it clear
that the code in this repository is firmware for the Debug Probe.
2024-02-05 16:17:46 +00:00
Jonathan Bell
1267a8c367 DAP: fix atomic command support
Two bugs - ignoring DAP_QueueCommand, and calling DAP_ProcessCommand
instead of DAP_Executecommand
picoprobe-cmsis-v1.1
2024-01-29 10:09:55 +00:00