In the config files I have modified some settings, like the root password in “appconfig.h”. When flashing a new device, the old settings from NVRAM are still used. This seems normal, but how can I instruct it once via a function call to revert to the default settings? Note: the modules serial port is connected to a controller, so I do NOT have a serial console interface at boot time.
If you do not have access to the dialog (through the serial console) your only other option would be to use customizeReadDevBoardParams and customizeWriteDevBoardParams (described in the API reference guide). These APIs allow you to read the current contents form NVRAM (read) and then update the structure and write updated values back out to NVRAM. Further, in the System Software Services->Application Configuration section there are a bunch of calls for accessing values from appconf.h values that are built into your application.
Thus you should be able to access the fields you want, read NVRAM using customizeReadDevBoardParams. Update the filled in structure returned by customizeReadDevBoardParams. Fill in the fields you read from appconf.h and then write back out to NVRAM using customizeWriteDevBoardParams
you should additionally set some flag which when set you will check it to avoid that you rewrite NVRAM on each boot, but only on the first boot of your firmware.