traceswo: Provide command option for async swo.
This commit is contained in:
parent
3e3e450408
commit
93bc3a155a
|
@ -56,7 +56,7 @@ static bool cmd_hard_srst(void);
|
||||||
static bool cmd_target_power(target *t, int argc, const char **argv);
|
static bool cmd_target_power(target *t, int argc, const char **argv);
|
||||||
#endif
|
#endif
|
||||||
#ifdef PLATFORM_HAS_TRACESWO
|
#ifdef PLATFORM_HAS_TRACESWO
|
||||||
static bool cmd_traceswo(void);
|
static bool cmd_traceswo(target *t, int argc, const char **argv);
|
||||||
#endif
|
#endif
|
||||||
#ifdef PLATFORM_HAS_DEBUG
|
#ifdef PLATFORM_HAS_DEBUG
|
||||||
static bool cmd_debug_bmp(target *t, int argc, const char **argv);
|
static bool cmd_debug_bmp(target *t, int argc, const char **argv);
|
||||||
|
@ -75,7 +75,7 @@ const struct command_s cmd_list[] = {
|
||||||
{"tpwr", (cmd_handler)cmd_target_power, "Supplies power to the target: (enable|disable)"},
|
{"tpwr", (cmd_handler)cmd_target_power, "Supplies power to the target: (enable|disable)"},
|
||||||
#endif
|
#endif
|
||||||
#ifdef PLATFORM_HAS_TRACESWO
|
#ifdef PLATFORM_HAS_TRACESWO
|
||||||
{"traceswo", (cmd_handler)cmd_traceswo, "Start trace capture" },
|
{"traceswo", (cmd_handler)cmd_traceswo, "Start trace capture [(baudrate) for async swo]" },
|
||||||
#endif
|
#endif
|
||||||
#ifdef PLATFORM_HAS_DEBUG
|
#ifdef PLATFORM_HAS_DEBUG
|
||||||
{"debug_bmp", (cmd_handler)cmd_debug_bmp, "Output BMP \"debug\" strings to the second vcom: (enable|disable)"},
|
{"debug_bmp", (cmd_handler)cmd_debug_bmp, "Output BMP \"debug\" strings to the second vcom: (enable|disable)"},
|
||||||
|
@ -277,10 +277,20 @@ static bool cmd_target_power(target *t, int argc, const char **argv)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PLATFORM_HAS_TRACESWO
|
#ifdef PLATFORM_HAS_TRACESWO
|
||||||
static bool cmd_traceswo(void)
|
static bool cmd_traceswo(target *t, int argc, const char **argv)
|
||||||
{
|
{
|
||||||
|
#if defined(STM32L0) || defined(STM32F3) || defined(STM32F4)
|
||||||
|
extern char serial_no[13];
|
||||||
|
#else
|
||||||
extern char serial_no[9];
|
extern char serial_no[9];
|
||||||
traceswo_init();
|
#endif
|
||||||
|
uint32_t baudrate = 0;
|
||||||
|
(void)t;
|
||||||
|
|
||||||
|
if (argc > 1)
|
||||||
|
baudrate = atoi(argv[1]);
|
||||||
|
|
||||||
|
traceswo_init(baudrate);
|
||||||
gdb_outf("%s:%02X:%02X\n", serial_no, 5, 0x85);
|
gdb_outf("%s:%02X:%02X\n", serial_no, 5, 0x85);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include <libopencm3/usb/usbd.h>
|
#include <libopencm3/usb/usbd.h>
|
||||||
|
|
||||||
void traceswo_init(void);
|
void traceswo_init(uint32_t baudrate);
|
||||||
void trace_buf_drain(usbd_device *dev, uint8_t ep);
|
void trace_buf_drain(usbd_device *dev, uint8_t ep);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue