Skip to content

[WIP] stm32L0xx soc series has an embedded EEPROM #1129

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

Merged
merged 3 commits into from
Aug 24, 2020

Conversation

FRASTM
Copy link
Contributor

@FRASTM FRASTM commented Jul 22, 2020

The EEPROM area of the stm32L0xx or stm32L1xx devices is mapped in the non volatile memory
and accessed with dedicated HAL functions.
The eeprom_write_byte and eeprom_read_byte functions are valid for this actual EEPROM area to access byte per byte.
For stm32L0 and L1 devices the buffered method (eeprom_buffer_fill, eeprom_buffer_flush) is not well suited especially for writing.
It is decided to remove eeprom_buffer_fill, eeprom_buffer_flush in case of stm32L0x and stm32L1x.

Note: the eeprom_buffer structure used for buffered operations is sized by a FLASH PAGE (usually 128 or 256 bytes). For stm32L0 and stm32L1, the eeprom_buffer cannot map the whole EEPROM area, else is the time to flush (write) too long (up to 15 seconds to flush 16K).

With this patch the EEPROM.length() reports 0x1800 for stm32L0 devices with 6K-EEPROM.

Fixes #1016

@FRASTM FRASTM force-pushed the eeprom_l0 branch 5 times, most recently from 6698ee6 to 7ffd1d9 Compare July 22, 2020 16:15
@fpistm fpistm self-requested a review August 14, 2020 14:13
@fpistm fpistm added the fix 🩹 Bug fix label Aug 14, 2020
@fpistm fpistm added this to the 2.0.0 milestone Aug 14, 2020
@fpistm fpistm added Request and removed Request labels Aug 17, 2020
Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moreover it seems all STM32L0/L1 have an real EEPROM so I guess it should be fine to clean up all other code which will not be used. Example in eeprom_buffer_flush

@FRASTM FRASTM force-pushed the eeprom_l0 branch 2 times, most recently from 5805caf to ff77452 Compare August 18, 2020 10:08
@FRASTM
Copy link
Contributor Author

FRASTM commented Aug 18, 2020

For both series stm32L0xx and st32L1xx that have EEPROM, the area is defined between DATA_EEPROM_BASE and DATA_EEPROM_END

@FRASTM
Copy link
Contributor Author

FRASTM commented Aug 19, 2020

removing defined(FLASH_EEPROM_BASE) in the libraries/SrcWrapper/src/stm32/stm32_eeprom.c
as definition comes from DATA_EEPROM_BASE

Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FRASTM FRASTM force-pushed the eeprom_l0 branch 3 times, most recently from ac1f309 to a2e6365 Compare August 19, 2020 16:15
Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Astyle need to be fixed.

@FRASTM FRASTM force-pushed the eeprom_l0 branch 3 times, most recently from 3e3d770 to 052c8a0 Compare August 20, 2020 09:15
@fpistm fpistm self-requested a review August 20, 2020 16:15
Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always unable to execute properly the buffered example.

@FRASTM
Copy link
Contributor Author

FRASTM commented Aug 21, 2020

on nucleo board STM32L073RZ / SMT32L1xx , BufferedEEPROM test is no more applicable

@fpistm
Copy link
Member

fpistm commented Aug 21, 2020

With a NucleoL152RE not and also with Nucleo L53R8

@FRASTM
Copy link
Contributor Author

FRASTM commented Aug 21, 2020

removing all buffered access functions in case of EEPROM (mainly stm32L0x and stm32L1x)

--> BufferedEEPROM example is no more applicable

@FRASTM
Copy link
Contributor Author

FRASTM commented Aug 24, 2020

fix compilation error
removing all references to eeprom_buffer[]

@fpistm fpistm self-requested a review August 24, 2020 07:19
FRASTM added 3 commits August 24, 2020 11:36
This EEPROM area is mapped in the non volatile memory
and accessed with dedicated HAL functions
In this case, the EEPROM area is defined
from DATA_EEPROM_BASE to DATA_EEPROM_END

Signed-off-by: Francois Ramu <francois.ramu@st.com>
The specific functions for stm32L0x and stm32L1x
are defined with the DATA_EEPROM_BASE.
So that they are no more required elsewhere.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
Removing the buffered access to EEPROM
as it is not well-suited for stm32L0x and stm32L1x
which have actual EEPROM area

Signed-off-by: Francois Ramu <francois.ramu@st.com>
@fpistm fpistm merged commit e5d9368 into stm32duino:master Aug 24, 2020
@fpistm
Copy link
Member

fpistm commented Aug 24, 2020

BufferedEEPROM example updated:
stm32duino/STM32Examples@f33d7a3

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

Successfully merging this pull request may close these issues.

STM32L082 EEPROM Size
2 participants