Page 1 of 1

Testing USART2 on STM32F303Discovery board

Posted: Fri Dec 22, 2023 9:11 am
by gav-gav
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!

Re: Testing USART2 on STM32F303Discovery board

Posted: Fri Dec 22, 2023 10:30 am
by Giovanni
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

Re: Testing USART2 on STM32F303Discovery board

Posted: Sun Dec 24, 2023 6:34 am
by gav-gav
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

Re: Testing USART2 on STM32F303Discovery board

Posted: Sun Dec 24, 2023 9:56 am
by gav-gav
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

Re: Testing USART2 on STM32F303Discovery board

Posted: Sun Dec 24, 2023 12:30 pm
by Giovanni
Yes, make sure to program correct GPIO alternate functions too.

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

Giovanni