Why is HAL_UART_TRANSMIT splitting my transmission
Hi, I've been facing some issue using HAL_UART_TRANSMIT. The thing is that I want to send a message when I press a button. My idea is to catch the interrupt of the button and setting a flag, then in main sending the message detecting the flag.
The problem is that when the flag is detected in the main and the message is sent I can see in the logic analyzer how it has been split into 2 parts. But if I introduce the exact same code in the interruption callback it works perfectly. I have tried putting the code in the Main just before the loop and I always get the same result everywhere in main.c it only works okay in the stm32fxx_it.c file. Where stm32cubeIde generates the interruption callbacks.
This is the code I use to send:
uint8_t converted2[100] = {0b01011011, 0b01011011, 0b01011011, 0b01011011, 0b01000001, 0b01011011};
HAL_StatusTypeDef statuss;
statuss = HAL_UART_Transmit(&huart1, converted2, 6, 20);
How can I solve that?
Good transmission from callback:
Bad Transmission from main.c :
Many thanks!
