EEPROM on STM32L0X family

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: RoccoMarco, barthess

steved
Posts: 318
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 1 time
Been thanked: 9 times

EEPROM on STM32L0X family

Postby steved » Mon Mar 20, 2017 11:24 pm

I've had a look to see if there's already support for the on-chip EEPROM in the 32L0x series, without success - is it a 'TODO'?

It looks as if the read side can be handled by adding the EEPROM area into the scatter file (On the 32L0x series, at least, always starts at 0x0808000).

At the lowest level the write side is pretty much the examples in the manual.

At the next level have a layer to manage block reads and writes, compatible with the drivers for external EEPROM.

If there's nothing already in place, I might have a go at this.

User avatar
Giovanni
Site Admin
Posts: 9603
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 127 times
Been thanked: 120 times
Contact:

Re: EEPROM on STM32L0X family

Postby Giovanni » Tue Mar 21, 2017 1:41 pm

Potentially everything is a TODO. Updating scatter files would be nice.

Giovanni

steved
Posts: 318
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 1 time
Been thanked: 9 times

Re: EEPROM on STM32L0X family

Postby steved » Mon Apr 03, 2017 1:44 pm

This proved to be a bit more involved than I expected, especially since I only wanted one bit of non-volatile storage at the time! Still, my requirements have escalated to 10 time that since.

The attached project includes an EEPROM-writing library, test harness and updated scatter file for the 32L031, to run on a Nucleo32-STM32L031K6T6.

ATM I've allocated flash7 to EEPROM; maybe it should have a different name. The scatter file needs checking, since I've never done one before (and, like makefiles, it gave me a headache).

I suggest that Chibios core HAL includes just the basic EEPROM-writing primitives (byte, word, long word) and the related helper functions. They should provide a good basis for a generic interface.

I've included a generic block write routine which will be over-complex for some applications (it handles all combinations of variable alignment), but can be stripped down to suit individual applications.
Attachments
32L031K6_NUCLEO32_EEPROM.zip
(22.79 KiB) Downloaded 11 times


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 2 guests