AnsweredAssumed Answered

STM32F427 USART INTERRUPT ERROR (HAL LIBRARY)

Question asked by EETT on Dec 18, 2014
Latest reply on Dec 24, 2014 by Montassar BEN ROMDHANE
Hello to everyone

i have being used to std library on stm. Now i passed to Hal library. I write an Usart code. I i dont use intrerrupt its work correct. But whe i set interrupt routine its not enter to RXNE IRQ handler. Code is below could you check and help me about my mistake.

HAL_Init();


  /* Configure the system clock */
  SystemClock_Config();


  HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_0);
  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);


  saveToFlash();
  MX_GPIO_Init();
     HAL_GPIO_WritePin(GPIOH,GPIO_PIN_12,GPIO_PIN_SET);


  MX_USART3_UART_Init();


     


     


     
 
  
     
     
        HAL_UART_Transmit(&huart3,(uint8_t*)dene,4,1000);
  
  
while (1)
  {
   
  }
 


}
void USART3_IRQHandler(void)
{
  HAL_NVIC_ClearPendingIRQ(USART3_IRQn);
 
}


void SystemClock_Config(void)
{


  RCC_OscInitTypeDef RCC_OscInitStruct;


  __PWR_CLK_ENABLE();


  __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3);


  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;
  RCC_OscInitStruct.HSICalibrationValue = 6;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
  HAL_RCC_OscConfig(&RCC_OscInitStruct);


}






/* USART3 init function */
void MX_USART3_UART_Init(void)
{
  __GPIOC_CLK_ENABLE();
     __USART3_CLK_ENABLE();
  huart3.Instance = USART3;
  huart3.Init.BaudRate = 115200;
  huart3.Init.WordLength = UART_WORDLENGTH_8B;
  huart3.Init.StopBits = UART_STOPBITS_1;
  huart3.Init.Parity = UART_PARITY_NONE;
  huart3.Init.Mode = UART_MODE_TX_RX;
  huart3.Init.HwFlowCtl = UART_HWCONTROL_NONE;
  huart3.Init.OverSampling = UART_OVERSAMPLING_16;
  HAL_UART_Init(&huart3);
     
     HAL_NVIC_SetPriority(USART3_IRQn, 0, 1);
  HAL_NVIC_EnableIRQ(USART3_IRQn);
  __HAL_UART_ENABLE_IT(&huart3,UART_IT_RXNE);
     __HAL_UART_ENABLE_IT(&huart3,UART_IT_TXE);


}



Thanx.

Outcomes