2019-01-17 3:15 AM
Hi, I have being trying for weeks now to get PTP timestamps with no much luck.
Q1. Is there any example code available? The user manual (en.DM00314099.pdf) is rather confusing.
For example in 57.9.7 Programming guidelines for IEEE 1588 timestamping it states "1. Mask the Timestamp Trigger interrupt by clearing bit 16 of Interrupt enable register (ETH_MACIER)."
but on the description of ETH_MACIER the bit 16 is reserved. It shows bit 12 instead (TSIE). Which is the correct one?
So what i tried so far is before I call HAL_ETH_Start(&heth) I configure the registers ETH_MACIER and ETH_MACTSCR following 57.9.7 instructions.
Then when I receive a packet I check both heth.Instance->MACISR and dmarxdesc->DESC1, dmarxdesc->DESC0 (in case is working with interrupts) and also mactscr, mactssr, macatssr, macatsnr in case is working with the FIFO and I only get 0 values in mactscr, mactssr, macatssr, macatsnr or not sensible values in DESC1/0.
Please advice as this is taking too long!
Thanks