2022-03-24 02:24 AM
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
Solved! Go to Solution.
2022-03-25 06:37 AM
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);
2022-03-24 09:08 AM
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.
2022-03-24 09:47 AM
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
2022-03-24 10:04 AM
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.
2022-03-25 02:10 AM
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
2022-03-25 03:00 AM
2022-03-25 04:52 AM
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
2022-03-25 05:05 AM
2022-03-25 05:37 AM
@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
2022-03-25 05:51 AM
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