When trying to use a cmsis-dap debugger to capture SWO output, I think that the
command to change baudrate doesn't send enough bytes to the debug probe. At
line 663 of cmsis_dap.c (function cmsis_dap_cmd_dap_swo_baudrate()) it
appears that 4 bytes are transferred for this command. I believe it should
be 5 total (the command tag 0x19, then the 4-byte baudrate word), as
described here
<https://arm-software.github.io/CMSIS_5/DAP/html/group__DAP__SWO__Baudrate.html>
.

This matches up with an issue I am seeing when using a cmsis-dap probe (to
be transparent, this is a probe firmware I am developing myself, and I
don't currently have access to a non-custom cmsis-dap probe), where I don't
receive a full 4 byte word in the command request buffer from this openocd
command; instead the total command length is 4 bytes, the first being the
tag and then 3 bytes remaining for the baudrate.

OpenOCD Version/Tag: v0.12.0-rc2
Host Probe: custom cmsis-dap firmware
Host OS: Windows 10
Target PCB: nucleo l4r5zi
Configuration Script:

source [find interface/cmsis-dap.cfg]
> transport select swd
> source [find target/stm32l4x.cfg]
> reset_config srst_only srst_nogate connect_assert_srst
> $_CHIPNAME.tpiu configure -protocol uart -output swo.out -traceclk
> 64000000 -pin-freq 115200
> init
> reset run
> $_CHIPNAME.tpiu enable


Reply via email to