jtag/drivers/stlink_usb: fix SWO prescaler
commit38277fa75280071fb4e851de291b0274a457cea1
authorCliff L. Biffle <cliff@oxide.computer>
Tue, 12 May 2020 20:28:04 +0000 (12 13:28 -0700)
committerAntonio Borneo <borneo.antonio@gmail.com>
Fri, 30 Oct 2020 22:01:32 +0000 (30 22:01 +0000)
treea95c51ccb04b7ea4eb75015a02faf6d0b28825c9
parentd05ef53cbd08972f89bd13e8ce2739de68965a05
jtag/drivers/stlink_usb: fix SWO prescaler

The config_trace function has an out-parameter for generating the
prescaler for the TPIU. The STLink implementation wasn't always writing
it, causing the tpiu command to load uninitialized stack memory (minus
one) into the TPIU's prescaler register when 'external' was requested.

This change ensures that the out-parameter (and the other one,
trace_freq, which hadn't caused any buggy behavior for me) are written
every time.

Signed-off-by: Cliff L. Biffle <cliff@oxide.computer>
Change-Id: I222975869b1aa49cc6b1963c79d5ea0f46522b8c
Reviewed-on: http://openocd.zylin.com/5656
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
src/jtag/drivers/stlink_usb.c