Commit Graph

848 Commits

Author SHA1 Message Date
dragonmux 24ac50ff60 usbuart: Begun refactoring the physical UART code to seperate out the mixed interests 2022-08-22 12:59:24 -07:00
dragonmux a86340790d usbuart: Replaced most of the debug monitor code with newlib hooks and documented everything 2022-08-21 18:26:17 -07:00
dragonmux 99e894cd0f platform: Removed usbuart_debug_write() from the headers and fixed its return type 2022-08-21 18:26:17 -07:00
dragonmux 999ac27172 native/usbdfu: clang-format for part of the DFU bootloader 2022-08-21 18:26:17 -07:00
dragonmux 54bcbf95fa native: Done a little more cleanup in the platform with clang-format 2022-08-21 18:26:17 -07:00
Rafael Silva 98b4c71156 misc: superfluous semicolon cleanup 2022-08-20 07:15:53 -04:00
dragonmux 79575cc8a9 adiv5: Attempt to handle JTAG DPv0 devices 2022-08-18 18:58:29 -07:00
dragonmux c847007008 jtagtap: Implemented clock tristating 2022-08-15 22:16:15 -07:00
dragonmux 9198f5b630 native: Properly handled the TCK/SWCLK processor pin when doing clock tristating 2022-08-15 22:16:15 -07:00
dragonmux 1890426669 native: Reformatted the TMS and SWDIO macros in the platform header 2022-08-15 22:16:15 -07:00
dragonmux 4ca3982599 native: Cleaned up the SWDIO turnaround macros 2022-08-15 22:16:15 -07:00
dragonmux e7f45aea7e hosted/remote_jtagtap: Refactored out another unnecessary snprintf() call from TAP init remote call code 2022-08-15 22:16:15 -07:00
dragonmux cf07861405 hosted: Implemented support for the new target clock tristating on BMP 2022-08-15 22:16:15 -07:00
dragonmux 450581cc0a hosted/bmp_remote: Implemented support for the new remote protocol target clock tristating 2022-08-15 22:16:15 -07:00
dragonmux 52160db72b native: Done a spring pass in platform_init() with clang-format and removed a duplicate gpio_set_mode() call 2022-08-15 22:16:15 -07:00
dragonmux 7a0f6597ff platform: Implemented sub support in the non-native platforms for target clock tristating 2022-08-15 22:16:15 -07:00
dragonmux adcfe22f86 native: Implemented platform support for tristating the TCLK/SWCLK pin 2022-08-15 22:16:15 -07:00
Uwe Bonnes b70b807a4e F072/F3: Rework Readme.md
Give explicit instructions for initial firmware loading and updating.
2022-08-15 19:11:44 -07:00
dragonmux eedf21e821 usb_serial: run clang-format on the code 2022-08-12 22:25:52 -07:00
dragonmux 0477d5ee8e traceswo: Replaced two magic numbers with the proper macros 2022-08-12 22:25:52 -07:00
dragonmux 0f37edc36a misc: Renamed cdcacm.{c,h} to usb_serial.{c,h} 2022-08-12 22:25:52 -07:00
dragonmux 8f41217d29 gdb_if: Run clang-format and done some cleanup 2022-08-12 22:25:52 -07:00
dragonmux aa6d0fa7e4 usb: Moved usb_get_config() into the main usb header 2022-08-12 22:25:52 -07:00
dragonmux 832c056e6d usb: Moved usb_get_state() into the main usb implementation 2022-08-12 22:25:52 -07:00
dragonmux bf6c146786 cdcacm: Renamed cdcacm_get_config() -> usb_get_config() 2022-08-12 22:25:52 -07:00
dragonmux 983a541cab cdcacm: More naming fixes for various functions 2022-08-12 22:25:52 -07:00
dragonmux 49d21b0f44 cdcacm: Made gdb_uart_dtr a bool, saving space and memory 2022-08-12 22:25:52 -07:00
dragonmux 109f661e31 gdb_if: Cleanup in the include order 2022-08-12 22:25:52 -07:00
dragonmux 82c83bb77e usb_gdb_uart: Renamed cdcacm_get_dtr() -> gdb_uart_get_dtr() 2022-08-12 22:25:52 -07:00
dragonmux 2e5143bb5f common: Moved blackmagic_usb_init() into the main USB header 2022-08-12 22:25:52 -07:00
dragonmux da320a42f3 cdcacm: Refactored cdcacm_set_modem_state() 2022-08-12 22:25:52 -07:00
dragonmux adf8ae1ef1 common: Moved the DFU stub out into its own file with seperate handler registration so we don't cross the handler streams 2022-08-12 22:25:52 -07:00
dragonmux 400ee0c76c serialno: Improved the naming of the serial number reading function 2022-08-12 22:25:52 -07:00
dragonmux 886c790b25 serialno: Refactored the serial number code, cleaning up its API and localising implementation details 2022-08-12 22:25:52 -07:00
dragonmux 259077a87d common: Moved the USB initialisation code into usb.c 2022-08-12 22:25:52 -07:00
dragonmux ada59291c2 common: Broke the USB descriptors out to their own header 2022-08-12 22:25:52 -07:00
dragonmux d6f8a343a2 platform: Fixed the order of operations with the physical UART init vs the USB stack init 2022-08-12 22:25:52 -07:00
dragonmux 82bca86806 platform: Renamed cdcacm_init -> blackmagic_usb_init 2022-08-12 22:25:52 -07:00
dragonmux 105f6a3dce common: Begun splitting the USB code into more sensibly named implementation files 2022-08-12 22:25:52 -07:00
dragonmux 3606784663 hosted/cmsis_dap: Add a dummy read to the end of dap_mem_write_sized() so we always wait on the write to ensure it's complete before any DP access can occur 2022-08-08 14:45:38 -07:00
Rafael Silva 802c5fb87c hosted/jlink: fix bad line reset cmd building
extra memset set bits that were not set before code cleanup
2022-08-08 12:30:34 -04:00
Piotr ESden-Tempski 253a12f014 native: Enable uart on HW >=V3 when debugging.
We were disabling the UART on all Hardware V1 and newer, as V1 and V2
had the SWD pins connected to the UART pins. Since V3 this is not the
case any more so we can keep the UART enabled when an SWD debugger is
connected to the BMP.
2022-08-07 22:59:23 -04:00
dragonmux 7cacdab98e hosted: Cleaned up the CFLAGS and LDFLAGS building to use pkg-config to find libusb1 and corrected the pkg-config presence check 2022-08-07 13:42:32 -07:00
dragonmux aff2f4e428 hosted/cli: Made sure the command line options structure is initialised with opt_mode = BMP_MODE_DEBUG before args parsing 2022-08-07 13:37:09 -07:00
Rafael Silva 0075abacbf jlink_adiv5_swdp: remove duplicated logic on swdp low access 2022-08-06 18:02:30 -04:00
Rafael Silva 4f01ffe56c misc: change return type of scan routines to size_t 2022-08-06 18:02:30 -04:00
Rafael Silva 7db6c71095 platform: set power flag to const 2022-08-06 18:02:30 -04:00
Rafael Silva 322af2506b hosted/platform: make platform identifier nicer to read 2022-08-06 18:02:30 -04:00
Rafael Silva 3a673225b7 hosted/stlink: make swd scan function more consisted with other probes
Signed-off-by: Rafael Silva <perigoso@riseup.net>
2022-08-06 18:02:30 -04:00
Rafael Silva ce6477886f target/adi: unify DPIDR TARGETID handling in adiv5_dp_init
this makes the assumption that DPs will be v1 or higher, for SWD-DP scans this is
guaranteed, but on JTAG-SCANS it may not be true, DPv0 does not have DPIDR
implemented and reads are UNPREDICTABLE

Signed-off-by: Rafael Silva <perigoso@riseup.net>
2022-08-06 18:02:30 -04:00
Rafael Silva 0fbb6921b9 jlink_adiv5_swdp: code cleanup 2022-08-06 18:02:30 -04:00
Rafael Silva 564114df13 platform: code format and style 2022-08-06 18:02:30 -04:00
Rafael Silva a1f0d28913 platform: check calloc result 2022-08-06 18:02:30 -04:00
Rafael Silva ae23cb879e hosted/jlink: add warning when ignoring unkown pids 2022-08-01 23:04:28 +01:00
Rafael Silva eb8b930841 hosted/jlink: add pid 0x1015 as a valid J-Link debugger 2022-08-01 23:04:28 +01:00
Rafael Silva 46fd32da5c hosted/jlink: fix vid-pid transposition error 2022-08-01 23:04:28 +01:00
Rafael Silva f435bd2136 target/adi: rework handling of TARGETID
add missing fetching of targetid in jlink probes
clarify how targetid is being read
handle idcode as debug_port_id
use targetid when available to identify device in probe routine
2022-07-31 12:09:07 +01:00
Rafael Silva 8238d3c020 target: rename target idcode 2022-07-31 12:09:07 +01:00
Rafael Silva 58025feec2 target/adi: rename missleading idcode variable 2022-07-31 11:16:36 +01:00
Uwe Bonnes 460bd1e477 stm32/gdb_if: Use _WFI when nothing to do. 2022-07-30 21:45:51 -07:00
dragonmux 181e84cb0c jtag_scan: Adjusted the parameter and result types for jtag_scan(), jtag_add_device(), and related functions 2022-07-30 18:00:08 -07:00
dragonmux 1ea9641ada hosted/remote_jtagtap: Refactored remote_jtagtap_init and cleaned up 2022-07-30 16:26:04 -07:00
dragonmux 02b979d382 jtagtap: Added support for configurable TAP idle cycles ready for RISC-V support 2022-07-30 16:26:04 -07:00
dragonmux 0f0435a7c1 hosted/remote_jtagtap: Fixed the debug error string in jtagtap_tdi_tdo_seq 2022-07-30 16:26:04 -07:00
dragonmux d0faab957a hosted/remote_jtagtap: Refactored jtagtap_reset and cleaned up 2022-07-30 16:26:04 -07:00
dragonmux 5876c7674b hosted/remote_jtagtap: Refactored jtagtap_tms_seq and cleaned up 2022-07-30 16:26:04 -07:00
dragonmux 267dabacb1 hosted/remote_jtagtap: Refactored jtagtap_tdi_tdo_seq and cleaned up 2022-07-30 16:26:04 -07:00
dragonmux 8177e3c723 hosted/remote_jtagtap: Refactored jtagtap_cycle and cleaned up 2022-07-30 16:26:04 -07:00
dragonmux 088eb6f01b hosted/remote_jtagtap: Refactored jtagtap_next and cleaned up 2022-07-30 16:26:04 -07:00
dragonmux 7b5121c970 hosted/remote_jtagtap: reformatted with clang-format 2022-07-30 16:26:04 -07:00
dragonmux f02304dfdb hosted/remote_jtagtap: Implemented support for jtagtap_cycle 2022-07-30 16:26:04 -07:00
dragonmux deadf9a78d jtagtap: Implemented jtagtap_cycle for running extra clock cycles on the bus when needed 2022-07-30 16:26:04 -07:00
ylm 84ffdd3b21 fix: Add nop instruction for timing purpose
Adding a nop instruction in the no_delay TMS sequence routine fixes timing on the f4discovery platform
2022-07-30 02:49:56 +01:00
Rafael Silva 013b2dee60 target/adiv5: further cleanup 2022-07-25 18:28:57 +01:00
dragonmux c530bd077b misc: Switched to using C11 2022-07-18 20:59:15 -07:00
dragonmux 52e5357e99 swdptap: Refactored swdptap_seq_out_parity and cleaned up 2022-07-18 18:57:10 -07:00
dragonmux da1038313f swdptap: Refactored swdptap_seq_out and cleaned up 2022-07-18 18:57:10 -07:00
dragonmux 29baa2725c swdptap: Further cleanup to the seq_in functions 2022-07-18 18:57:10 -07:00
dragonmux caaf7837a5 swdptap: Made the cycle code a little easier to reason about
This doesn't actually change the resulting binary size, so worth doing
2022-07-18 18:57:10 -07:00
dragonmux c267327975 swdptap: Refactored swdptap_seq_in_parity and cleaned up 2022-07-18 18:57:10 -07:00
dragonmux 6f0bdf5f32 swdptap: Refactored swdptap_seq_in and cleaned up 2022-07-18 18:57:10 -07:00
dragonmux 92c7a11cd2 swdptap: Cleaned up swdptap_turnaround 2022-07-18 18:57:10 -07:00
dragonmux 10d30821e5 swdptap: Cleaned up the naming and and signatures of the SWDP implementation functions 2022-07-18 18:57:10 -07:00
dragonmux 1a362db5ab hosted/cmsis_dap: Naming cleanup 2022-07-18 18:57:10 -07:00
dragonmux a8c2082adf jtagtap: Const-correctness 2022-07-18 18:57:10 -07:00
dragonmux 9a21ef043f hosted/ftdi_bmp: Cleaned up and fixed the signature for libftdi_buffer_write 2022-07-18 18:57:10 -07:00
dragonmux d1c24b4fec jtagtap: Cleaned up and fixed the signatures for the JTAG TAP implementation functions 2022-07-18 18:57:10 -07:00
dragonmux 46958ba404 dap: Cleaned up the naming and signature of the JTAG TAP DAP functions 2022-07-18 18:57:10 -07:00
dragonmux bdae0b2ded jtagtap: Refactored jtagtap_tdi_seq, cleaning up and fixing naming 2022-07-18 18:57:10 -07:00
dragonmux 131165701c jtagtap: Fixed more of the naming for parameters to the JTAG TAP functions 2022-07-18 18:57:10 -07:00
dragonmux 124b3c79d7 jtagtap: Refactored jtagtap_tdi_tdo_seq and cleaned up 2022-07-18 18:57:10 -07:00
dragonmux 1671b97f61 jtagtap: Reworked jtagtap_tms_seq(), saving 8 bytes and simplifying things 2022-07-18 18:57:10 -07:00
dragonmux 303fa15171 jtagtap: Reformatted and begun cleaning up the JTAG TAP primitives implementation 2022-07-18 18:57:10 -07:00
dragonmux 7b1c4a5565 hosted/cli: Remove the `-d`/`--device` deprecation warning
This option is still useful to many users and there isn't a particular reason for it to be marked deprecated
2022-07-18 17:13:52 -07:00
dragonmux 52cad38fac hosted/dap: Cleaned up some of the link reset pointer maths 2022-07-18 17:10:23 -07:00
dragonmux 8e8ad7dbd4 hosted/cmsis_dap: Removed one-bit SWD read while SWIO is undriven + pulled up which can cause issues with certain CMSIS-DAP adaptors
Many thanks to @mubes for finding this and suggesting a fix
2022-07-18 17:10:23 -07:00
Piotr Esden-Tempski e19c2a7298 BMDA: Make the pkg-config checks work on older gnu make versions.
The .SHELLSTATUS variable was added in GNU Make 4.2. Mac OS for example
ships with 3.81.
2022-07-15 12:40:09 +01:00
Piotr Esden-Tempski d0c45cf095 BMDA: Using tabs outside of a target indent causes issues.
It is safer to only use spaces to indent make statements outside of
targets as each line that executes any shell code will fail if it is
indented with tabs.
2022-07-15 12:40:09 +01:00
Jonathan Giles a3d3a2326f Add include path so that libusb headers found on OSX. 2022-07-15 02:19:03 +01:00
dragonmux ae81d1635f hosted/cmsis_dap: Enhanced the hid_open failure output on Linux to help users narrow down the issue faster 2022-07-13 19:37:35 -07:00