2020-11-10 08:22 AM
Hi,
I was wondering what is the purpose of the API HAL_FLASH_Program_IT(..) provided by CubeMX (based on NUCLEO-F746ZG but seems to be widely the same for other MCU references..).
As it allows to write a single value at a time it seems useless to attempt writing data by interruption; Prefer polling API HAL_FLASH_Program(..) instead.
Also I expected to use interruption callback to chain multiple value writing, But the current logic from CubeMX code is not able to work like this (erroneous logic to unlock next write directly inside the interruption callback HAL_FLASH_EndOfOperationCallback(..) ).
Specially, I know that some of STM32 MCUs embed a dual bank memory to avoid blocking an application, and it could be particularly useful to let writing some flash data by interruption while the application is still running...
So I was wondering what is the real purpose of this interrupt API? Because I currently don't imagine another way to use it...
Note: erasing flash memory APIs offer possibility to erase multiple flash sectors; why not for programming flash memory?
Probable answer is that the code from CubeMX is not yet complete and does not offer this feature at the moment... Can someone provide me more clue?
Thanks,
Nadreoh
2023-08-03 12:39 AM
2023-08-04 05:37 AM
Note: erasing flash memory APIs offer possibility to erase multiple flash sectors; why not for programming flash memory?
Probable answer is that the code from CubeMX is not yet complete and does not offer this feature at the moment... Can someone provide me more clue?
The HAL doesn't have a function for programming a blocks of memory because it's developers haven't made a decent and actually useful code and therefore have no experience for such a necessity. There is your clue...
2023-08-04 07:04 AM
Most likely it is there for completeness of functional coverage. They want to test arrival of flash interrupts after various operation, so this function is useful to write tests. We end users don't have to use everything that sits there.