STM32L072/82 trouble with timeout HAL_SPI_Receive() / HAL_getTick()
Dear comunity,
I'm having some trouble using the SPI communication protocol between two MCU.
The aim is to transfer data via SPI(2) from MCU to a Murata MLM32L07x01 (based on STM32L072).
In my program, I'm using also UART2 / ADC / RTC / LoRa communication (SPI1) / GPIOs.
When I want to transfer data, I'm using the HAL_SPI_Receive function in the Murata like this :
HAL_SPI_Receive(&hspi2, aRxBuffer, sizeOfSPI, 3000);
If the variable sizeOfSPI is right, I received well the data and my program is following. However, when I don't know the size of SPI transfer (assuming I'm waiting for 80 char and I received only 60), I still receive the transfer char but the Timeout parameter should be used. In the case above, knowing the SPI is in polling mode, it should wait for 3 seconds maximum.
However, my program is going into an infinite loop. When I try to debug the software, I see a weird value from the HAL library :
In the SPI_WaitOnFlagUntilTimeout function, the call of HAL_GetTick returns 0 :
static HAL_StatusTypeDef SPI_WaitOnFlagUntilTimeout(SPI_HandleTypeDef *hspi, uint32_t Flag, FlagStatus Status, uint32_t Timeout)
{
uint32_t tickstart = 0U;
/* Get tick */
tickstart = HAL_GetTick();There is my definition of SysTick_Handler :
void SysTick_Handler(void)
{
HAL_IncTick();
HAL_SYSTICK_IRQHandler();
}How can I manage to get work the HAL_GetTick function ?
