My application program is for off-grid solar inverter. Initially the application should run in calibration mode,where it scans GPIO pin status.The reference value of the inverter controller is set in calibration mode and has to be stored in flash memory. How to write to a flash location within the application program itself?