cancel
Showing results for 
Search instead for 
Did you mean: 

STM32Cube_FW_H7_V1.9.0 pFlash variable in stm32h7xx_hal_flash module

DUgbo.1
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
DUgbo.1
Associate II

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

View solution in original post

1 REPLY 1
DUgbo.1
Associate II

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