Skip to main content
Kamil Alkhouri
Associate II
April 13, 2018
Question

1588 PTP on STM32F746ZG

  • April 13, 2018
  • 1 reply
  • 2562 views
Posted on April 13, 2018 at 11:06

hey,

I have a LWIP client/server application and I want to add the PTP synchronization feature to the communication. I'm using STM32F746ZGTx Nucleo and CubeMX. I'm trying to enable RMII_PTP_Synchro mode for ETH (after enabling TIM2) but cubeMX is displaying the following message:

'Warning: STM32CubeMX does not support the configuration of this IP's mode. You can configure it only manually'.

I can't start this configuration from scratches so is there any precoded sources I can relay on to activate and configure this feature?

Thanks.

#ptp #stm32f7 #cubemx #ieee1588
This topic has been closed for replies.

1 reply

Joerg Wagner
Senior III
April 14, 2018
Posted on April 14, 2018 at 23:52

Okay, guess it would work - what are your next steps?

Did you already wrote code lines to implement/use this feature

and if not, did you deal with this subject?

Kamil Alkhouri
Associate II
April 17, 2018
Posted on April 17, 2018 at 10:57

according to the user manual RM0385, there are some programming steps for system time generation initialization and they are basically setting some register values:

1. Mask the Time stamp trigger interrupt by setting bit 9 in the MACIMR register.

2. Program Time stamp register bit 0 to enable time stamping.

3. Program the Subsecond increment register based on the PTP clock frequency.

4. If you are using the Fine correction method, program the Time stamp addend register

and set Time stamp control register bit 5 (addend register update).

5. Poll the Time stamp control register until bit 5 is cleared.

6. To select the Fine correction method (if required), program Time stamp control register

bit 1.

7. Program the Time stamp high update and Time stamp low update registers with the

appropriate time value.

8. Set Time stamp control register bit 2 (Time stamp init).

9. The Time stamp counter starts operation as soon as it is initialized with the value

written in the Time stamp update register.

10. Enable the MAC receiver and transmitter for proper time stamping.

I followed these steps and the register values are correctly set. But I'm still struggling to find a code to use this feature! any advice? is there a well-known library that solves my problem?

Joerg Wagner
Senior III
April 17, 2018
Posted on April 17, 2018 at 13:52

I don't know an existing library.

The point is: You have to modify and extend LwIP.

For example: The descriptors need twice more space.

Is it neccessary for your application to have such a fine precision

in comparison to NTP ?