Associate
December 7, 2019
Question
Simple UART1 DMA dosent work generated with latest STM32CUBEMX 5.4.0 and STM32F0 1.11.0
- December 7, 2019
- 4 replies
- 1486 views
Help!
Generating a minimum configuration with UART1 in DMA mode.
The blocking version if(1) works, but with if(0) the DMA version nothing comes out.
Configuration file for CubeMX attached.
What am i missing??
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
static uint16_t usLEDfwTimer=0;
static uint8_t ucByte[]="A";
if(++usLEDfwTimer>=50000) //around 10 times per second
{
usLEDfwTimer=0;
if(1)
{
HAL_StatusTypeDef sU=HAL_UART_Transmit(&huart1,(uint8_t*)&ucByte[0], 1,1); //this works !
}else
{
HAL_StatusTypeDef sU=HAL_UART_Transmit_DMA(&huart1,(uint8_t*)&ucByte[0], 1); //dosent work
}
if(ucByte[0]>'Z')ucByte[0]='A';else ucByte[0]++;
}
}
/* USER CODE END 3 */