File transfer too slow with BLE

amem00
Posts: 6
Joined: Tue Jul 26, 2022 3:36 pm

File transfer too slow with BLE

Postby amem00 » Tue Aug 23, 2022 11:25 am

Hi,
I developped a firmware on STM32 in order to communication with my ESP32 through UART.
On ESP32 I only use the BLE module. Wifi is disabled.
STM32 sending AT commands in order to set all BLE parameters.
Through the BLE I'm able to update STM32 firmware, by sending new firmware to an external flash.
So for each packet of data received, the STM32 have to send the command AT+BLEGATTSSETATTR to update characteristic value followed by AT+BLEGATTSNTFY to notify client of the changed value.

For these two commands, I have to send the command and wait for the ">" symbol in order to send data.
I cannot block the program and let it wait adding delays in order to receive the ">".
So I,
1/ Send the command AT+BLEGATTSSETATTR (first pass), keep the program running until receiving ">" symbol.
2/ Send the data (second pass), keep the program running until receiving "OK".
3/ Send AT+BLEGATTSNTFY command (third pass), keep the program running until receiving ">" symbol.
4/ Send the data (fourth pass) and keep the program running until receiving "OK".

This way of programming make the file transfer very slow.
Is there another way of programming that makes the command and data to be sent on same shot ?
Is there any better solution in order to accelerate the transfer ?

NB: Baudrate is 115200 but the delay is mostly affected by the main loop of the STM32 program.

Thank you for your help

amem00
Posts: 6
Joined: Tue Jul 26, 2022 3:36 pm

Re: File transfer too slow with BLE

Postby amem00 » Wed Sep 07, 2022 8:28 am

Hi,
An idea came to my mind...
I found that some user defined AT command can be added to the set of AT command.
So the idea is to create a AT command that can accept command + data on the same frame and execute a characteristic value update and a notification update. Is it possible ?

Is there any detailed tutorial about adding user AT command.
I already seen https://docs.espressif.com/projects/esp ... mands.html# but it is not well explained.

Who is online

Users browsing this forum: No registered users and 41 guests