cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L0 EEPROM programming with keil

Ivanova Anastasiia
Associate II
Posted on July 04, 2017 at 07:57

Hello, everybody.

Hello everybody. I use Keil and ST-Link for programming STM322L073 Flash and EEPROM. I try to program them simultaneously but only Flash is written.

Is there any way of writing Flash and Internal EEPROM simultaneously?

BR, Anastasiia

6 REPLIES 6
Imen.D
ST Employee
Posted on July 04, 2017 at 15:13

Hi

Anastasia.Ivanova

,

You can have a look to the

FLASH

example available under

/external-link.jspa?url=http%3A%2F%2Fwww.st.com%2Fcontent%2Fst_com%2Fen%2Fproducts%2Fembedded-software%2Fmcus-embedded-software%2Fstm32-embedded-software%2Fstm32cube-embedded-software%2Fstm32cubel0.html

, g

et inspired from the example and modify it

to achieve your goal

:

STM32Cube_FW_L0_V1.9.0\Projects\STM32L073Z_EVAL\Examples\FLASH

Also, y

ou can found a full set of

EEPROM

examples within STM32CubeL4,which can help you as an implementation example to build your application on L0.

I recommend you to have a look to the “Flash program memory and data EEPROM (FLASH)�? section in your related STM32L0 product reference manual

/external-link.jspa?url=http%3A%2F%2Fwww.st.com%2Fcontent%2Fccc%2Fresource%2Ftechnical%2Fdocument%2Freference_manual%2F21%2Fbd%2F0f%2Fbd%2F1c%2F88%2F40%2Ff0%2FDM00108pdf%2Ffiles%2FDM00108pdf%2Fjcr%3Acontent%2Ftranslations%2Fen.DM00108pdf

.

Hope this helps you.

Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Zt Liu
Senior III
Posted on July 05, 2017 at 13:36

hi, 

?????????.

In my STM32L053 device, I also got 2K eeprom @0808 0000 - 0808 07FF.

If I create a const array with absolute address, such as:

const uint8_t eepromArray[16] __attribute__((at(0x08080000)))

= {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F};

If I use Keil to flash, it will skip this area, for there is no programming algorithm at this section.

(for the moment, i don't know how to add or modify programming algorithm for keil).

But if I use the output hex file and ST-Link to program,

the eeprom is indeed programed

Even though the ST-Link Utility only shows the the read out data in flash region, but it's indeed programmed.

In ST-Link, you may manually modify the memory display range like this

0690X00000607RYQAY.png

you can also confirmed this by using software code or by STMFlashLoader Demo.

I prefer use software codes to erase/write/read the eeprom data,

it seems that the above way for initializing the eeprom area does no harm too.

Hope this helps you.

Zt.

Posted on July 05, 2017 at 13:43

Hello, dear Zhital Liu!

Thank's a lot for your advise. I also hope it helps me!

Best regards, Anastasiia

Posted on July 06, 2017 at 13:32

Also too programming the EEPROM from Keil IDE, in the options for targer->Debug->Settings->Flash Download

Add and select the EEPROM option.

0690X00000607PNQAY.png
Posted on July 06, 2017 at 14:09

Great! That's what I missed! Thx,

Cordoba_Papamija.Jho

!

Posted on July 07, 2017 at 06:49

Hello, dear Jhon!

Thak's a lot. I think it will work for me!!!