2020-02-18 06:47 AM
I have the following code:
HAL_UART_Transmit_DMA(Outgoinghuart, (uint8_t *)message, sizeOfMessage);
delay(10000);
HAL_UART_Transmit_DMA(Outgoinghuart, (uint8_t *)message, sizeOfMessage);
The second DMA transmit is always busy, no matter how big the delay. (I checked the delay function is 100% working on the scope)
I have tried using:
/*##-3- Wait for the end of the transfer ###################################*/
while (UartReady != SET)
{
}
/* Reset transmission flag */
UartReady = RESET;
and tried everything else in that GitHub example. It doesn't make any difference the gState
is always busy after the first transfer.
It works 100% if I use HAL_UART_Transmit().
Any ideas would be great (I have scanned every forum post on this and none of them work)
Even ideas on diagnosing the issue would be great! Thanks =)
Solved! Go to Solution.
2020-02-21 03:02 AM
After an entire week wasted thinking it was a code issue. It was attolic studio. Breakpoints to be specific.
To fix the issue:
1) Clear all breakpoints
2) Power cycle board
3) Re-flash the board
now everything works... This IDE finds new ways to annoy the hell out of me!
2020-02-18 07:51 AM
It works for me on a STM32F042 Nucleo. There is (was?) a bug concerning the generated init code: DMA must be init before UART:
MX_GPIO_Init();
MX_DMA_Init();
MX_USART2_UART_Init();
If this doesn't help, post more details.
hth
KnarfB
2020-02-18 12:31 PM
2020-02-21 03:02 AM
After an entire week wasted thinking it was a code issue. It was attolic studio. Breakpoints to be specific.
To fix the issue:
1) Clear all breakpoints
2) Power cycle board
3) Re-flash the board
now everything works... This IDE finds new ways to annoy the hell out of me!