Hi all!
I've recenly got my J-link edu and I've stumbled upon something weird regarding SWO output.
When I try to enable SWO using "monitor SWO EnableTarget 16000000 1000000 3 0" it say's "SWO enabled successfully." though nothing visible happens. Here are my observations:
- SWO line is low, i.e. inactive (should be high be default)
- TPIU registers have sensible values, i.e. NRZ mode is enabled, prescaller is set to 15, formatting is disabled
- ITM registers have sensible values, i.e. it's enabled and stimulus ports 0 and 1 are on,
- PB3 (SWO pin on this MCU) - is set to alternate 0 (as it should), is set to "Very high" speed
So I try SWOViewer and it shows nothing, BUT when I monitor the SWO line it works (the MCU sends proper data). When I turn off the SWO viewer it must set ITM ENA register to 0, cause the data stops flowing, but:
- When I then try to attach with GDB to the MCU, SWO is working
- When I issue command "monitor SWO EnableTarget 16000000 16000000 3 0" (notice now 16MHz SWO clock) the MCU still sends using 1MHz clock, but J-link now expects 16MHz clock, so I see no data on PC side. Though I can confirm that MCU sends data on osciloscope
- What is weirder the ACPR register correcly has now prescaller "0", in fact if I change it manually it doesn't change anything.
- But if I use SWOViewer again with arguments that will set prescaller to 0 it correctly changes the prescaller and now I can use GDB with SWO client again.
- Whatever SWOViewer does, that GDB server doesn't do is effective until next power on reset.
Any ideas what might be the cause of this problem?
My setup:
- STM32H750VB target MCU, currently at 16MHz
- SWD + SWO interface
- VS Code with cortex-debug extension (Basically J-link's gdb server)
- J-link software version 6.38b
I've recenly got my J-link edu and I've stumbled upon something weird regarding SWO output.
When I try to enable SWO using "monitor SWO EnableTarget 16000000 1000000 3 0" it say's "SWO enabled successfully." though nothing visible happens. Here are my observations:
- SWO line is low, i.e. inactive (should be high be default)
- TPIU registers have sensible values, i.e. NRZ mode is enabled, prescaller is set to 15, formatting is disabled
- ITM registers have sensible values, i.e. it's enabled and stimulus ports 0 and 1 are on,
- PB3 (SWO pin on this MCU) - is set to alternate 0 (as it should), is set to "Very high" speed
So I try SWOViewer and it shows nothing, BUT when I monitor the SWO line it works (the MCU sends proper data). When I turn off the SWO viewer it must set ITM ENA register to 0, cause the data stops flowing, but:
- When I then try to attach with GDB to the MCU, SWO is working
- When I issue command "monitor SWO EnableTarget 16000000 16000000 3 0" (notice now 16MHz SWO clock) the MCU still sends using 1MHz clock, but J-link now expects 16MHz clock, so I see no data on PC side. Though I can confirm that MCU sends data on osciloscope
- What is weirder the ACPR register correcly has now prescaller "0", in fact if I change it manually it doesn't change anything.
- But if I use SWOViewer again with arguments that will set prescaller to 0 it correctly changes the prescaller and now I can use GDB with SWO client again.
- Whatever SWOViewer does, that GDB server doesn't do is effective until next power on reset.
Any ideas what might be the cause of this problem?
My setup:
- STM32H750VB target MCU, currently at 16MHz
- SWD + SWO interface
- VS Code with cortex-debug extension (Basically J-link's gdb server)
- J-link software version 6.38b