cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H723 - Enabling IEEE 1588 PTP Offload does not transmit packets?

imran_khan
Associate

Hi!

I'm using an STM32H723ZG with the STM32 HAL. Ethernet is enabled (and LWIP is correctly configured and working fine). 

I'm trying to get the STM32's MAC to automatically reply to PTP SYNC messages using the PTP Offload feature. 

I've configured the MAC using the HAL_ETH_PTP_SetConfig function and then manually set the MAC's MACPOCR POEN bit, however no packets are produced. 

I'm trying to configure the STM32 to be an Ordinary Slave Clock so that it responds to SYNC messages. 

SYNC messages are correctly being sent on the network by my Master Clock (a linux workstation) however they are not causing the ethernet MAC on the STM to respond. 

I have several questions. 

What should I program the MACSPI0R, MACSPI1R and MACSP2R registers to? Should it be programmed to the Clock ID of my Master clock? Should it be a unique ID for the slave clock? 
PTP is configured with the following structure:
(The eth_hclk is at 260 Mhz)


ETH_PTP_ConfigTypeDef ptp_config{
.Timestamp = 0, /*!< Enable Timestamp */
.TimestampUpdateMode = 1, /*!< Fine or Coarse Timestamp Update */
.TimestampInitialize = 0, /*!< Initialize Timestamp */ // Does nothing
.TimestampUpdate = 1, /*!< Timestamp Update */
.TimestampAddendUpdate = 1, /*!< Timestamp Addend Update */
.TimestampAll = 1, /*!< Enable Timestamp for All Packets */
.TimestampRolloverMode = 1, /*!< Timestamp Digital or Binary Rollover Control */
.TimestampV2 = 1, /*!< Enable PTP Packet Processing for Version 2 Format */
.TimestampEthernet = 1, /*!< Enable Processing of PTP over Ethernet Packets */
.TimestampIPv6 = 0, /*!< Enable Processing of PTP Packets Sent over IPv6-UDP*/
.TimestampIPv4 = 0, /*!< Enable Processing of PTP Packets Sent over IPv4-UDP*/
.TimestampEvent = 1, /*!< Enable Timestamp Snapshot for Event Messages */
.TimestampMaster = 0, /*!< Enable Timestamp Snapshot for Event Messages */
.TimestampSnapshots = 0, /*!< Select PTP packets for Taking Snapshots*/
.TimestampFilter = 0, /*!< Enable MAC Address for PTP Packet Filtering */
.TimestampChecksumCorrection = 0,
/*!< Enable checksum correction during OST for PTP over UDP/IPv4 packets - not supported on this part???? */
.TimestampStatusMode = 0, /*!< Transmit Timestamp Status Mode */
.TimestampAddend = 886862695, /*!< Timestamp addend value */
.TimestampSubsecondInc = 40,
};

assert(HAL_OK == HAL_ETH_PTP_SetConfig(&eth_handle_, &ptp_config));
SET_BIT(eth_handle_.Instance->MACPOCR, ETH_MACPOCR_PTOEN);

 

 

 

0 REPLIES 0