Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returns false, Please add example #3

Open
pooyasa opened this issue Jan 15, 2020 · 2 comments
Open

Returns false, Please add example #3

pooyasa opened this issue Jan 15, 2020 · 2 comments

Comments

@pooyasa
Copy link

pooyasa commented Jan 15, 2020

Hi,
first of all, thank you for this library
I wanted to use this to store permanent data on my STM32F030K6T6
However, EE_Write() and EE_Writes() both return false on
if(HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD((i+StartVirtualAddress)*4)+_EEPROM_FLASH_PAGE_ADDRESS,(uint64_t)Data[i])!=HAL_OK)
which is on line 172 of eeprom.c
what could be the cause of the problem?

@nimaltd
Copy link
Owner

nimaltd commented Jan 15, 2020 via email

@hosseinghaheri
Copy link

hosseinghaheri commented Jul 18, 2022

Hi. I have the same problem with STM32F030K6T6.
The ee_write function returns false in all cases.

If the microcontroller is programmed in Erase Full Chip mode.
The ee_write function returns false, but the storage is done.

Pay attention to the following code (Erase Full Chip mode):

uint8_t to_write = 125;
uint8_t to_read = 0;

ee_init();

ee_write(0,1, &to_write);            // return False
ee_read(0,1, &to_read);              // to_read is 125

to_write=150;

ee_write(0,1, &to_write);            // return False
ee_read(0,1, &to_read);              // to_read is 125

eeConfig.h:

#define   _EE_USE_FLASH_PAGE_OR_SECTOR              (31)
#define   _EE_USE_RAM_BYTE                          (256)
#define   _EE_VOLTAGE                               FLASH_VOLTAGE_RANGE_3 //  use in some device

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants