Hi Mark
I'm customizing the stored configuration parameters to my application's needs.
I extended the PARS structure/typedef with the necessary members, and also the webInterface logic to cope with them. All works fine, except when I do some changes and try to save the new parameter values, using the simulator.
The exception occurs at line 2395 of M5223X.c. The code there is as follows
#ifdef _WINDOWS
if (ulValue & ~(*(unsigned long*)ptrAdd)) { // we check that we are not trying to program a bit from '0' to '1'
*(unsigned char*)0 = 0; // this will fail so signal it when debugging
}
#endif
It's clear to me that the exception is intentional, because the application is trying to do an illegal operation. But the current demo code does not try to erase the flash prior to write the new conf, and I cannot find a suitable function to do that.
But the most intriguing thing is that I was playing some times with the conf before the customization attempt, without trouble.
Note: when I save the conf for the first time, all is OK, and checking the "flash file", it's as expected. The thing goes wrong when I try to save some new values, i.e, I'm trying to overwrite the flash.
TIA
Regards
Marcelo