Page 1 of 1

Softwareserial issue on stm32 f411re

Posted: Tue Jun 23, 2020 5:51 pm
by DonGorgon
Hello everyone,

I got a shield for arduino uno. There are 2 UART devices on this shield .
On arduino uno everything work fine. So i decide to install my shield on nucleo64 board.
my nucleo is equipped with stm32 f411re core. i'm using stm32duino api.

And here occure an issue. UARt devices doesn't work together.
When i run them separtly (only one is initialized) they work fine.

I can't use HardwareSerial, cause they are not connected to hardwareserial pins.

I tried also used "Serial.listen()" function but it doesnt help.

Are there any limitations due to softwareserial on stm32duino compare to normal arduino?
Or i miss something ?

Thanks in advance for any help,

Re: Softwareserial issue on stm32 f411re

Posted: Wed Jun 24, 2020 7:58 am
Hi @DonGorgon,
The PullRequest provides some informations about softwareSerial implementation. ... 2/pull/645

As you can see, yes there is a limitation:
baudrate max 57600 with 80MHzh MCU frequency. And this is for a single SoftwareSerial.
Nevertheless,the good new is that example 'TwoPortReceive' used to work well. Please note that baudrate for this example is 9600.

So I would advice you to decrease baudrate as much as possible.
And try to start from 'TwoPortReceive' example and adapt it to your shield.
Try to simplified your sketch to the minimum: keep only Software serial (to avoid being disturbed by other stuff, specially around interrupt treatment) and check whether it is still failed.

If still failed, can you provide more information on your setup:
* which baurate are you using for both devices ?
* which shield are you using ?
* how devices are working (asynchronous data sending to MCU or only on request from the MCU ...)?
* You may share your sketch (simplified to keep only software serial and confirmed it is still failed )
* describe a bit more how it fails: only 1 device doesn't work ? or both ? are data corrupted or you never get data ? ...