AnsweredAssumed Answered

NEO-6M STM32F103 Nucleo

Question asked by Bartocha.Mateusz.001 on Oct 29, 2016
Latest reply on Nov 1, 2016 by Bartocha.Mateusz.001
Hi!

I'm trying to communicate with NEO-6M GPS module by nucleo F103.

NEO_6M starts transmitting date by itselfs, I've check TX signal on a scope and I can see frames.

And now straight to the problem - I'm not getting and interrupt on micro.
I'm using UART2 - RX on PA3.

My code:

/* USART2 init function */
void MX_USART2_UART_Init(void)
{
 
  huart2.Instance = USART2;
  huart2.Init.BaudRate = 9600;
  huart2.Init.WordLength = UART_WORDLENGTH_8B;
  huart2.Init.StopBits = UART_STOPBITS_1;
  huart2.Init.Parity = UART_PARITY_NONE;
  huart2.Init.Mode = UART_MODE_RX;
  huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
  huart2.Init.OverSampling = UART_OVERSAMPLING_16;
  HAL_UART_Init(&huart2);
}
 
/.../
 
/* USER CODE BEGIN 4 */
 
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart2)
{
     
}
/* USER CODE END 4 */

smt32f1xx_it.c

/* USER CODE BEGIN 1 */
 
void USART2_IRQHandler(void)
{
    HAL_UART_IRQHandler(&huart2);
}
 
 
/* USER CODE END 1 */


and MSP

void HAL_UART_MspInit(UART_HandleTypeDef* huart)
{
 
  GPIO_InitTypeDef GPIO_InitStruct;
  if(huart->Instance==USART2)
  {
  /* USER CODE BEGIN USART2_MspInit 0 */
 
  /* USER CODE END USART2_MspInit 0 */
    /* Peripheral clock enable */
    __USART2_CLK_ENABLE();
   
    /**USART2 GPIO Configuration   
    PA2     ------> USART2_TX
    PA3     ------> USART2_RX
    */
    GPIO_InitStruct.Pin = USART_TX_Pin|USART_RX_Pin;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
 
  /* USER CODE BEGIN USART2_MspInit 1 */
         
        HAL_NVIC_SetPriority(USART2_IRQn,1,0);
        HAL_NVIC_EnableIRQ(USART2_IRQn);
 
  /* USER CODE END USART2_MspInit 1 */
  }
 
}

To test I'm simply setting breakpoint on USART2_IRQHandler and I'm not hiting it.

Any clues?

Thanks!

Matthew

Outcomes