Fastest method to transmitt huge chunck of data from app to flash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-10-15 6:44 AM
Hi all,
I need a dual bank firmware update to meet some requirements. I have a STM32WB55 with 1MB of flash which is seperated in 3 sections of 300kb (ble, appliciation and an update stack) + bootloader. I can do a firmware update and now im trying to speed up the transmission process.
Currently im sending the binary to the update stack. My ble service sends 4 bytes header with 16 bytes of data and directly safe the data on flash using HAL_FLASH_Program and a semaphore (required for bluetooth connection see ble_RfWithFlash). Because programming flash is pretty slow, 5.5 ms for double word, so > 11ms per message, it takes a long time to transfer the entire binary...
What would be a good way to improve this timewise? I came up with a two solution but dont know what is the best approach and what the advantages and disadvantages would be.
- Create a buffer of one page and use fast program to program one entire page instead of 2 double-words each time(i do have enough free ram)
- Use data length extending for the ble service and send 250 bytes each time
Or if you have another solution please share!
Thanks in advance,
Solved! Go to Solution.
- Labels:
-
Flash
-
STM32WB series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-10-16 5:35 AM
​The double buffer strategy seems to me the best strategy both from speed and from CPU load standpoint (less commands and events to process).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-10-15 9:46 AM
I decided to implement a double buffer strategy. Have two buffers, when one is full write it to flash while still receiving more data on the other buffer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-10-15 11:57 PM
Thanks for your reply, thats a good option as well!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-10-16 5:35 AM
​The double buffer strategy seems to me the best strategy both from speed and from CPU load standpoint (less commands and events to process).
