cancel
Showing results for 
Search instead for 
Did you mean: 

How to store configuration values on a STM32L432

diego peinado martin
Associate II

Hello. I would like to store specific configuration values on several STM32L432. They are related to network configuration parameters (network ID, element ID, number of elements in the network, etc.) and It should be changed sometimes. They are elements powered by batteries in which the power consumption is critical.

One possibility is to activate USB (using higher clock velocity) for example 30 seconds after reset, and if there is USB connection, then receive the configuration parameters, and then write them into the FLASH memory using EEPROM emulation. Then suspend the USB and slow down clock velocity to 8MHz. I've read that it is very difficult on the STM32L432 to stop completely the USB from draining a lot of current (something related to pull up and pull down resistors of DP and DM (USB data lines)). The low power requirements prevents to use this system.

I've thought to use ST-Link utility, so I can write configuration values to specific memory positions, without erasing the firmware. Is it possible? Someone has ever done something similar? Do you know better alternatives?

Thanks in advance, best regards,

Diego.

2 REPLIES 2
S.Ma
Principal

The way to store the per device unique data depends case by case, and the quantity of produced devices (is it worth spendind time to automate the custom data witg a custom tool or do it manual, etc...)

one way is to define a specific flash zone in linker config file and after programming the user code in flash, program without erase a second bin file in that segment with custom data. In a way, it is the same problem as programming external qspi flah with something.... Which is another fresh thread on this forum...

diego peinado martin
Associate II

Thank you very much for your help. It seems the best solution. I have only one more question. Why to define the flash zone in the linker config file? Is it necessary for referencing the memory from the main code? Thanks in advance, best regards.