TouchGFX HAL_FLASH read write
I have a small working touchGFX project with freertos app on a stm32F746-disco.
I want to write a few variables to flash so I am trying to call write/read in StartDefaultTask, but I get a Hard Fault when I go to Lock the Flash. I have tried a few different locations (0x60000000 & 0x70000000) that should not be used.
Why might this not be working?
/* USER CODE BEGIN 0 */
uint32_t Flash_Address = 0x60000000;
/* USER CODE END 0 */
void StartDefaultTask(void *argument)
{
/* USER CODE BEGIN 5 */
// /* Infinite loop */
for(;;)
{
osDelay(100);
HAL_FLASH_Unlock();
HAL_FLASH_Program(FLASH_TYPEPROGRAM_BYTE, Flash_Address, 0x13);
HAL_FLASH_Lock();
}
/* USER CODE END 5 */
}
