2015-10-21 10:08 PM
Hello
I try the demo project to learn UART initialisation and usingSTM32Cube_FW_F4_V1.9.0\Projects\STM32F401RE-Nucleo\Examples\UART\UART_Printf\EWARMoutgoing Communication is fine. Demo is working.RxD and TxD are connected to the Pins RXD0 and TXD1Now i want to receive datas, so i chanced to:/* Infinite loop */
uint8_t pBuf; while (1) { while (HAL_UART_Receive(&UartHandle, &pBuf,1,1)!= HAL_OK) { } printf(''\n\r UART Byte received UART\n\r''); }I never received data? Have anybody a hint?Seconday Problem:If i ad a HAL_Delay() the code freezed there[File:stm32f4xx_hal.c]
__weak void HAL_Delay(__IO uint32_t Delay)
{ uint32_t tickstart = 0; tickstart = HAL_GetTick(); while((HAL_GetTick()
- tickstart) < Delay) { }}HAL_GetTicket() allways return 0.What i have to do, that i can use HAL_Delay() in the demo Project?Thank youMartin #stm32f4 #usart2015-10-22 06:06 AM
HAL_Delay() is dependent on a functional SysTick, I suspect this would normally get set up in HAL_Init()
For the USART perhaps you need to check that you have an IRQHandler and that it calls back into the HAL for processing.