stm32duino/STM32duinoBLE

BLE transfer speed on STM32WB5 and corrupted data

Kasper-Gjoedesen-Mikkelsen opened this issue · 6 comments

I am limited to 150-180 bytes/s on the transfer speed when I write data from the STM32WB55 to a RPI with read and notify.
I have tested different timings for when the device poll and the advertising interval. Furthermore, I have tested with different buffer sizes between 8 and 22, and the data is corrupted if try to send more data than 22 bytes.

Result from a 30 byte uint8_t buffer of zeros: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01.

Is this a config error? and can the speed be increased?

Best regards Kasper G. Mikkelsen

Hi @Kamik18
Please, could you share you test sketch?

What is your config? Arduino IDE version? Core version? Library version? Selected options?...
all relevant information are welcome to help.

I guess it have a link to:

#define BLE_DEFAULT_ATT_MTU 23

and arduino-libraries#70

I am using PlatformIo as my Arduino IDE, and I have tried changing BLE_DEFAULT_ATT_MTU but without any influence on the data.

I tried modifying one of your examples (CallbackLED.ino, examples/Peripheral/CallbackLED/CallbackLED.ino), and kept every variable to their default values, where I used “BLENotify” to write a data buffer in a while loop. I did not use delay or anything else doing that test.
I furthermore tried creating a callback function to send data when requested by a RPI, and again without any delay on either the STM32 or the RPI.

Versions:
PlatformIo Core 5.1.1 and Home 3.3.4
Arduino_Core_STM32 2.0.0
STM32duinoBLE 1.2.0

I've tried using GrumpyOldPizza's ArduinoCore-stm32wb implementation on the Arduino IDE (following the README guide) and achieved impressive bandwidth. I can transfer ~120 bytes per package - speed is yet to be determined, but it is definitely faster.
However I still have issues migrating the project to PlatformIO.

Hi @KMeldgaard
Could you test if it works better with latest STM32 Core version (2.4.0), library version (1.2.2) and with an updated Wireless copro binary (HCI layer.bin)

I've tested and read and write up to 256 and have met no issue with latest core 2.4.0, latest library version 1.2.2 and latest wireless copro binary.