Skip to main content
JCuna.1
Senior
December 2, 2021
Question

Retarget printf for iar

  • December 2, 2021
  • 1 reply
  • 1193 views

In order to make the printf function accessible from other libraries, I create a retarget library where I call stdio and write my own implementation of _write function using UART peripheral. So when I want to use printf in another library. I add include "dev_serial.h" and then is possible to use it.

However I am trying to make the same thing in iar. First of all, I now that iar use fputc instead of _write. So, I follow the example UART printf stm32g0cb and then call dev_serial.h​ but printf is not showing nothing in UART port. Also I activate in iar option the full option for printf. But I continue without see nothing in UART port.

This topic has been closed for replies.

1 reply

JCuna.1
JCuna.1Author
Senior
December 2, 2021

I already tested the UART implementation used in fputc function, and this work​.