2025-11-28 11:06 AM
Hello
Yes here we go again… I’m again busy with the implementation of PTP slave inside STM32H7, based on this GitHub: https://github.com/hasseb/stm32h7_ptpd
I tried to port this to my own project based on STM32H7, I changed what was mentioned in the readme. And look inside the helper files to modify the necessary HAL stuff. After all this, everything is compiling, but it doesn't work…
My setup: PTP master is Magwell Pro Convert AES67 and act as master, this master is sending all the necessary packets on the ethernet. Checked with Wireshark. When I run the PTPD in slave mode I get this output:
(V) handle: something
(d 1162345242.829138544) handle: ptpd_net_recv_event returned 0
(d 1162345242.834921492) handle: ptpd_net_recv_general returned 44
(d 1162345242.840950789) handle: unpacked message type 8
(d 1162345242.846096992) handle_followup: received in state PTP_UNCALIBRATED
(d 1162345242.853011945) ptpd_servo_update_offset
(V) ptpd_servo_update_offset: ingress_timestamp 875418629 seconds 236549870 nanoseconds
(V) ptpd_servo_update_offset: origin_timestamp 9987 seconds 407996107 nanoseconds
(V) ptpd_servo_update_offset: correction_field 0 seconds 0 nanoseconds
(V) ptpd_servo_update_offset: offset 875408641 seconds 828553763 nanoseconds
(V) ptpd_servo_update_offset: mean_path_delay 0 seconds 0 nanoseconds
(V) ptpd_servo_update_offset: offset 875408641 seconds 828553763 nanoseconds
(V) handle: something
(d 286936601.209663304) handle: ptpd_net_recv_event returned 0
(d 286936601.215356588) handle: ptpd_net_recv_general returned 44
(d 286936601.221297561) handle: unpacked message type 8
(d 286936601.226354700) handle_followup: received in state PTP_UNCALIBRATED
(d 286936601.233182872) ptpd_servo_update_offset
(V) ptpd_servo_update_offset: ingress_timestamp 827075319 seconds 640014051 nanoseconds
(V) ptpd_servo_update_offset: origin_timestamp 9987 seconds 659131531 nanoseconds
(V) ptpd_servo_update_offset: correction_field 0 seconds 0 nanoseconds
(V) ptpd_servo_update_offset: offset 827065331 seconds 980882520 nanoseconds
(V) ptpd_servo_update_offset: mean_path_delay 0 seconds 0 nanoseconds
(V) ptpd_servo_update_offset: offset 827065331 seconds 980882520 nanosecondsThe received timestamp origin in the terminal output is the correct timestamp coming from the master. The calculated timestamp, offset, looks also correct for me. But the slave goose never in Slave mode, always in PTP_UNCALIBRATED, the next execution the value of the offset is totally different… So, something goose wrong.
From the device in “slave mode” no packets are sending. The ptpd_net_send or other functions are never called.
But, when I disconnect the PTP master (Magwell), reboot de STM, the STM act as a PTP Master and sends messages to the network… These messages looks correct when I debug with Wireshark.
Have anyone any idea what I can try to make this work?