Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


SWO debugging not working

Hello,

I’m trying to output data through the SWO but I don’t even see anything happening on the PB3 pin using an oscilloscope.

I don’t want to use semihosting, and I don’t even need printf to work either. I simply want to output chars on the SWO line. I’ve read dozens of posts on this forum and others, and as many suggest I’m simply calling ITM_SendChar(uint32_t ch), but it doesn’t do anything. More precisely, if debugging with checkpoints, I can see that the following check in this function doesn’t pass:

if ((ITM->TCR & ITM_TCR_ITMENA_Msk) && /* ITM enabled */
     (ITM->TER & (1UL << 0))) /* ITM Port #0 enabled */

is always false. So it makes me think something is maybe not initialized correctly? By the way I’m not using code generated by CubeMX, is there anything I should do to allow SWO (ITM) to be used?

My process for testing is to launch debugging inside System Workbench for STM32, start the code, and then stop it, open the ST-LINK Utility “Printf via SWO viewer” and start it with my system clock (168000000 Hz, I’m on a stm32f405rg). I double checked that the PB3 pin is connected to the SWO header pin on my STLINK-V3. As mentioned, I’m also monitoring the PB3 pin with an oscilloscope, but nothing happens on it at any time during the process.

What am I doing wrong?
Thanks

 

Newest Forum Posts

  1. Монтаж камина с грилем в Москве - установка и барбекю by KpddomErorb, 2025-05-10 18:28
  2. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  3. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  6. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  9. Build a project in "release" mode by tang, 2025-02-20 10:36
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35

Last-Modified Blogs