I just started working with STM32F407GZ and I for the start I wanted to turn on/off LED's on-board. I am using CubeMX to generate initialization code. I can receive and transmit data but it doesn't gets correctly the data recived. Also, the leds don't turn on until I click the reset button. When I click the reset button the leds turn on but I stop receiving and transmiting data.
This is the code:
MX_GPIO_Init();
MX_DMA_Init();
MX_USART3_UART_Init();
HAL_UART_Receive_DMA(&huart3,receive,20);
while (1)
{
HAL_Delay(100);
HAL_UART_Receive_DMA(&huart3,receive,20);
HAL_UART_Transmit_DMA(&huart3,receive,20);
HAL_Delay(100);
HAL_GPIO_WritePin(GPIOF,GPIO_PIN_9,GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOF,GPIO_PIN_6,GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOF,GPIO_PIN_7,GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOF,GPIO_PIN_8,GPIO_PIN_SET);
HAL_Delay(500);
}