espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
12.97k stars 7.11k forks source link

IEEE 1588 (PTP) Support (IDFGH-110) #1223

Open ajvpot opened 6 years ago

ajvpot commented 6 years ago

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

FayeY commented 6 years ago

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.

ProfFan commented 6 years ago

Hi,

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

ghost commented 6 years ago

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

ashish-kamble commented 6 years ago

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

rollet commented 5 years ago

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

Grtschnk commented 5 years ago

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.

rikkertkoppes commented 5 years ago

Very interested also

Any pointers to an implementation would be greatly appreciated

ajvpot commented 5 years ago

@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

peterjeremy commented 4 years ago

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.

brianbienvenu commented 4 years ago

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

tionebrr commented 4 years ago

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

chuledeco commented 4 years ago

I'm interested on this too!!!

chuledeco commented 4 years ago

Does anyone found the way to implement PTP on ESP32?

callumbrieske commented 3 years ago

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?

tionebrr commented 3 years ago

@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.

doragasu commented 3 years ago

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

tionebrr commented 3 years ago

I didn't get any further on that.

TooDissing commented 2 years ago

Any updates on this? No real update since 2017...

ankurrajw commented 2 years ago

I am also interested for this feature and hope it would be added to the ESP-IDF in the later releases.

ElliottSeer commented 1 year ago

ESP32-C6 有希望实现这个功能吗

rollet commented 1 year ago

ESP32-C6 有希望实现这个功能吗

No Ethernet interface on ESP32-C6 from my knowledge...

callumbrieske commented 1 year ago

Hopefully the ESP32-P4 will have working 1588.

jack0c commented 1 year ago

ESP32-P4 will support PTP.

doragasu commented 1 year ago

That's great news, thanks for commenting!

EDIT: oh, but P4 does not have radio :(