how to use multiple serial ports in stm32f103
Posted: Fri Jul 31, 2020 4:02 pm
i had a sensor with uart port and i need to communicate with that sensor with stm 32 but when it was not happening
Everything relating to using STM32 boards with the Arduino IDE and alternatives
https://www.stm32duino.com/
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".
Yes, but that's Roger Clarck's core.mrburnette wrote: Sun Aug 02, 2020 3:44 pm also:
https://stm32duinoforum.com/forum/wiki_ ... USB_Serial