diff --git a/README.md b/README.md index 65b0b9112ea..c350ac5fe30 100644 --- a/README.md +++ b/README.md @@ -84,25 +84,25 @@ to connect. Black Magic Debug App can talk to * Black Magic Probe firmware probes via the USB-serial port -* ST-LinkV2 and V3 with recent firmware +* ST-Link v2, v2.1 and v3 with recent firmware * CMSIS-DAP compatible probes -* JLINK probes -* FTDI MPSSE based probe. +* J-Link probes +* FTDI MPSSE based probes -When connected to a single BMP supported probe, starting "blackmagic" w/o any +When connected to a single BMP supported probe, starting `blackmagic` w/o any arguments starts the server. When several BMP supported probes are connected, their types, position and serial number is displayed and the program exits. -Add "-P (position)" to the next invocation to select one. +Add `-P (position)` to the next invocation to select one. For the setup from the sample session above: In another terminal: ```console > blackmagic -Black Magic Debug App v1.8.0 - for Black Magic Probe, ST-Link v2 and v3, CMSIS-DAP, JLink and libftdi/MPSSE +Black Magic Debug App v1.9.2 + for Black Magic Probe, ST-Link v2 and v3, CMSIS-DAP, J-Link and FTDI (MPSSE) Using 1d50:6018 8BB20A03 Black Magic Debug - Black Magic Probe v1.8.0 + Black Magic Probe v1.9.2 Listening on TCP: 2000 ``` diff --git a/src/platforms/README.md b/src/platforms/README.md index 11478f3b2e5..3408021b024 100644 --- a/src/platforms/README.md +++ b/src/platforms/README.md @@ -22,7 +22,7 @@ used by (multiple) platforms. * ST-Link v2, v2.1, and v3 * FTDI MPSSE probes * CMSIS-DAP probes and - * JLink probes + * J-Link probes ## Support directories diff --git a/src/platforms/hosted/README.md b/src/platforms/hosted/README.md index c46bf898701..c70f88760d7 100644 --- a/src/platforms/hosted/README.md +++ b/src/platforms/hosted/README.md @@ -1,7 +1,7 @@ # PC-Hosted BMP Compile in src with "make PROBE_HOST=hosted". This needs minimal external support. "make PROBE_HOST=hosted HOSTED_BMP_ONLY=0" will compile support for FTDI, -STLink, CMSIS-DAP and JLINK probes, but requires external libraries. +STLink, CMSIS-DAP and J-Link probes, but requires external libraries. ## Description PC-hosted BMP run on the PC and compiles as "blackmagic". When started, @@ -100,7 +100,7 @@ Probes below only when compiled with HOSTED_BMP_ONLY=0 | ST-Link V2/1 | +++ | Requires recent firmware, Cortex only! | CMSIS-DAP | +++ | Speed varies with MCU implementing CMSIS-DAP | FTDI MPSSE | ++ | Requires a device description -| JLINK | - | Useful to add BMP support for MCUs with built-in JLINK +| J-Link | - | Limited support for hardware prior to v8 ## Device matching As other USB dongles already connected to the host PC may use FTDI chips, diff --git a/src/platforms/hosted/bmp_libusb.c b/src/platforms/hosted/bmp_libusb.c index 6c04a1f3924..663238d5662 100644 --- a/src/platforms/hosted/bmp_libusb.c +++ b/src/platforms/hosted/bmp_libusb.c @@ -73,7 +73,7 @@ static const debugger_device_s debugger_devices[] = { {VENDOR_ID_STLINK, PRODUCT_ID_STLINKV3_NO_MSD, PROBE_TYPE_STLINK_V2, NULL, "ST-Link v2.1 No MSD"}, {VENDOR_ID_STLINK, PRODUCT_ID_STLINKV3, PROBE_TYPE_STLINK_V2, NULL, "ST-Link v3"}, {VENDOR_ID_STLINK, PRODUCT_ID_STLINKV3E, PROBE_TYPE_STLINK_V2, NULL, "ST-Link v3E"}, - {VENDOR_ID_SEGGER, PRODUCT_ID_ANY, PROBE_TYPE_JLINK, NULL, "Segger JLink"}, + {VENDOR_ID_SEGGER, PRODUCT_ID_ANY, PROBE_TYPE_JLINK, NULL, "Segger J-Link"}, {VENDOR_ID_FTDI, PRODUCT_ID_FTDI_FT2232, PROBE_TYPE_FTDI, NULL, "FTDI FT2232"}, {VENDOR_ID_FTDI, PRODUCT_ID_FTDI_FT4232, PROBE_TYPE_FTDI, NULL, "FTDI FT4232"}, {VENDOR_ID_FTDI, PRODUCT_ID_FTDI_FT232, PROBE_TYPE_FTDI, NULL, "FTDI FT232"}, diff --git a/src/platforms/hosted/jlink.c b/src/platforms/hosted/jlink.c index 581bf1850d5..258f5534fd9 100644 --- a/src/platforms/hosted/jlink.c +++ b/src/platforms/hosted/jlink.c @@ -228,7 +228,7 @@ static bool jlink_claim_interface(void) return false; } for (size_t i = 0; i < descriptor->bNumEndpoints; i++) { - const libusb_endpoint_descriptor_s *endpoint = &descriptor->endpoint[i]; + const libusb_endpoint_descriptor_s *const endpoint = &descriptor->endpoint[i]; if (endpoint->bEndpointAddress & LIBUSB_ENDPOINT_IN) bmda_probe_info.usb_link->ep_rx = endpoint->bEndpointAddress; else @@ -240,7 +240,7 @@ static bool jlink_claim_interface(void) /* J-Link command functions and utils */ -static char *jlink_hw_type_to_string(const uint8_t hw_type) +static const char *jlink_hw_type_to_string(const uint8_t hw_type) { switch (hw_type) { case JLINK_HARDWARE_VERSION_TYPE_JLINK: @@ -258,7 +258,7 @@ static char *jlink_hw_type_to_string(const uint8_t hw_type) } } -static char *jlink_interface_to_string(const uint8_t interface) +static const char *jlink_interface_to_string(const uint8_t interface) { switch (interface) { case JLINK_INTERFACE_JTAG: @@ -406,7 +406,7 @@ static bool jlink_get_interfaces(void) static bool jlink_get_interface_frequency(const uint8_t interface) { if (!(jlink.capabilities & JLINK_CAPABILITY_INTERFACE_FREQUENCY)) { - DEBUG_WARN("J-Link does not support interface frequency commands\n"); + DEBUG_WARN("J-Link interface frequency commands are not available\n"); return false; } @@ -477,7 +477,7 @@ static bool jlink_get_interface_frequency(const uint8_t interface) static bool jlink_set_interface_frequency(const uint8_t interface, const uint32_t frequency) { if (!(jlink.capabilities & JLINK_CAPABILITY_INTERFACE_FREQUENCY)) { - DEBUG_WARN("J-Link does not support interface frequency command\n"); + DEBUG_WARN("J-Link interface frequency commands are not available\n"); return false; } @@ -550,8 +550,7 @@ static bool jlink_kickstart_power(void) { if (!(jlink.capabilities & JLINK_CAPABILITY_POWER_STATE)) { if (jlink.capabilities & JLINK_CAPABILITY_KICKSTART_POWER) - DEBUG_ERROR("J-Link does not support JLINK_CMD_POWER_GET_STATE command, but does support kickstart power" - ", this is unexpected\n"); + DEBUG_ERROR("J-Link power state command is not available, but kickstart power is, this is unexpected\n"); return false; } @@ -585,7 +584,7 @@ static bool jlink_set_kickstart_power(const bool enable) */ bool jlink_init(void) { - usb_link_s *link = calloc(1, sizeof(usb_link_s)); + usb_link_s *const link = calloc(1U, sizeof(usb_link_s)); if (!link) return false; bmda_probe_info.usb_link = link; diff --git a/src/platforms/hosted/jlink_protocol.h b/src/platforms/hosted/jlink_protocol.h index 258d6aafdf6..26faafb22f1 100644 --- a/src/platforms/hosted/jlink_protocol.h +++ b/src/platforms/hosted/jlink_protocol.h @@ -518,4 +518,4 @@ bool jlink_transfer_fixed_tms(uint16_t clock_cycles, bool final_tms, const uint8 bool jlink_transfer_swd(uint16_t clock_cycles, jlink_swd_dir_e direction, const uint8_t *data_in, uint8_t *data_out); bool jlink_select_interface(const uint8_t interface); -#endif /*PLATFORMS_HOSTED_JLINK_PROTOCOL_H*/ +#endif /* PLATFORMS_HOSTED_JLINK_PROTOCOL_H */ diff --git a/src/platforms/hosted/jlink_swd.c b/src/platforms/hosted/jlink_swd.c index 081fc002199..075e8db530f 100644 --- a/src/platforms/hosted/jlink_swd.c +++ b/src/platforms/hosted/jlink_swd.c @@ -22,8 +22,7 @@ */ /* - * This file implements the SW-DP specific functions of the - * ARM Debug Interface v5 Architecture Specification, ARM doc IHI0031A. + * This file implements SWD specific functions for the J-Link probe. */ #include