Commit Graph

104 Commits

Author SHA1 Message Date
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
Jonathan Bell
bdb1bf287d tusb_edpt_handler: macroify 2024-01-25 16:48:07 +00:00
Jonathan Bell
d9a975b24e tusb_edpt_handler - whitespace/indentation 2024-01-25 15:00:31 +00:00
marble
721b69cf5c cdc_uart: add RTS and DTR pins 2023-09-21 10:57:18 +01:00
Jonathan Bell
2658c2c997 cdc_uart: support databits, stopbits and parity setup 2023-09-18 18:45:44 +01:00
Jonathan Bell
e51647492e cdc_uart: cater for Windows driver deficiencies
It's possible for the Windows CDC-ACM driver to ignore the IN endpoint
for long periods of time - multiple frames - if the host application
doesn't consume uart RX data. Boost buffer sizes to compensate.

Also prevent usb_thread from potentially being idle for a tick when
there's work to do.
2023-09-05 10:59:50 +01:00
Jonathan Bell
d13775ee72 Merge branch 'fix_debug' into 'master'
Fix ARM CMSIS-DAP issues

See merge request projectmu/picoprobe!1
2023-08-25 10:13:04 +01:00
Sunaabh Trivedi
58fa7a14cd Added a custom USB endpoint handler to process commands on a packet basis, as opposed to the byte FIFO employed previously. This allows multiple commmands to be framed correctly, so they can be processed sequentially without losing packets.
Suspend DAP thread until the end of the USB callback. This prevents the need for continous polling by DAP thread.
2023-08-24 17:15:47 +01:00
Jonathan Bell
1586ef0caa picoprobe version 1.0.3 picoprobe-cmsis-v1.0.3 2023-08-15 11:48:50 +01:00
Jonathan Bell
0761424821 probe: hook up reset functionality to DAP commands 2023-08-15 11:48:50 +01:00
Jonathan Bell
d47b3082f8 Fix debug prints
- The reset pin must move otherwise uart0 tx is squashed
- Don't preempt printf, it doesn't like it
- Set up the UART by default
2023-08-15 11:48:50 +01:00
P33M
6473166494 usb_descriptors: disable remote wake (#91)
see https://github.com/raspberrypi/picoprobe/issues/71
2023-08-09 13:13:36 +01:00
Luke Wren
3a1887ff06 Merge pull request #90 from raspberrypi/lurch-patch-1
Small README tweaks
2023-06-22 16:17:39 +01:00
Andrew Scheller
13b420d34c Small README tweaks 2023-06-22 15:56:45 +01:00
Roger Wolff
eb494103d4 buildsystem improvements to make it easier to build for debugprobe. (#87)
Merge documentation pull request from @rewolff
2023-06-22 13:50:25 +01:00
P33M
7de418cce3 Merge pull request #89 from raspberrypi/fix-deinit-without-init
Don't call probe_read_mode() in deinit() without matching prior init(), fixes #88
2023-06-18 11:00:24 +01:00