2015-06-11 08:11 AM
Hi there,
I want to initialise the on chip EEPROM so I can save a number of bytes which will be Factory reset values. I don't want to use the Emulated EEPROM and I cant find any document regarding to that. I used PIC microcontrollers before and in MPLAB there is a macro which can initialise the EEPROM with the reset values and these values may be updated later when the code is running. So how I can program the EEPROM when I program the device?2015-06-11 09:30 AM
So how I can program the EEPROM when I program the device?
Get the bytes you need into the .HEX you're delivering, and pick the ''FLASH'' algorithms for all the memory regions they are using, be it FLASH, EEPROM, external memory, whatever.How would you get it to your .HEX file? By understanding the tools you're using. Defining memory regions in your linker scripts or scatter files. Directing content there with compiler directives, #pragma, etc. Most embedded tools have extensive documentation of how these things can be done, and there's the internet.You could merge the data into a .HEX file with a text editor. If your initial data is device specific (serial number, calibration, etc), you can make a tool to auto-generate it, or add it to your programmer code.You could put code in your app that writes a default set of values into the EEPROM when it recognizes the initial start up, or erased values.2015-06-11 09:41 AM
Hello g_Rebwar,
In my case, I read this document ( Programming manual ). This document explain the way for STM32L1. I believe it is the same thing to STM32L0, but of course that the range of address is diferente.There is a lot of sample codes what could help you too into STM32L0xx HAL Driver.2015-06-15 01:17 AM
2015-06-15 01:20 AM
Thanks Witte,
I read through the document, there are some good explanations and code examples. However, I haven't been able to find the ones I need. Thanks again.2015-07-06 03:42 AM
Hello Clive,
Could you give me some more advice with regard to the method you have mentioned. Are there any other ways to put the data I want to download into the EEPROM in a .hex file? I need this for production purposes so it should be in a single hex file.