AnsweredAssumed Answered

STM32439I-EVAL Can't receive on USART1 (CN8 on board), Tx works

Question asked by dani on May 29, 2014
Latest reply on May 29, 2014 by Clive One
Hi,
I am unable to get the serial port receive to work with this EVAL board.  It also does not work with the UART_Hyperterminal_IT example in the STM32 CubeF4 version 1.1.  Transmit works fine, and it generates the TX complete interrupt.  I can check the Rx and Tx signals with a logic analyzer and they are there.
Ideally, I'd like this to work with interrupts, but I can't even get the blocking call( HAL_UART_Receive) to work.
There just does not seem to be anything in the buffer.  I also generated code from scratch using the STMCubeMX with the same result.  I am using putty terminal on the other end, and am typing characters and they don't get seen.  JP7 is set to RS232_RX.  I am out of ideas.  Has anyone gotten Rx on this EVAL kit to work on that serial port?

Here's some of my config code (auto generated by STMCubeMX):
in main.c:
/* USART1 init function */
void MX_USART1_UART_Init(void)
{
  huart1.Instance = USART1;
  huart1.Init.BaudRate = 115200;
  huart1.Init.WordLength = UART_WORDLENGTH_8B;
  huart1.Init.StopBits = UART_STOPBITS_1;
  huart1.Init.Parity = UART_PARITY_NONE;
  huart1.Init.Mode = UART_MODE_TX_RX;
  huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
  huart1.Init.OverSampling = UART_OVERSAMPLING_16;
  HAL_UART_Init(&huart1);
}
------------------------
in stm32f4xx_hap_msp.c:
void HAL_UART_MspInit(UART_HandleTypeDef* huart)
{
  GPIO_InitTypeDef GPIO_InitStruct;
  if(huart->Instance==USART1)
  {
    /* Peripheral clock enable */
    __USART1_CLK_ENABLE();
  
  /**USART1 GPIO Configuration  
  PA10   ------> USART1_RX
  PA9   ------> USART1_TX 
  */
    GPIO_InitStruct.Pin = GPIO_PIN_10|GPIO_PIN_9;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
    GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);


    /* Peripheral interrupt init*/
    /* Sets the priority grouping field */
    HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_0);
    HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);
    HAL_NVIC_EnableIRQ(USART1_IRQn);
  }
}

Thanks.
Danielle

Outcomes