Use of EMACTimestampSysTimeUpdate() to add/subtract an offset to/from the hardware timestamp registers appears to be limited in the range over which it operates without EMAC interface failure. If
1) adding, the update seen as a 64-bit number is more than 0x00000000001fffffll, or
2) subtracting, the update seen as a 64-bit number is more than 0x001fffffffffffffll,
the update operation causes the EMAC interface to lock up.
If it this information is helpful, EMACTimestampSysTimeSet() shows lock-up sensitivity for arguments greater than 0x3fffffffffffffffll.
Proper function of EMACTimestampSysTimeUpdate() is essential to this design, so I'm looking for a workaround. Specifically, I would like to know if there is some sort of interdependency between timestamp update and the EMAC hardware itself. Perhaps the EMAC needs to be momentarily frozen when the timestamp is being updated? Are there known bugs in the timestamp logic?
For the record, here is the update code:
uint64_t t = ...
EMACTimestampSysTimeUpdate(
EMAC0_BASE,
(uint32_t)(t >> 31),
(uint32_t)(t & EMAC_TIMNANO_TSSS_M),
false // t: subtract, f: add
);