-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
esp32: Add LAN8670. #16421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
esp32: Add LAN8670. #16421
Conversation
@JohannesMaierhofer @DuaneKaufman are you able to test this PR? |
Dear All,
I have a pair of Two-Wire ETH Click boards from Mikroe ( [ https://www.mikroe.com/two-wire-eth-click | https://www.mikroe.com/two-wire-eth-click ] ), which are Microchip LAN8651 based and SPI-connected to the micro-controller board.
I am not sure how much the LAN8651 is similar to the LAN867x chip, but I was leaning towards the LAN8651 for its ability to use SPI.
If the LAN8651 can be used just like a LAN867x, what would an example SPI-based Micropython look like?
Sincerely,
Duane
…----- On Dec 15, 2024, at 6:49 PM, Damien George ***@***.***> wrote:
[ https://github.com/JohannesMaierhofer | @JohannesMaierhofer ] [
https://github.com/DuaneKaufman | @DuaneKaufman ] are you able to test this PR?
—
Reply to this email directly, [
#16421 (comment) |
view it on GitHub ] , or [
https://github.com/notifications/unsubscribe-auth/ABK2PQEZGGO6XLXP2O3VVRL2FYPSVAVCNFSM6AAAAABTVCAHZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBUGI2TGMJXG4
| unsubscribe ] .
You are receiving this because you were mentioned. Message ID: <
***@***.*** >
|
@dpgeorge I tested this on a board with LAN8671 chip and when I try to create the LAN object I get this error:
Which is odd, because on the same board, a previously hacked together proof-of-concept MicroPython build initializes the LAN8671 as expected without error. Not sure what the difference is. |
Oh, if I run it again after that failure, I get an extra error:
|
88b6fa6
to
7647ccf
Compare
@xorbit There was a bug, the LAN8670 was accidentally grouped with the SPI/Ethernet PHYs so it failed to install. I've pushed an updated commit and it should work now, but I'm not able to test it apart from verifying that the install step passes. |
I tried this new commit and it seems to work on my boards. 👍 However, I had some problem with the Anyway, that's not really related to this PR I think. I was wondering if it would make sense to have the If not, how many boards fail to build with IDF 5.3+? |
Dear Patrick,
Are your LAN8670 boards custom or purchased? I bought two LAN8670 eval boards, but have not gotten around to testing yet.
Sincerely,
Duane
…----- On Jan 29, 2025, at 12:44 PM, Patrick Van Oosterwijck ***@***.***> wrote:
I tried this new commit and it seems to work on my boards. 👍
However, I had some problem with the make submodules not pulling in berkeley db,
I needed to apply this fix first:
[ #10658 |
#10658 ]
Anyway, that's not really related to this PR I think.
I was wondering if it would make sense to have the idf_component.yml defined per
board?
If not, how many boards fail to build with IDF 5.3+?
—
Reply to this email directly, [
#16421 (comment) |
view it on GitHub ] , or [
https://github.com/notifications/unsubscribe-auth/ABK2PQCNZXWLIEV6MINONOL2NEOSLAVCNFSM6AAAAABTVCAHZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRSGU2DSMBRGA
| unsubscribe ] .
You are receiving this because you were mentioned. Message ID: <
***@***.*** >
|
@DuaneKaufman it is a custom board that hopefully soon will become a product. The timing of which may hinge on this PR making it into mainline MicroPython. 😆 |
Probably not, we already have multiple copy-paste copies and changing to that we'd have dozens. However, we could maybe provide a way to override (I think you can already add a custom in-tree component to a board via
Probably none, but the question is more "are there subtle behaviour changes or regressions when built with IDF 5.3+?" Updating the minimum IDF version boils down to two things:
There's also the bigger picture view, which is that if MicroPython has a need to keep adding support for features distributed via ESP-IDF component manager, and if these components may have particular version or platform requirements, then we may need a way to support them flexibly. |
7647ccf
to
8c4a41e
Compare
I've reworked this PR so that it builds a new Nightly builds currently use ESP-IDF 5.2.2 so they won't contain LAN8670 support immediately after this merges. To get support you'll need to build MicroPython locally with a newer ESP-IDF version (5.3.x or 5.4.x). Suggest after 1.25.0 releases that we bump the build version (for nightly and CI) to use ESP-IDF 5.3.2. |
8c4a41e
to
165b902
Compare
Turns out I didn't look hard enough at the Component Manager docs, it can do conditional dependencies just fine. 🤦 So have simplified to this! I think we can use this technique to collapse the per-target main_xyz components down to one main component again. Have made a note to look at this when I have a chance. |
3b3ff5b
to
943e31b
Compare
Is there a reason this is not being merged? I'm waiting on this functionality to create a new board definition. |
943e31b
to
79e9b54
Compare
Thanks for being patient. The 1.25 release has run behind and this feature is slated for 1.26. 1.25 should be released very soon, at which point we'll start merging 1.26 changes. I've just rebased this PR on master to resolve the merge conflict. |
Thank you for the update, I just wanted to ensure this wasn't lost in the shuffle. 😊 |
79e9b54
to
88c3fd4
Compare
This adds support for LAN8670 to the esp32 port. Enabled conditionally for the esp32 target, if ESP-IDF version is new enough (v5.3 or newer). Fixes issue micropython#15731. Signed-off-by: Damien George <damien@micropython.org> Signed-off-by: Angus Gratton <angus@redyak.com.au>
88c3fd4
to
10f6c06
Compare
IDF is now at 5.4.1 and this PR is now merged. LAN8670 should be supported by the ESP32 (only) in latest downloads. |
Awesome, thank you! |
Yes, this is good news - thanks! |
Summary
This adds support for LAN8670 to the esp32 port, when built with ESP-IDF v5.3 or newer.
Addresses issue #15731.
Testing
This is untested.
Trade-offs and Alternatives
Merging this PR won't cause LAN8670 support to be available in the nightly builds until we update the ESP-IDF version there to V5.3.x. This will probably happen after the MicroPython 1.25.0 release.