Page 1 of 1

how to use multiple serial ports in stm32f103

Posted: Fri Jul 31, 2020 4:02 pm
by Samba
i had a sensor with uart port and i need to communicate with that sensor with stm 32 but when it was not happening

Re: how to use multiple serial ports in stm32f103

Posted: Sat Aug 01, 2020 8:12 am
by GonzoG
More information would be nice...
What core, port, speed, sensor...

And to your main question:
https://github.com/stm32duino/wiki/wiki ... wareserial

Re: how to use multiple serial ports in stm32f103

Posted: Sun Aug 02, 2020 3:44 pm
by mrburnette
also:
https://stm32duinoforum.com/forum/wiki_ ... USB_Serial
Serial & USB Serial
Serial USB is enabled for all F103 boards when uploading using the bootloader, it is also available when uploading by ST-Link (SWD) In these cases:

- Serial.print("Hello world"); will print via Serial USB (CDC).
- Serial1 prints to hardware USART 1
- Serial2 prints to hardware USART 2
- etc
When uploading via "Serial" (external USB to Serial adaptor connected to PA9 and PA10 (USART1) on the STM32):

- Serial.print("Hello world"); will print to hardware USART1 (the one the code was uploaded using)
- Serial1 prints to hardware USART 2
- etc
Note. Some boards, e.g. Nucleo F103RB have special serial mapping, because these boards need to have hardware modification to make Serial usable.

The Serial <-> USART mapping is defined in file "variants//board.cpp".

Re: how to use multiple serial ports in stm32f103

Posted: Sun Aug 02, 2020 8:04 pm
by GonzoG
Yes, but that's Roger Clarck's core.

Re: how to use multiple serial ports in stm32f103

Posted: Mon Aug 03, 2020 9:27 am
by fpiSTM
Hi @Samba
Could you tell us which core you used ?
Else we will not be able to help.