STM32F407 LAN870A with lwIP BOARD_PHY_ID

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: barthess, RoccoMarco

Pethead
Posts: 37
Joined: Mon Jul 11, 2016 1:47 pm
Has thanked: 1 time

STM32F407 LAN870A with lwIP BOARD_PHY_ID

Postby Pethead » Fri Jan 27, 2017 1:24 pm

Hello,

I am using the board EasyMX PRO V7 for STM32 and I have the MCU card MCU card with a STM32F407VGT6. I am trying to get the lwIP stack to work on my set up and I am using the hal/boards/ST_STM32F4_Discovery/board.h as a base for my project and as we can see the ethernet transceiver is a LAN870A chip and I am wondering what the definition #define BOARD_PHY_ID should be set to for that chip?

If you look at the OLIMEX_STM32_E407 example #define BOARD_PHY_ID is MII_KS8721_ID, what should I use instead?

User avatar
Giovanni
Site Admin
Posts: 13125
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 769 times
Been thanked: 653 times
Contact:

Re: ChibiOS lwIP BOARD_PHY_ID

Postby Giovanni » Fri Jan 27, 2017 1:30 pm

Hi,

The ID is a 32 bits value, you need to find it in the datasheet of your device, it is LAN8710A, see ID registers 1 and 2.

Note that the ID can change on your device depending on pins state, you better read the datasheet carefully, some initializations are required for some devices.

Giovanni

Pethead
Posts: 37
Joined: Mon Jul 11, 2016 1:47 pm
Has thanked: 1 time

Re: STM32F407 LAN870A with lwIP BOARD_PHY_ID

Postby Pethead » Fri Jan 27, 2017 2:09 pm

Hello, and thanks for the fast reply.

I'm looking at the datasheet page 54-55 but I don't think I quite understand what I should set the ID to anyway...

Under the PHY identifier register 1 it says:
PHY ID Number - Assigned to the 3rd through 18th bits of the Organizationally Unique
Identifier (OUI), respectively (Default = 0007h).

And under PHY identifier register 2 it says:

bits 15:10 - PHY ID number - Assigned to the 19th through 24th bits of the OUI (default = 110000b)
bits 9:4 - Model number (default = 001111b)
bits 3:0 - Revision number (default = The default value of this field will vary dependant on the silicon revision number.)

sorry for a question at the novice level... I doubt I should set the ID to the default values and that is basically all the info I got out of those registers from the datasheet :?

User avatar
Giovanni
Site Admin
Posts: 13125
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 769 times
Been thanked: 653 times
Contact:

Re: STM32F407 LAN870A with lwIP BOARD_PHY_ID

Postby Giovanni » Fri Jan 27, 2017 7:12 pm

Hi,

If in doubt, step into the MAC driver code that identifies the PHY mac_lld_init() and see what is the value returned.

Giovanni

HendrikV
Posts: 1
Joined: Fri Jan 24, 2020 5:18 pm

Re: STM32F407 LAN870A with lwIP BOARD_PHY_ID

Postby HendrikV » Fri Jan 24, 2020 5:22 pm

Was this ever resolved? I'm using the same hardware setup and cannot get the Ethernet to work. I've got the EasyMxPro V7 along with the STM32F407VGT6 that has the LAN8720A PHY.

User avatar
Giovanni
Site Admin
Posts: 13125
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 769 times
Been thanked: 653 times
Contact:

Re: STM32F407 LAN870A with lwIP BOARD_PHY_ID

Postby Giovanni » Fri Jan 24, 2020 6:12 pm

No, it stopped there without answers.

Giovanni

mikeprotts
Posts: 151
Joined: Wed Jan 09, 2019 12:37 pm
Has thanked: 19 times
Been thanked: 23 times

Re: STM32F407 LAN870A with lwIP BOARD_PHY_ID

Postby mikeprotts » Tue Jan 28, 2020 10:28 am

I've used the STM32F4 Discovery with STM32F4DIS-BB, which has the MII_LAN8720_ID and the OLIMEX_STM32_E407_REV_D which has MII_LAN8710A_ID.

The Olimex board files are already in place. The STM32F4DIS-BB board.h file I created (based on ST_STM32F4_DISCOVERY) is attached. If you diff the attached with the original, you'll see what needed to be changed. board.c was unchanged.

Mike
Attachments
BB.zip
(7.21 KiB) Downloaded 30 times


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 4 guests