cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 and 10BASE-1TS

Tappi74
Associate

Hi folks,

   I need to use setup system where is 10BASE-T1S communication. And we have stm32H7 controller, so questions is which one would better use LAN8651 (MAC+PHY) chip and do controlling of chip via SPI or chose LAN8670 (PHY) and do chip controlling via RMII. If I have understand right there is no ready drivers for stm32 MCU so probably have to write own drivers from scratch. Do you know Is there some good codebase which can modify to fit to STM32 ?

1 ACCEPTED SOLUTION

Accepted Solutions
STea
ST Employee

Hello @Tappi74 ,

Answering your question about what would be better using SPI with LAN8651 which implement a MAC layer or going with LAN8670 and RMII from the H7 microcontroller.

the LAN8651 is supposed to give T1S capabilities to almost all microcontrollers without the need of an internal MAC layer processing so any micro controller with SPI interface could use this PHY and as an added advantage you will be utilizing less pins from your microcontrollers compered to MII/RMII interfaces.

but this will add i think additional processing time compared to the other PHY receiving the RMII/MII and will potentially cost you more in your design compared to the other PHY 

STea_0-1725380193167.png

in your case if you don't have pinout constrains you would be better of using the Internal MAC layer in your MCU with MII interface which would cost you more pins compared to RMII but surely make processing in PHY LAN8670 faster as you would be bypassing the layer reverting RMII to MII in the PHY

STea_1-1725380378045.png

a good starting point to try and adapt the usage of such PHY is to take the lan8670_driver.c Source Code - LAN8670 10Base-T1S Ethernet PHY driver (oryx-embedded.com) and associated header file and try integration it in ethernetif.c following the same reference examples found in H7cune Fw interfacing with LAN8742 for example I would expect some bumps on the road as T1S is in the early adoption phase and you would not have much resources.
Regards 

 

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
STea
ST Employee

Hello @Tappi74 ,

Answering your question about what would be better using SPI with LAN8651 which implement a MAC layer or going with LAN8670 and RMII from the H7 microcontroller.

the LAN8651 is supposed to give T1S capabilities to almost all microcontrollers without the need of an internal MAC layer processing so any micro controller with SPI interface could use this PHY and as an added advantage you will be utilizing less pins from your microcontrollers compered to MII/RMII interfaces.

but this will add i think additional processing time compared to the other PHY receiving the RMII/MII and will potentially cost you more in your design compared to the other PHY 

STea_0-1725380193167.png

in your case if you don't have pinout constrains you would be better of using the Internal MAC layer in your MCU with MII interface which would cost you more pins compared to RMII but surely make processing in PHY LAN8670 faster as you would be bypassing the layer reverting RMII to MII in the PHY

STea_1-1725380378045.png

a good starting point to try and adapt the usage of such PHY is to take the lan8670_driver.c Source Code - LAN8670 10Base-T1S Ethernet PHY driver (oryx-embedded.com) and associated header file and try integration it in ethernetif.c following the same reference examples found in H7cune Fw interfacing with LAN8742 for example I would expect some bumps on the road as T1S is in the early adoption phase and you would not have much resources.
Regards 

 

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Pavel A.
Evangelist III

Hi @Tappi74 As @STea explained, the difference between these two chips is that one is a pure PHY that connects to the MII/RMII pins of STM32H7 and uses the ETH of STM32H7 as the MAC. [It has also some interesting outputs, can be connected to GPIOs or some I/O expander]. The other connects to any MCU over SPI and couple of GPIOs, and does not use the ETH or any other features of the STM32. It also costs  ~ $1 more than the former. STM32H7 has only one ETH but several SPIs, you can connect several LAN8651's to one MCU.

So it is indeed something to ponder on. The ETH has low level driver in the Cube package, one can use ready examples for LwIP or FreeRTOS+ or ThreadX/NetX using the LAN8670  as "standard PHY" with minimal setup code.

OTOH this ETH driver has worrying reputation and hardly can be relied upon without a thorough review and tests. SPI-based data link may be faster to get working. Especially using the SPI with DMA. The T1S link is 10 MB/s HDX in any case, so advantage of the internal 100 MB/s FDX ETH cannot be fully utilized.

To help you decide, answer these two questions:

* Do you need TCP/IP software stack or the protocol will be not based on IP?

* Is the $1 price difference important?