Hi all. I have an attached port that I read the alias address from for my slave, then I want to update the EEPROM and save it. For various reasons, we want to know if the alias address has changed since we last booted up the slave.
I'm not sure of the exact sequence to use to update the alias address and have it take effect and be saved. In my old code from another microprocessor, which did NOT use emulation, I did the following, in APPL_StartMailboxHandler which is called on the init->preop transition:
1) Read the EEPROM and determine the alias address
2) If it is different, write the new one, and them write the CRC
UINT16 rtn = ESC_EepromAccess(0x4,1,&SiiIDValue,ESC_RD);
if ((SiiIDValue != Limits.Unique_id)){
rtn = ESC_EepromAccess(0x4,1,&Limits.Unique_id,ESC_WR);
usleep(5000);
rtn = ESC_EepromWriteCRC();
}
I'm not sure how this translates into the version of code using emulation.
Do I simply write the alias address into the emulated eeprom, then update the status to write it out to the flash?
Do I reload the ESC registers, or just write that one register?
Thanks for any guidance you can give.
John