cancel
Showing results for 
Search instead for 
Did you mean: 

EEPROM in STM32CUbe IDE

MBhir.11
Associate III

Hi,

I had requirement of storing some application data in to EEPROM of MCU.

I am using STM32L151RCT6 MCU for my application.

Please suggest me any tried examples on this?

1 ACCEPTED SOLUTION

Accepted Solutions

STM32CubeIDE and STM32CubeMX only overwrite their own code, not the one you inserted, when you regenerate the project - and have followed the conventions. If your own code is concerned, you have apparently inserted it outside of the USER CODE blocks.

You could refer to this hand-on, step 6, if you are interested how user code should be inserted. Alternatively, you can find this information in UM1718, appendix B.1

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

3 REPLIES 3
Mike_ST
ST Employee

You can check the examples within the STM32L1 package available here:

https://www.st.com/en/embedded-software/stm32cubel1.html

And have a look at this example : Projects\STM32L152D-EVAL\Examples\FLASH\FLASH_EraseProgram

Hi ,

Thanks for your reply.

I have one doubt about STM32cube IDE tool.

first time i created the LED toggling code and in main i added the HAL function to toggle that GPIO.

After that i changed the debug mode from JTAG 5 pin configuration to serial wire configuration and generated the project once again.

After generating, the main file will overwrite because it has system configuration , clock and peripheral configuration.

I need user defined program in the main file should not erase/over write .

How to manage that ?? i have huge algorithm in main and it should not overwrite every time.

Please suggest me any settings are needed in the tool?

STM32CubeIDE and STM32CubeMX only overwrite their own code, not the one you inserted, when you regenerate the project - and have followed the conventions. If your own code is concerned, you have apparently inserted it outside of the USER CODE blocks.

You could refer to this hand-on, step 6, if you are interested how user code should be inserted. Alternatively, you can find this information in UM1718, appendix B.1

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.