2021-03-05 02:33 AM
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?
Solved! Go to Solution.
2021-03-09 08:04 AM
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
2021-03-05 07:52 AM
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
2021-03-08 11:25 PM
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?
2021-03-09 08:04 AM
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