2015-12-15 04:41 AM
I'm using STM32F411RE-Nucleo board and generating a project with Cube MX for System Workbench. The problem is that,
HAL_UART_Receive
function doesn't receive input from the user, even though I don't change any UART, GPIO, RCC or NVIC configuration.
Surprisingly, when I comment two lines in SysTick Interrupt Handler function i.e.
SysTick_Handler
,HAL_UART_Receive
starts working but this comes with another problem.
void SysTick_Handler(void){ HAL_IncTick(); HAL_SYSTICK_IRQHandler();}
HAL_Delay()
function doesn't work when I disable those two lines. I guess it's because the processor can't handle the ticks.
How to work
HAL_UART_Receive
andHAL_Delay
work at the same time? I'm a bit new in embedded programming and I'm sorry if I couldn't get myself clear.
Thanks.
#uart #stm32 #nucleo2015-12-15 09:48 AM
Well you'll have to be careful about creating dead-locks and priority-inversions.
Your USART IRQ/Callback should do very little and leave. The HAL hides a lot of what it's doing, and I suspect there are lots of issues about what functions can be called, and when, that's not clearly addressed anywhere and is fluid.HAL_Delay() should really use the count of a hardware timer, not an interrupt sourced ticker.Large parts of the HAL/Cube stuff appear to be coded by, and for, neophytes which is really one of my biggest problems with it.