How to store config file on microcontroller?
You treat the “config file” as a small block of non-volatile data and give it a safe place + a simple protocol, rather than literally thinking “files on a PC”. Here’s a practical way to do it. 1. Decide where to store the config Depending on your MCU and how big the config is: Internal EEPROM (AVR, some STM8 , some STM32 , PIC , etc.) Easiest: byte-wise writes, survives reset and power off. Great for a few bytes to a few kB (baud rate, calibration constants, flags…). Internal Flash (most Cortex-M, ESP32, etc.) Use one or more flash pages/sectors reserved for config. You must erase a whole page before rewriting; limited erase cycles (often 10k–100k). Common for MCUs without EEPROM (STM32, nRF, etc.). External non-volatile memory I²C/SPI EEPROM/FRAM/Flash if you need more space or don’t want to wear out internal flash. FRAM is great when you want many writes (wear basically not a problem). SD card / filesystem Overkill for tiny conf...