Solved
Problems saving variables to FLASH in STM32G030F6P6
I've just bought a STM32G030F6P6 dev board and I'm testing its cababilities.
And one thing I'm having problems with is saving my data to the FLASH.
The first time it writes as espected in the FLASH, but not in the second, HAL_FLASH_Program returns HAL_ERROR.
#include "main.h"
uint32_t Address = 0x0800F800;
uint32_t buffer = 0x12345678;
uint32_t data1 = 0;
uint32_t data2 = 0;
HAL_StatusTypeDef status;
int main(void)
{
HAL_Init();
SystemClock_Config();
data1 = *(__IO uint32_t *)Address;
status = HAL_FLASH_Unlock();
status = HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, Address, buffer);
status = HAL_FLASH_Lock();
data2 = *(__IO uint32_t *)Address;
while (1)
{
}
}
void SystemClock_Config(void)...