STM32Cube_FW_H7_V1.9.0 pFlash variable in stm32h7xx_hal_flash module
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-02 4:33 AM
The private variable "FLASH_ProcessTypeDef pFlash" in stm32h7xx_hal_flash.c is used in some functions I notice that it is not initialize by any function.
So for example the first time a call is made to: FLASH_Program(uint32_t TypeProgram, uint32_t FlashAddress, uint32_t DataAddress)
the result of the line is __HAL_LOCK(&pFlash); is undefined. So it will only work by chance on the first call, successive calls are granted to succeed as __HAL_UNLOCK(&pFlash); has been called
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-02 6:01 AM
I have done a bit more research and as HAL_UNLOCKED = 0x00 and pFlash fields will be set to '0' as it a global variable; So it is not undefined and there is no issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-02 6:01 AM
I have done a bit more research and as HAL_UNLOCKED = 0x00 and pFlash fields will be set to '0' as it a global variable; So it is not undefined and there is no issue
