ssilverman / QNEthernet

An lwIP-based Ethernet library for Teensy 4.1 and possibly some other platforms
GNU Affero General Public License v3.0
81 stars 24 forks source link

Correction for enet_ieee1855_adjust_timer #57

Open SavilleBelcher opened 10 months ago

SavilleBelcher commented 10 months ago

Thank you for all your work on this library. This branch has been essential in my project. Found an error when creating a AES67 teensy project. Also added a define for the interrupt enable for the compare timers.

ssilverman commented 10 months ago

Thanks for the information. (Side note: I've been maintaining a separate IEEE 1588 branch locally that is far ahead of this one because it's rebased on top of the latest master. It also has some other fixes.)

I'm so glad it's helping your project! :)

Some questions as I look into this flag:

  1. Is the "TIE" interrupt connected to the regular ENET interrupt flags? (ENET_EIR) i.e. if the TF flag in TCSR is set, will the main Ethernet ISR get called?
  2. This interrupt is related to input capture and output compare?
  3. How is the TIE interrupt helping your project?

One other note is that I don't consider the input capture or output compare code complete. :)

SavilleBelcher commented 10 months ago

No problem, I am somewhat new to the microcontroller world, so I am glad to help anyway I can.

  1. The TIE interrupt is connected to the IRQ_ENET_TIMER (115) for the teensy 4.1. The information in the reference manual is not very detailed on it.

  2. yes, the TIE is set with the compare flag. see 41.3.10.6 of reference manual

  3. I was trying to use the interrupt to trigger my RTP audio packet to send at exactly 1 millisecond intervals of the ptp clock. I got it to work, but I keep getting an error and rebooting randomly. I originally started by just using the output compare flag, so I just went back to that and have not had anymore problems. I didn't look to much in to the reboots yet, because using the flag was working just fine. I am also not that familiar with interrupts yet. I just though having it enabled allows the option to use it, but there may be a downside to having it enabled all the time that I am unaware of.

I would love to try your more updated version of the IEEE1855 branch if you don't mind sharing. I was thinking of trying to bring this fork up to date with the master, but this is my first time ever commenting/contributing to GitHub. I use your master for another sketch as a webserver for display sensor data and to control some LEDs, and it works great. I was using NativeEthernet but I was getting random reboots from an error in the fnet code.

ssilverman commented 9 months ago

I haven't forgotten about this. When I next have a chance, I'll have a look.