Vojtech, thanks for replying.
I do not believe the help explains this.
Reading hte PE-generated code for SetByte I see word alignment checks.
suggesting that the code does as I claim it does, in other words,
it writes bytes to word aligned adresses.
My original questions therefore remain unanswered.
Could it be my code together with the PrExp_EEPROM_TAdress type definition?
Please see my attached code below.
The code seems to loose its formatting when include here so
I am attaching it as well, hoping to preserve the indentaions.
When disassembled it seems my ID parameter is doubled before adding
to PrExp_EEPROM_AREA_START.
BR,
Anders J
/*** ===================================================================** Store a byte in volatile storage defined by passed Id** If byte is already stored do not overwrite** Parameters : Non volatile storage parameter Id: nvsidXyz** Byte to store** Returns : nothing** ===================================================================*/void App_Driver_NonVolatileStorage_Put_uChar(unsigned char Id, unsigned char B){ PrExp_EEPROM_TAddress Location_Main, Location_Mirr; <<<------------- POSSIBLE PROBLEM typdef ??? unsigned char WrResult; if (Id <= nvsidEndOfStorage_uChar) // Cannot test on start, compiler complains COND always TRUE { if (App_Driver_NonVolatileStorage_Get_uChar(Id) != B) { Location_Main = PrExp_EEPROM_AREA_START + Id; / <<<------------- POSSIBLE PROBLEM CODE ??? Location_Mirr = Location_Main + nvsMirrorLocation; WrResult = PrExp_EEPROM_SetByte(Location_Main, B); // Main storage if (WrResult != ERR_OK) { App_Driver_Uart_TransmitStr("NVRAM write error-Main 08", TRUE); } WrResult = PrExp_EEPROM_SetByte(Location_Mirr, (B ^ 0xFF)); // Mirrored storage if (WrResult != ERR_OK) { App_Driver_Uart_TransmitStr("NVRAM write error-Mirror 08", TRUE); } } }}