Serial firmware flash very slow than stlink firmware flash?

Hi ,
I’m using stm32 767zi nucleo board with Arduino core for our project . The firmware size is about 360-400kb .When I flash using stlink it takes about 3 seconds .However ,when I’m using serial method (which required in our project) to flash it takes about 45 seconds .Even if I change the upload speed to 912k there is no change. Is there any way to improve the upload speed ?

.ini
[env]
platform = ststm32
board = nucleo_f767zi
framework = arduino
upload_protocol = Serial
upload_speed = 912600
monitor_speed = 9600

Thanks,
Sam.

Per https://www.st.com/resource/en/application_note/cd00264342-usart-protocol-used-in-the-stm32-bootloader-stmicroelectronics.pdf page 2.2

The calculation of the serial baud rate for USARTx, from the length of the first received byte,
is used to operate the bootloader within a wide range of baud rates. However, the upper and
lower limits have to be kept, to ensure proper data transfer.

BHigh is the highest baud rate for which the deviation does not exceed the limit. All baud
rates between BLow and BHigh are below the deviation limit.The highest tested baud rate (BHigh) is 115200.

And as one can see in

PlatformIO is already calling the stm32flash tool with the maximum tested baud rate, 115200.

Everything beyond that is dangerous untested-by-STM territory. You can still locally modify C:\Users\<user>\.platformio\platforms\ststm32\builder\main.py with regards to the 115200 value shown above to test it.

However, even the fastest UART rate of maybe 1 Megabaud will always be significantly slower than flashing via SWD, which can go up to 24MHz with the STLink-V3 hardware. It’s a losing game with UART.

@ maxgerhardt
Thanks for the info ! I rather not change the recommended speed by ST .It’s just the matter of time it takes to flash the firmware which is kind of sucks .

Thanks again !
Samson.