cancel
Showing results for 
Search instead for 
Did you mean: 

uart 2 and uart 3 not transmitting in B-U585I-IOT02A

shivss
Associate II

HI 

  am using stm32 B-U585I-IOT02A  dev board in that the uart2 and uart3 are not transmitting the data but its receiving the data . I have set PH 13 and PH 15 high also . but Tx is not working only Rx working

my code

Screenshot 2025-06-14 210522.png

in this only hello2 getting in my serial terminal.

1 ACCEPTED SOLUTION

Accepted Solutions
Karl Yamashita
Principal

I have the B-U585I-IOT02A and just tested with USART2. I can get UART2 Tx to work just fine.

I took the STMOD+ and have it on CN3 with Rx and Tx jumped.

I am using VCP (USART1) to receive some string and transmit the string on USART2. Then the callback takes the USART2 string it just received and loops it back to VCP. 

 

PXL_20250615_061900963.MP.jpg

KarlYamashita_0-1749968863502.png

 

I've attached the project that I've just tested with.

 

 

 

 

 

I was told that if a devices starts to smoke, put the smoke back in. I guess I never got all the smoke because the device never worked afterwards.
Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.

View solution in original post

6 REPLIES 6
Karl Yamashita
Principal

PH13 and PH15 do not have UART peripherals.

KarlYamashita_0-1749934932521.png

KarlYamashita_1-1749934992151.png

 

Those pins are used to switch between 1 and 2 on the switcher 

KarlYamashita_2-1749935351217.png

 

Look at the schematic again, you'll see that USART2_TX is PA2 and USART3_TX is PD8

 

I was told that if a devices starts to smoke, put the smoke back in. I guess I never got all the smoke because the device never worked afterwards.
Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.

Hi @Karl Yamashita 

   PH 13 and 15 are not uart2 and 3 pins yes but need to use that for on board uart2 and 3 to work according to the user manual , used PA2 and PD8 only for Tx 

Screenshot 2025-06-15 074028.png

Sorry, I've misinterpreted your "set" to high, as in pulled-up to high for the Tx pins.

 

If you are receiving on USAT3, then the switcher is configured correctly. So what are you transmitting to?

 

Also, use strlen to send the correct amount of characters.

HAL_UART_Transmit(&huart2, (uint8_t*)"hello\n", strlen("hello\n"), 100) 

 

I was told that if a devices starts to smoke, put the smoke back in. I guess I never got all the smoke because the device never worked afterwards.
Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.

Hi @Karl Yamashita 

  not even receiving on uart3 also .  

HAL_UART_Transmit(&huart2, (uint8_t*)"hello\n", strlen("hello\n"), 100) 

after trying this also not getting output.

 but I found something that PH13 is getting automatically low ? why 

if (rx_buf[0] == 's') 
		{
			HAL_GPIO_WritePin(GPIOH, GPIO_PIN_13, GPIO_PIN_SET);

			HAL_UART_Transmit(&huart2, (uint8_t*) "hello\n", strlen("hello\n"),
					100);
			if (HAL_UART_Transmit(&huart2, (uint8_t*) "hello1\n",
					strlen("hello1\n"), 100) == HAL_OK) {
				HAL_UART_Transmit(&huart1, (uint8_t*) "hello2\n",
						strlen("hello2\n"), 100);
			}
			rx_buf[0] = 0;
			j = 0;
			if (HAL_GPIO_ReadPin(GPIOH, GPIO_PIN_13) == GPIO_PIN_RESET) {
				HAL_UART_Transmit(&huart1, (uint8_t*) "PH13 LOW!\n", 10, 100);
			} else {
				HAL_UART_Transmit(&huart1, (uint8_t*) "PH13 HIGH!\n", 10, 100);
			}
		}

I need to set pin high every time? i don't think so   

output of uart1:

hello2
PH13 LOW!

if I comment the write pin then uart2 is not transmitting  

Karl Yamashita
Principal

I have the B-U585I-IOT02A and just tested with USART2. I can get UART2 Tx to work just fine.

I took the STMOD+ and have it on CN3 with Rx and Tx jumped.

I am using VCP (USART1) to receive some string and transmit the string on USART2. Then the callback takes the USART2 string it just received and loops it back to VCP. 

 

PXL_20250615_061900963.MP.jpg

KarlYamashita_0-1749968863502.png

 

I've attached the project that I've just tested with.

 

 

 

 

 

I was told that if a devices starts to smoke, put the smoke back in. I guess I never got all the smoke because the device never worked afterwards.
Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.

Hi @Karl Yamashita 

  Thanks for the help