You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello I have been using this great library for OTA over Wifi of my project using STM32F407VE mcu with 512kb of flash.
Everything was working fine for months but now as my code evolves the .bin file is getting large and 155kb in size and with this size the update will be halted with serial message "There is not enough space to store the update. Can't continue with update."
After that I have updated the MCU from STM32F407VE 512KB to STM32F407VG 1Mb but the issue still happen , can it be the Internalstorage class is calculating the available space wrong for the STM32F407VG ?
STM32F407VE compilation details - firmware uses of Flash: [=== ] 30.2% (used 158208 bytes from 524288 bytes)
STM32F407VG compilation details - firmware uses of Flash: [== ] 15.1% (used 158208 bytes from 1048576 bytes)
The F4 flash is split into sectors. 0 to 3 are 16 kB, 4 is 64 kB and the rest are 128 kB.
ArduinoOTA is set to store the update starting from sector 5. (half of a 512kB flash).
You can change the sector to use with define OTA_STORAGE_STM32_SECTOR in boards.local.txt
Create a file boards.local.txt next to boards.txt file in hardware package. There you can set build.extra_flags for individual boards, like this:
file in hardware package. There you can set build.extra_flags for individual boards, like this:
Thank you for the answer and the hint but its too complex to do that I do not know the exact locations where the board.txt files are very difficult to find out what exactly I have to do
I tried to change the sector from 5 to 8 in InternalStorageSTM32.cpp as per below image but I got the same error as not enough space Thanks for the help so far , any other possible causes ?
Also If I leave the sector set to 5 as original and I include the below serial print statement for InternalStorage.maxSize I get the Flash size of 131 kb so it seems that the bootloader is 381 kb is that possible ?
Thanks for all your help I managed to get it working by adding -DOTA_STORAGE_STM32_SECTOR=9 as a build flag in platformio.ini i attached below for anyone as a reference in future
Activity
JAndrassy commentedon Oct 24, 2023
The F4 flash is split into sectors. 0 to 3 are 16 kB, 4 is 64 kB and the rest are 128 kB.
ArduinoOTA is set to store the update starting from sector 5. (half of a 512kB flash).
You can change the sector to use with define OTA_STORAGE_STM32_SECTOR in boards.local.txt
Create a file boards.local.txt next to boards.txt file in hardware package. There you can set build.extra_flags for individual boards, like this:
gcharles81 commentedon Oct 24, 2023
Thank you for the answer and the hint but its too complex to do that I do not know the exact locations where the board.txt files are very difficult to find out what exactly I have to do
I tried to change the sector from 5 to 8 in InternalStorageSTM32.cpp as per below image but I got the same error as not enough space Thanks for the help so far , any other possible causes ?

Also If I leave the sector set to 5 as original and I include the below serial print statement for InternalStorage.maxSize I get the Flash size of 131 kb so it seems that the bootloader is 381 kb is that possible ?
Serial.print("FLASH Size kb= ");
Serial.println(test);
"Serial print from terminal " - FLASH Size kb= 131072
JAndrassy commentedon Oct 25, 2023
C:\Users\user\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0
maxsize is the space for the sketch. sector 5 starts at 128 kB so it is 131072 bytes in sector 0 to 4
(128 kB is 131072 bytes)
gcharles81 commentedon Oct 26, 2023
Hello I created the board.local.txt file but I still have the same issue that not enough space is available
JAndrassy commentedon Oct 27, 2023
did you restart the IDE?
gcharles81 commentedon Oct 27, 2023
Yes have restarted platformio multiple times ,
JAndrassy commentedon Oct 27, 2023
PlatformIO? maybe it has the boards package somewhere else or it doesn't process local.txt files
gcharles81 commentedon Oct 27, 2023
Thanks for all your help I managed to get it working by adding -DOTA_STORAGE_STM32_SECTOR=9 as a build flag in platformio.ini i attached below for anyone as a reference in future

JAndrassy commentedon Oct 27, 2023
so yes, Arduino doesn't have a project configuration file. that is better in plaformio