STMicroelectronics / STM32CubeG0

STM32Cube MCU Full Package for the STM32G0 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Other
164 stars 75 forks source link

UART PRINTF example is not working on IAR 9.2 #26

Closed jealcuna closed 2 years ago

jealcuna commented 2 years ago

Tested in stm32g070 using UART3.

Write my own implementation of fputc function, add stdio.h in main.h header. Also add _DLIB_FILE_DESCRIPTOR in preprocessor. Breakpoint does not reach fputc.

ASELSTM commented 2 years ago

Hi @jealcuna,

We do not yet support the EWARM V9.2 within our STM32CubeG0 Firmware package. As mentioned in the Firmware project Release Note, the latest EWARM version supported is V8.50.6.

However, the issue is actually related to the EWARM IDE. In fact, some changes introduced in EWARM 9.20.1 are the root of your issue. For optimization reasons, EWARM internal library no longer calls fputc() when using printf(). However it still call the __write() low level function. Therefore, as a workaround you need to change the fputc by __write.

Please allow me thus to close this thread. Thank you for you comprehension and for contribution.

With regards,