aboutsummaryrefslogtreecommitdiff
path: root/src/jtag/drivers/jlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/jtag/drivers/jlink.c')
-rw-r--r--src/jtag/drivers/jlink.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/jtag/drivers/jlink.c b/src/jtag/drivers/jlink.c
index 80202ed..1baf345 100644
--- a/src/jtag/drivers/jlink.c
+++ b/src/jtag/drivers/jlink.c
@@ -1324,18 +1324,16 @@ static int config_trace(bool enabled, enum tpiu_pin_protocol pin_protocol,
uint32_t min_freq;
uint32_t max_freq;
+ trace_enabled = enabled;
+
if (!jaylink_has_cap(caps, JAYLINK_DEV_CAP_SWO)) {
- LOG_ERROR("Trace capturing is not supported by the device.");
- return ERROR_FAIL;
- }
+ if (!enabled)
+ return ERROR_OK;
- if (pin_protocol != TPIU_PIN_PROTOCOL_ASYNC_UART) {
- LOG_ERROR("Selected pin protocol is not supported.");
+ LOG_ERROR("Trace capturing is not supported by the device.");
return ERROR_FAIL;
}
- trace_enabled = enabled;
-
ret = jaylink_swo_stop(devh);
if (ret != JAYLINK_OK) {
@@ -1354,6 +1352,11 @@ static int config_trace(bool enabled, enum tpiu_pin_protocol pin_protocol,
return ERROR_OK;
}
+ if (pin_protocol != TPIU_PIN_PROTOCOL_ASYNC_UART) {
+ LOG_ERROR("Selected pin protocol is not supported.");
+ return ERROR_FAIL;
+ }
+
buffer_size = calculate_trace_buffer_size();
if (!buffer_size) {