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


You are viewing a reply to sw4stm32 printf not working  

sw4stm32 printf not working

printf() & scanf() redirection is supported by the library (independent of the IDE).

The library defines a “weak” function called _write() to output the formatted string. If you create an AC6 project, it will include the file syscalls.c that redefines _write() to interate over the string and call __io_putchar(). CubeMX does not create a _write() function so nothing is output (the comments surrounding PUTCHAR_PRTOTYPE are misleading).

Since printf() passes a string to _write() and the HAL accepts a string, I suggest you create a version of _write() that passes the string to the HAL and eliminate the __io_putchar() routine.

Alex