AnsweredAssumed Answered

stm32CubeMX stm32f407 discovery printf doesn't work

Question asked by vnv on Dec 15, 2015
Latest reply on Jun 8, 2016 by Aggarwal.Gaurav.004
Hi all,

trying to retarget printf on stm32f407 discovery with cubemx generated code isn't working.

Inside main.c i've put:

/**
  * @brief  Retargets the C library printf function to the USART.
  * @param  None
  * @retval None
  */
int fputc(int ch, FILE *f){
  /* Place your implementation of fputc here */
  /* e.g. write a character to the USART */
  HAL_UART_Transmit(&huart6,(uint8_t*)&ch,1,1);// 1 tick waiting (1ms) enough for 87us/byte at 115200


  return ch;
}



HAL_UART_Transmit works without problem on it's own, printf doesn't output.
Could anyone help  please?

Outcomes