Esp-idf: IEEE 1588 (PTP) Support (IDFGH-110)

Created on 3 Nov 2017  路  17Comments  路  Source: espressif/esp-idf

Hi,

The datasheet lists the ESP32 as having hardware IEEE 1588 support, but the only reference I can find in the SDK to it is a "TODO" line. Is support for this feature implemented yet?

https://github.com/espressif/esp-idf/blob/master/components/ethernet/emac_main.c#L771

Thanks,
Alex

Most helpful comment

Hi, sorry that there is no update, it is still in our TODO list now. But we will let you know when there is any update.

All 17 comments

Hi, sorry that there is no update, it is still in our TODO list now. But we will let you know when there is any update.

Hi,

We need this feature as well. Can you alternatively provide instructions and references so we can implement this ourselves?

Would there be a particular PHY required for this? What else is hidden away in the integrated MAC? We could do with IEEE 802.1AS for AVB quality synchronization which is better than the default 1588v2 profile.

Spotted in https://github.com/espressif/esp-idf/blob/master/components/ethernet/emac_desc.h

define EMAC_DESC_PTP_VERSION (BIT(13))

define EMAC_DESC_PTP_VERSION_S 13

define EMAC_DESC_PTP_FRAME_TYPE (BIT(12))

define EMAC_DESC_PTP_FRAME_TYPE_S 12

Hi,
Is the support for hardware ptp feature ready yet ?
Could not find any documentation or software support in official docs released till now.

Is there any news about PTP status in ESP32 IDF/manuals ? It looks like frame timestamping is available , but there is no indication about clock control, PTP clock triggered interrupt, etc...
Thanks

I am also very interested in this. :)

I wonder if it would be even possible to combine this with the ESP Mesh functionality (only very briefly looked into it), and as a result, have a swarm of almost-perfectly synced ESP32s.

Very interested also

Any pointers to an implementation would be greatly appreciated

@Grtschnk Unfortunately, I don't think that would work. IEE1588 is an Ethernet feature. You'd need to be using a wired connection with a MAC.

You may have some luck with https://gitlab.com/painlessMesh/painlessMesh

The ESP32 TRM shows that the Ethernet MAC supports IEEE1588-2008. IEEE802.1AS includes support for PTP over WiFi but AFAIK, the ESP32 doesn't support that.

Any updates on this? Functional 1588v2 PTP support (ie, more than datasheet support) on the ESP32 would enable some interesting applications.

Bump !
It would be great to get support for the IEEE1588 hardware or some documentation at least !

I'm interested on this too!!!

Does anyone found the way to implement PTP on ESP32?

Is there any further news on this?
The documentation for these features seems to be missing some information.

Where is the 'timestamp' DMA'd from? IE What is the source timer?
How do you enable the "Advanced Timestamping" features? I cant get the timestamps for either TX of RX frames, and the tech ref manual is very vague on the specifics of enabling these features.

Do these features actually exist as advertised, or have they never actually worked?

@callumbrieske I didn't tried to go further on this.
I think the 1588 timestamping may be a bit hard to make on an MCU and is not interesting for enough people. So the manufacturers just drop it. STMicro also had advertized PTP support for their Cortex MCUs, but have now removed the documentation for it. It seems like NXP are still supporting 1588 with code examples.
I think I'll just use an ethernet PHY with 1588 support (from Microchip). It might be more reliable on the long run as I can write my lib for that phy (or switch) and port it on any target.

Any news? Even if difficult, if doable, I am also interested. Maybe if we could have documentation about registers, we could implement it ourselves.

I didn't get any further on that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

feelfreelinux picture feelfreelinux  路  4Comments

LosDeiblos picture LosDeiblos  路  4Comments

ESP32DE picture ESP32DE  路  4Comments

kylefelipe picture kylefelipe  路  3Comments

lucascoxBAF picture lucascoxBAF  路  3Comments