cancel
Showing results for 
Search instead for 
Did you mean: 

Purpose of HAL_FLASH_Program_IT from CubeMX on NUCLEO-F746ZG?

Nadreoh
Associate II

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

3 REPLIES 3
sn1
Associate

@Nadreoh

Any input you found regarding the usage of the API HAL_FLASH_Program_IT(..)??

 

Piranha
Chief II

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...

Pavel A.
Evangelist III

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.