Testing USART2 on STM32F303Discovery board

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
gav-gav
Posts: 10
Joined: Fri Sep 01, 2023 7:29 am

Testing USART2 on STM32F303Discovery board

Postby gav-gav » Fri Dec 22, 2023 9:11 am

Hi
I have problem with using for using USART2 instead USART1 for log output with chprintf on the Stm32f303discovery board.

I initialise chip:
BaseSequentialStream * chip= (BaseSequentialStream*)&SD2;
I initialise SD2 driver using instruction:
sdStart(&SD2,0);
Then I send information to Uart2 by the instruction;
chprintf(chp,”Main loop\n\r”);

All works without errors.

But when I want to see the output with the view Terminal in Chibios Studio and set serial port to /dev/ttyACM1 or any other, the Terminal view panel is empty.
Where is the problem?
Best Regards
Alexey Gavrilov
P.S. When I use Uart1 , all is good, I can see output information in Terminal view!

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Testing USART2 on STM32F303Discovery board

Postby Giovanni » Fri Dec 22, 2023 10:30 am

Hi,

USART2 is not connected to the debugger on the board, you cannot see it using the virtual com port. USART1 is physically connected to the ST-Link on board.

Giovanni

gav-gav
Posts: 10
Joined: Fri Sep 01, 2023 7:29 am

Re: Testing USART2 on STM32F303Discovery board

Postby gav-gav » Sun Dec 24, 2023 6:34 am

Hi!
Thank you for quick answer.
But how can I receive data from USART2?
Which connection should I use on PC?
Is USART2 useless?
Best Regards
Alexey Gavrilov

gav-gav
Posts: 10
Joined: Fri Sep 01, 2023 7:29 am

Re: Testing USART2 on STM32F303Discovery board

Postby gav-gav » Sun Dec 24, 2023 9:56 am

Hi!
I think that my question was silly.
For USART2 I must simply connect PA2 and PA3 pins on Stms32f393 Dicovery board with real external UART cable .
Is it true?
Best Regards
Alexey Gavrilov

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Testing USART2 on STM32F303Discovery board

Postby Giovanni » Sun Dec 24, 2023 12:30 pm

Yes, make sure to program correct GPIO alternate functions too.

There are also very cheap USB-uart adapters you could use.

Giovanni


Return to “ChibiOS/HAL”

Who is online

Users browsing this forum: No registered users and 2 guests