Hello,
I notice that the Save command is not working...
When I did it, the memory dump of parameters was :
00030000:55 55 55 55 ff ff ff ff ff ff ff ff ff ff ff ff UUUU............
00030010:55 55 55 55 ff ff ff ff ff ff ff ff ff ff ff ff UUUU............
00030020:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
00030030:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
00030040:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
00030050:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
00030060:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
00030070:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
00030080:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
00030090:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
000300a0:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
000300b0:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
000300c0:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
000300d0:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
000300e0:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
000300f0:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
I change the code to suppress the line
fnDelPar(SWAP_PARAMETER_BLOCK); // delete old block and validate new one.
then the dump gave me:
00030000:55 55 55 55 ff ff ff ff ff ff ff ff ff ff ff ff UUUU............
00030010:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
00030020:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
00030030:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
00030040:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
00030050:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
00030060:18 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
00030070:00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
00030080:0c ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
00030090:1d ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
000300a0:12 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
000300b0:e0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
000300c0:1f ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
000300d0:23 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff #...............
000300e0:c0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
000300f0:a8 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
It looks the valid parameter block is deleted ...
Do you have some idea where it comes from ?
extern int fnSaveNewPars(int iTemp)
{
#ifdef USE_PARAMETER_BLOCK
// Network variables
if (iTemp == SAVE_NEW_PARAMETERS_CHECK_CRITICAL) { // we check to see whether network parameters have been changed
if (((temp_pars->temp_parameters.ucServers & ACTIVE_DHCP) != (parameters->ucServers & ACTIVE_DHCP)) || (uMemcmp((unsigned char *)&temp_pars->temp_network, (unsigned char *)&network_flash, sizeof(NETWORK_PARAMETERS)))) {
return 1; // since a network parameter has been change, we warn the user that he/she will have to validate afterwards
}
}
#ifndef USE_PAR_SWAP_BLOCK
fnDelPar(INVALIDATE_PARAMETER_BLOCK); // delete parameter block before continuing
iTemp = SAVE_NEW_PARAMETERS;
#endif
fnSetPar((unsigned short)(PAR_NETWORK | TEMPORARY_PARAM_SET), (unsigned char *)&temp_pars->temp_network, sizeof(NETWORK_PARAMETERS)); // network parameters
// device parameters
fnSetPar((PAR_DEVICE | TEMPORARY_PARAM_SET), (unsigned char *)&temp_pars->temp_parameters, sizeof(PARS)); // copy the new set to the swap buffer (temp)
if (iTemp != SAVE_NEW_PARAMETERS_VALIDATE) {
#ifdef ACTIVE_FILE_SYSTEM
// fnDelPar(SWAP_PARAMETER_BLOCK); // delete old block and validate new one.
#endif
// uMemcpy(&network, &temp_pars->temp_network, sizeof(NETWORK_PARAMETERS)); // update working parameter set - we never do this since we always reset after a network change (otherise we can have DHCP difficulties, since DHCP values will be overwritten)
uMemcpy(parameters, &temp_pars->temp_parameters, sizeof(PARS));
}
#endif
return 0;
}