2023-02-24 11:53 AM
Hello,
in the Semaphore example(https://community.st.com/s/article/how-does-the-threadx-semaphore-work) there is this step:
Open Core\Src \main.c – you can copy and paste the code below, but please notice the" USER CODE BEGIN", to properly place the code snippet:
/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */
#define USE_UART_PRINT
void __io_putchar(char ch) {
#ifdef USE_UART_PRINT
// Code to write character 'ch' on the UART
HAL_UART_Transmit(&huart3, (uint8_t *)&ch, 1, 10);
#else
ITM_SendChar(ch);
#endif
}
/* USER CODE END 0 */
The question I have is why is this step and piece of code needed? I understand the previous steps and the code that I need to add in the \app_threadx.c file. But this part I am not sure and it is not explained in the guide.
Can anyone please tell why this part is needed?
Thank you
Solved! Go to Solution.
2023-02-25 05:16 AM
Hi,
this is needed to redirect the printf() output to the serial port.
regards
Haithem
2023-02-25 05:16 AM
Hi,
this is needed to redirect the printf() output to the serial port.
regards
Haithem
2023-02-25 05:19 AM
Ah ok thank you!
2023-02-25 05:35 PM
solved