AnsweredAssumed Answered

HAL_UART_RxCpltCallback(UART_HandleTypeDef *UartHandle) Not work

Question asked by saba.ramin on Feb 7, 2015
hi
I create a project with cubeMX & Arm_MDK(keil) for stm32f4 discovery.
T want learn uart interrupt driven .my code:
//------------------------------------------------------------------------
UART_HandleTypeDef  huart6;
int main(void)
{
    HAL_Init();
    SystemClock_Config();
    MX_GPIO_Init();
    MX_USART6_UART_Init();
    HAL_UART_Receive_IT(&huart6, (uint8_t *)aRxBuffer, 8);
    while (1)
    {
        HAL_GPIO_WritePin(GPIOD,GPIO_PIN_13,GPIO_PIN_SET);
        HAL_Delay(1000);
     }
}

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *UartHandle)
{
    HAL_GPIO_WritePin(GPIOD,GPIO_PIN_14,GPIO_PIN_SET);
}
//------------------------------------------------------------------------
in stm32f4xx_hal_msp.c  I find this code:
/* System interrupt init*/
    HAL_NVIC_SetPriority(USART6_IRQn, 0, 0);
    HAL_NVIC_EnableIRQ(USART6_IRQn);
in   stm32f4xx_it.c I find:
void USART6_IRQHandler(void)
{
   HAL_UART_IRQHandler(&huart6);
}



but   HAL_UART_RxCpltCallback(UART_HandleTypeDef *UartHandle)  not work and GPIOD-pin-14 not on.
is there a bug in cubeMX? or .....
thank
ramin

Outcomes