cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F417. PTP protocol support. Programming error or defect of microcontroller?

korrav
Associate II
Posted on February 20, 2013 at 16:40

I'm trying to implement support for PTP protocol based on microcontroller STM32F417. I had a problem.System timer PTP, an interrupt if the current time exceeds the value recorded in the registers Target time.This sets a flag in the register TSTS ETH_MACSR. This flag is cleared when the register is read ETH_MACSR. So says the Reference manual.However, in debug mode I saw that after reading TSTS flag register is not reset and the program gets stuck in an interrupt handler. So I put in interrupt handler loop, which again and again reads the contents of the register until ETH_MACSR TSTS flag is cleared.This works only in debug mode.When I run the program without the  programmer, it gets stuck in this loop forever.That is the flag TSTS not reset. Thank you!

#stm32 #ptp #ptp-stm32f407-eth_macsr-tsts #ptp #stm32f417
10 REPLIES 10
james23
Associate
Posted on September 16, 2014 at 06:16

Just to help out anyone else that has this issue, I have found the solution.

The interrupt bit is not cleared by reading the MACISR, it is cleared by reading the ETH_PTPTSSR as per the reference manual RM0033 page 903.

So into your ISR add the line:

ETH_GetPTPRegister(ETH_PTPTSSR);

And you won't have any issues getting stuck in loops! :)