cancel
Showing results for 
Search instead for 
Did you mean: 

USART3 (on Arduino connector CN14) troubles on stm32u5 iot eval board BU585IIO2A

PSchb.1
Associate II

i'm using the  stm32u5 iot eval board BU585IIO2A and want to use USART3 on Arduino connector CN14

i successfully got the PWM working on PIN7 of CN14 but i fail to get anything sent / received on UASRT3 (Pins 1 and 2 of CN14)

are there any hints / samples how to get this working ?

thx, peter

1 ACCEPTED SOLUTION

Accepted Solutions
Mike_ST
ST Employee

Yes, that should be the problem...

In the .ioc you have to assign it to PD8/PD9,

and you should end up with that:

   /* Peripheral clock enable */

   __HAL_RCC_USART3_CLK_ENABLE();

   __HAL_RCC_GPIOD_CLK_ENABLE();

   /**USART3 GPIO Configuration

   PD8    ------> USART3_TX

   PD9    ------> USART3_RX

   */

   GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9;

   GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;

   GPIO_InitStruct.Pull = GPIO_NOPULL;

   GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;

   GPIO_InitStruct.Alternate = GPIO_AF7_USART3;

   HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);

/* USART3 interrupt Init */

HAL_NVIC_SetPriority(USART3_IRQn, 0, 0);

HAL_NVIC_EnableIRQ(USART3_IRQn);

View solution in original post

13 REPLIES 13
Mike_ST
ST Employee

Hello,

USART3 is connected to STMOD+ connector as well through the U3 switch, as shown in schematic page 7.

So, please make sure that PH15 (STMOD+.UART3_SPI3_SEL) is set to Output Low.

Maybe that is the problem.

PSchb.1
Associate II

thx for your quick response.

actually, in the specs it reads that PH15 has to be set to HIGH and i did that.(page 35 PH15 set high)

which spec are you referring to ? (mine is : um2839-discovery-kit-for-iot-node-with-stm32u5-series-stmicroelectronics.pdf)

  /*Configure GPIO pin Output Level */
  HAL_GPIO_WritePin(GPIOH, GPIO_PIN_15, GPIO_PIN_SET);

best regards, peter

Mike_ST
ST Employee

I'm refering to the schematic:

https://www.st.com/resource/en/schematic_pack/mb1551-u585i-c02_schematic.pdf

Page 35 of the UM2839 user's manual explains how to use the USART3 on the STMOD+ CN2 connector, not on the Arduino connector.

In your case, you don't want the U3 switch to drive the USART3 lines.

So you have to set U3 to drive the SPI lines so it it won't disturb USART3 lines.

i really appriciate your support !

but it does not work for me and i still don't know why.

so, i tried it both ways , this way

HAL_GPIO_WritePin(GPIOH, GPIO_PIN_15, GPIO_PIN_RESET);

and this way

HAL_GPIO_WritePin(GPIOH, GPIO_PIN_15, GPIO_PIN_SET);

both ways do not work.

do you know the reason why ? what am i missing ?

how SHOULD it be set ? and when: just before MX_USART3_UART_Init(); or before using uart e.g with HAL_UART_Transmit(&huart3, "peter\r\n", 7, 10);

i made a small test project just for testing that UART3 on Arduino connector CN14 : should you send you the main.c ?

thx, again,

peter

Here is mine instead, tested using a USB <-> serial converter on the CN14 connector.

Hope that helps.

thx again, mike

but your main.c does not generate any output on UART3, as well (at least on my board) !

could you please send your complete functional project (to additionally make sure) ?

how could i possibly verify that this UART3 is actually working from the HW point of view ? (i already connected a scope)

as already mentioned PWM works on CN14.

kr, peter

Here is the hex file, so yo don't need to compile.

It is sending "Test" at 115200bps/8bit/No Par/1 Stop every seconds

You can also try to set PD8 and PD9 as GPIOs and check they toggle.

@mike : you're a great and FAST ! responder - thx a lot !

which tool should i use to program that hex file ?

both STMFlashLoader and STM32 ST-Link Utility fail to connect to my board.

only with STM32CubeIDE 1.7.0 i'm currently able to load new firmware (connected on USB port of board) ?

can i do that with STM32CubeIDE , as well ?

how can i connect with ST-Link or STMFlashLoader over USB ?

thx, peter

was able to download file now with latest STMCubeProgrammer.

your hex file firmware runs ok and generates the expected string on scope.

so, board HW seem to work OK.

we must still have some differences in our project settings - how could we find them ?

peter