STM32CubeL4
STM32CubeL4 copied to clipboard
32L4R9IDISCOVERY FLASH_FastProgram; Problem with source=destination
Describe the set-up
I am using the VisualGDB extension for Visual Studio.
Describe the bug
I noticed the the HAL_FLASH_Program failed to program when the source was the same as the destination. I have a fix that puts the source data in a different variable, but someone may wish to look at the HAL and do some error checking if the source and destination addresses to program are then same.
How To Reproduce
Compile and run as-is.
Screenshots
Here, we see the src_addr address being set to same address of Data64_To_Prog in Flash. (which is not very interesting, particularly after the flash is erased.

Hi @gojimmypi,
Thank you for this report. We will get back to you with a feedback as soon as possible. Please excuse the delay it may take us sometimes to reply. Thank you for your comprehension.
With regards,
Hi @gojimmypi,
Thank you for this detailed report. An internal tracker has been logged in our database to improve some flash examples (FLASH_EraseProgram, FLASH_FastProgram, FLASH_WriteProtection), before we received your request. Some enhancements will be implemented and made available in the frame of a future release.
We cannot share a date regarding its deployment and publication. We count on your patience and comprehension. Thank you again for you report. We are looking forward to reading from you again.
With regards,
ST Internal Reference: 83807
Hi @gojimmypi,
I hope you are doing well. Thank you for your proposal. Currently, there is no plan to consider this use-case.
Moreover, in the examples provided showing how to use the fast programming feature, it is indicated that the area to program should be in a different bank, as shown in the code snippet below.
https://github.com/STMicroelectronics/STM32CubeL4/blob/e691a513a48d0014f201ce35a265cbfca446396d/Projects/STM32L476G-EVAL/Examples/FLASH/FLASH_FastProgram/Src/main.c#L35-L37
Please allow me to close this issue. Thank you for your comprehension.
With regards,