I need to transmit two buffer trought HAL_UART_Transimit_DMA. I wrote in the code two consecutive command to do it but when I run the code, HAL_UART_Transimit_DMA do not return HAL_OK. It return HAL_OK only in debug mode stepping with F6. Why?
uint8_t slv_add[] = {0xF1, 0x0A, 0x00, 0x57, 0x53};
if(HAL_UART_Transmit_DMA(&huart1, &slv_add, (sizeof(slv_add)/sizeof((slv_add)))) != HAL_OK)
Error_Handler();
uint8_t cell_sel[] = {0x91, 0x00, 0x0D, 0x06, 0xA8, 0x6E};
if(HAL_UART_Transmit_DMA(&huart1, &cell_sel, (sizeof(cell_sel)/sizeof(*(cell_sel)))) != HAL_OK)
Error_Handler();
In debug mode there is no problem but if I run the code, the second function go into the Error_Handler.
I tried to use HAL_UART_Transmit with HAL_MAX_DELAY but the problem still remain.
Any advise?