Ethernet on Teensy 4.1 with Rust

coral

New member
Hello! New on this forum so let me know if this is the wrong place to ask this question.

I've worked on a project with Teensy 4.1 for a while and wrote it in Rust mostly using the HAL provided by teensy4-rs. It's going great so far but have finally come to the part of incorporating Ethernet. There is no rust library yet for wrapping the Teensy ethernet chip to Rust ip constructs which makes sense so wanted to see what people think is the best way forward and help me clear up some misunderstandings.

1) What is the actual ethernet chip on the Teensy 4.1? The website says DP83825I but reading NativeEthernet's source code I only see references to W5100/W5500 etc. Is W5500 the actual chip and DP83825I is just a A/D chip for Ethernet? I don't understand this too well so sorry for the question.

2) Does people think it makes sense to generate bindings against NativeEthernet or QNEthernet using bindgen or cxx or does it make sense to just implement the ethernet driver in Rust based on the code that drives it from NativeEthernet? Both seems pain here but what would people's take be on the least amount of pain?
 
I can't answer about the software side, as I've never used Rust.

But on the hardware side, Teensy 4.1 Ethernet is a combination of an Ethernet MAC (pretty much all the digital circuitry) built inside the man IMXRT chip and the DP83825I phy chip (mostly analog stuff), and the magjack accessory. As far as the software is concerned, all the interesting stuff is within the built-in Ethernet mac. It's documented in chapter 41 of the reference manual starting on page 2079. The DP83825I chip normally "just works". It does have a MDIO interface which can configure lots of things, but that's rarely used. Obviously the magjack part doesn't have any configuration, it just couples the RJ45 to the 6 pins connected to the DP83825I PHY chip.

Stuff about W5500 is probably just leftover comments and unused code. W5500 is completely different ethernet hardware which connects to the SPI port. It is supported by the normal Arduino Ethernet library.
 
Ok so if I follow the code to do ethernet in the FNET repo it should prob work? Seems like a deep pool of hurt but that's what I enjoy so time to dive right in.
 
Back
Top