cancel
Showing results for 
Search instead for 
Did you mean: 

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

danielle
Associate
Posted on May 29, 2014 at 18:20

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

#9i-eval #stm32 #uart
1 REPLY 1
Posted on May 29, 2014 at 19:01

Pretty sure I've had it working on the STM324x9I-EVAL board, I'm not using Cube, and don't have the board/examples to hand right now.

Although if it's using USART PA9/PA10 I've definitely posted examples for the F4 to the forum here.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..