2019-08-28 05:05 AM
Hello,
I am using STM32G070CBT6 Controller.
I am trying to write and read in 63rd page of flash memory .
HAL_FLASH_Unlock();
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP |
FLASH_FLAG_WRPERR |
FLASH_FLAG_PGAERR);
FLASH_PageErase(63);
HAL_StatusTypeDef Stat1 =HAL_FLASH_Program(TYPEPROGRAM_DOUBLEWORD, 0x0801F800 , 0xAB); // 0xAB is dummy write
HAL_FLASH_Lock();
HAL_Delay(10);
const volatile uint8_t *userConfig=(const volatile uint8_t *)0x0801F800;
HAL_UART_Transmit(&huart1,(uint8_t *)&userConfig,1,20);
When i program this i am receiving 0x00 in UART.
Please guide.
2020-01-09 04:07 AM
SLA, Thanks!
My first steps with eeprom emulation.
What is ?
EE_ADR_MAX
Is this correct?
#define EE_ADR_MAX ((FEE_PAGE_SIZE/4)-1) //???
You don´t declare EE_ADR_MAX in your example.
Thanks!
2020-01-09 04:33 AM
Hi Danny,
EE_ADR_MAX is the array size for the EEdata Array you need:
#define EE_ADR_MAX 10
uint32_t EE_Array[EE_ADR_MAX] = {0};
Regards
SLA
2020-01-10 08:11 AM
Hi SLA,
Thanks!
2020-01-14 07:54 AM
@SLA
Thanks for the implementation, works fine!
@Danny
#define EE_ADR_MAX ((FEE_PAGE_SIZE/4)-1)
Work for me, thanks to.