2013-02-20 07:40 AM
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 #stm32f4172014-09-15 09:16 PM
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! :)