2019-02-18 12:11 AM
2019-02-18 12:58 AM
You are saying:
> eeAddr=DATA_EEPROM_BASE; //Second write to the same location!!!
But your original eeAddr in the top is something different:
> uint32_t eeAddr= (DATA_EEPROM_BASE+ADDR_SEN_SETT);
So that is not the same location is it?
2019-02-18 01:19 AM
ADDR_SEN_SETT is 0x00
2019-02-18 01:25 AM
Try to check what does HAL_FLASHEx_DATAEEPROM_Program function return. Maybe there is an error and you are ignoring it.
2019-02-18 01:27 AM
Ok!I will check it now!
2019-02-18 01:38 AM
Only for the first byte HAL_FLASHEx_DATAEEPROM_Program returns -> HAL_ERROR?!
2019-02-18 01:39 AM
For the rest of the bytes HAL_OK is returned.
2019-02-18 01:43 AM
Well that's it, this is how debugging works. Now try to debug step-by-step into the first call of HAL_FLASHEx_DATAEEPROM_Program function to see what exactly causes it to return HAL_ERROR.
2019-02-18 02:06 AM
Seems first try to write always returns HAL_ERROR and I have to ignore this.
2019-02-19 12:50 PM
> Seems first try to write always returns HAL_ERROR and I have to ignore this.
Oh please don't just ignore the error. Find out why you get the error and fix that issue. Unless of course you have already used your debugger to step through the call to HAL_FLASHEx_DATAEEPROM_Program() that is returning the error and you proven that the error can be ignored. Then document in your code why you are ignoring the return from that function call. Your future self or some other poor soul who has to maintain that code will thank you.