How do people ensure a device has a 'reasonable' configuration, both initially and at each start-up ? The obvious answer is to program the chip's EEPROM, but this is the Arduino forum so that's not possible (not supported by the serial bootloader or the IDE). In most cases, the users are assembling my design themselves, so I can't ship a known-good product.
I can detect a virgin EEPROM (all 0xFF), but I can't guarantee the MCU hasn't previously been used for something else, which would mean the values are effectively random.
I can look for a value in a specific EEPROM location and reset to reasonable defaults if it's not present, but that's a possibly dangerous assumption. I can reduce, but not eliminate, the risk by having multiple canaries.
I could store a checksum each time a known-good config is established and check that at start-up. The chances of a random checksum value matching a random config are minimal.
If I detect a doubtful config at start-up I can flash an LED or two, prompting the user to connect the device to their PC and read the serial debug output.
I can provide a means to explicitly set/reset to a default config, usually by grounding a pin very early in the startup. Again, a bit dangerous without some way of asking "do you really mean that?". I try to do this by flashing an LED and requiring the pin to be un-grounded and re-grounded for a further 5 secs. If that doesn't happen, I bail out after 20 secs.
I can document these behaviours and 'require' the user to perform this step when they first bring the device up.
This applies to devices with a minimal human interface. If I have some PC-based control program or an onboard webserver (e.g. ESP), life is a lot easier.
Nothing here is safety-critical but a lot of my users are easily confused ;)