cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with PPS Output on GPIO pin for STM32MP257F-DK

Leen
Associate

Hello,

I'm working on PTP synchronization using the STM32MP257F-DK development board, and I'm encountering an issue with generating a PPS output on a GPIO pin. I'm using Buildroot as the build system, configured with the Bootlin external tree available from : https://github.com/bootlin/buildroot-external-st/tree/st/2024.02.9?tab=readme-ov-file

 

I want the STM32MP257 board to operate as a PTP slave to an external grandmaster clock. To verify synchronization accuracy, I'm trying to observe the PPS output on the PF4 pin, which corresponds to ETH1_PPS_OUT according to the datasheet, using an oscilloscope.

 

Here are the steps I followed:

  1. Buildroot configuration:  I enabled linuxptp package, I also enabled PTP clock support --> KVM virtual PTP clock in the Device Drivers
  2. PTP configuration: I modified the /etc/linuxptp.cfg as follows:

    [global]
    verbose                      0
    clientOnly                   1
    delay_mechanism      E2E
    network_transport      L2
    time_stamping           hardware
    clock_type                 OC
    domainNumber         24
    step_threshold          1.0

    [eth0]

  3. Device Tree configuration: following the ST Wiki guide, I added the following pinmux setting for the PF4 in eth1_rgmii_pins_a :

         STM32_PINMUX('F', 4, AF11) /* ETH1_PPS_OUT */ .

 

         I also verified that ptp_ref clock is correctly defined.

https://wiki.st.com/stm32mpu/index.php?section=6&title=Ethernet_device_tree_configuration&utm_#How_to_configure_PTP_PPS_out_--

 

After building and running the system, I executed the following commands on the board's linux environment and got a working ptp synchronization:

ptp4l -i eth0 -f /etc/linuxptp.cfg
phc2sys -s eth0 -c CLOCK_REALTIME -O 0

 

However, when I run 'echo "0 0 0 1 0" > /sys/class/ptp/ptp0/period' , I do not get any visible PPS pulse on PF4 on the oscilloscope.

 

I repeated the exact same steps on an STM32MP157C-DK2 board, using a different pin (PG8), and the PPS output worked correctly, I was able to visualize a PPS signal.

 

Could the issue be software-related, maybe due to incomplete kernel support or misconfiguration in the STM32MP257 board? I’d be grateful to know if this is a known concern.

 

Thanks in advance,

Leen

 

1 REPLY 1
GatienC
ST Employee

Hello Leen,

I happened to reproduce the exact same use case some time ago. It appears that, despite no difference in the documentation, the conditions of the generation of flexible PPS output differs from stm32mp1x to stm32mp2x.

 

On stm32mp1x, it appears that no start time is necessary in the target time registers (ETH_MACPPSTTxxxx) to generate the signal. That's not the case on stm32mp2x. I've tested writing by hand a start time that corresponds to what's present in ETH_MACSTSR to ETH_MACPPSTTSxR + xxx seconds, then configured ETH_MACPPSCR to start the generation of a flexible PPS and noticed that the PPS signal is indeed generated at the time that I configured.

To test that you can generate a PPS signal, I suggest to use fixed PPS. You should see a signal by simply writing 0xf to ETH_MACPPSCR.

This issue is under investigation on our side.

I haven't tested trying to set a time using "echo "x x x x x" > /sys/class/ptp/ptp0/period" and tweaking the parameters to generate a flexible PPS but that may be feasible.

Best regards,

Gatien