Code Monkey home page Code Monkey logo

Comments (13)

mcauser avatar mcauser commented on June 20, 2024

It's a F407 based board, so it has Ethernet MAC unlike the F405 on the original pyboard.
Haven't implemented it yet though.
If any of the other F407 boards have implemented it, I could try upgrading this board to match.

Maybe try the $4 W5500 module?
https://www.aliexpress.com/item/32894225202.html
https://docs.micropython.org/en/latest/library/network.WIZNET5K.html

from black_f407ve.

untitledlt avatar untitledlt commented on June 20, 2024

Don't think it's worth to use external module if it has built-in support.
How can i help to make it happen faster?

from black_f407ve.

mcauser avatar mcauser commented on June 20, 2024

I found these boards defining HW Ethernet via RMII:
https://github.com/micropython/micropython/blob/master/ports/stm32/boards/NUCLEO_F429ZI/mpconfigboard.h
https://github.com/micropython/micropython/blob/master/ports/stm32/boards/NUCLEO_F767ZI/mpconfigboard.h
https://github.com/micropython/micropython/blob/master/ports/stm32/boards/STM32F7DISC/mpconfigboard.h
https://github.com/micropython/micropython/blob/master/ports/stm32/boards/STM32F769DISC/mpconfigboard.h

from black_f407ve.

untitledlt avatar untitledlt commented on June 20, 2024

But it's not F407

from black_f407ve.

mcauser avatar mcauser commented on June 20, 2024

http://www.efton.sk/STM32/STM32F4xx%20misc.pdf

These are the F407 Eth pins:

PA0 ETH_MII_CRS
PA1 ETH_MII_RX_CLK, ETH_RMII_REF_CLK
PA2 ETH_MDIO
PA3 ETH_MII_COL
PA7 ETH_MII_RX_DV, ETH_RMII_CRS_DV
PB0 ETH_MII_RXD2
PB1 ETH_MII_RXD3
PB5 ETH_PPS_OUT
PB8 ETH_MII_TXD3
PB10 ETH_MII_RX_ER
PB11 ETH_MII_TX_EN, ETH_RMII_TX_EN
PB12 ETH_MII_TXD0, ETH_RMII_TXD0
PB13 ETH_MII_TXD1, ETH_RMII_TXD1
PC1 ETH_MDC
PC2 ETH_MII_TXD2
PC3 ETH_MII_TX_CLK
PC4 ETH_MII_RXD0, ETH_RMII_RXD0
PC5 ETH_MII_RXD1, ETH_RMII_RXD1
PE2 ETH_MII_TXD3
PG8 ETH_PPS_OUT
PG11 ETH_MII_TX_EN, ETH_RMII_TX_EN
PG13 ETH_MII_TXD0, ETH_RMII_TXD0
PG14 ETH_MII_TXD1, ETH_RMII_TXD1
PH2 ETH_MII_CRS
PH3 ETH_MII_COL
PH6 ETH_MII_RXD2
PH7 ETH_MII_RXD3
PI10 ETH_MII_RX_ER

from black_f407ve.

mcauser avatar mcauser commented on June 20, 2024

Try adding this to the bottom of mpconfigboard.h and building.

// Ethernet via RMII
#define MICROPY_HW_ETH_MDC          (pin_C1)
#define MICROPY_HW_ETH_MDIO         (pin_A2)
#define MICROPY_HW_ETH_RMII_REF_CLK (pin_A1)
#define MICROPY_HW_ETH_RMII_CRS_DV  (pin_A7)
#define MICROPY_HW_ETH_RMII_RXD0    (pin_C4)
#define MICROPY_HW_ETH_RMII_RXD1    (pin_C5)
#define MICROPY_HW_ETH_RMII_TX_EN   (pin_G11)
#define MICROPY_HW_ETH_RMII_TXD0    (pin_G13)
#define MICROPY_HW_ETH_RMII_TXD1    (pin_G14)

from black_f407ve.

untitledlt avatar untitledlt commented on June 20, 2024

Here's what i'm getting now:

$ make BOARD=BLACK_F407VE
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
GEN build-BLACK_F407VE/genhdr/moduledefs.h
GEN build-BLACK_F407VE/genhdr/qstr.i.last
eth.c:37:10: fatal error: lwip/etharp.h: No such file or directory
 #include "lwip/etharp.h"
          ^~~~~~~~~~~~~~~
compilation terminated.
network_lan.c:34:10: fatal error: lwip/netif.h: No such file or directory
 #include "lwip/netif.h"
          ^~~~~~~~~~~~~~
compilation terminated.
make: *** [build-BLACK_F407VE/genhdr/qstr.i.last] Error 1
make: *** Deleting file `build-BLACK_F407VE/genhdr/qstr.i.last'

Any ideas?

from black_f407ve.

mcauser avatar mcauser commented on June 20, 2024
# MicroPython settings
MICROPY_PY_LWIP = 1

In mpconfigboard.mk?

As per:
https://github.com/micropython/micropython/blob/master/ports/stm32/boards/NUCLEO_F429ZI/mpconfigboard.mk

from black_f407ve.

untitledlt avatar untitledlt commented on June 20, 2024

I had to clone micropython with --recursive flag but now i'm stuck with new errors:

$ make BOARD=BLACK_F407VE
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
CC eth.c
In file included from eth.c:31:
eth.c: In function 'eth_mac_init':
eth.c:190:106: error: implicit declaration of function 'STATIC_AF_ETH_RMII_REF_CLK'; did you mean 'STATIC_AF_ETH_RMII__REF_CLK'? [-Werror=implicit-function-declaration]
     mp_hal_pin_config_alt_static(MICROPY_HW_ETH_RMII_REF_CLK, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, STATIC_AF_ETH_RMII_REF_CLK);
                                                                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
pin_static_af.h:42:48: note: in definition of macro 'mp_hal_pin_config_alt_static'
         mp_hal_pin_config(pin_obj, mode, pull, fn_type(pin_obj)) /* Overflow Error => alt func not found */
                                                ^~~~~~~
boards/BLACK_F407VE/mpconfigboard.h:151:38: error: 'pin_G11' undeclared (first use in this function); did you mean 'pin_B11'?
 #define MICROPY_HW_ETH_RMII_TX_EN   (pin_G11)
                                      ^~~~~~~
pin_static_af.h:42:27: note: in definition of macro 'mp_hal_pin_config_alt_static'
         mp_hal_pin_config(pin_obj, mode, pull, fn_type(pin_obj)) /* Overflow Error => alt func not found */
                           ^~~~~~~
eth.c:194:34: note: in expansion of macro 'MICROPY_HW_ETH_RMII_TX_EN'
     mp_hal_pin_config_alt_static(MICROPY_HW_ETH_RMII_TX_EN, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, STATIC_AF_ETH_RMII_TX_EN);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
boards/BLACK_F407VE/mpconfigboard.h:151:38: note: each undeclared identifier is reported only once for each function it appears in
 #define MICROPY_HW_ETH_RMII_TX_EN   (pin_G11)
                                      ^~~~~~~
pin_static_af.h:42:27: note: in definition of macro 'mp_hal_pin_config_alt_static'
         mp_hal_pin_config(pin_obj, mode, pull, fn_type(pin_obj)) /* Overflow Error => alt func not found */
                           ^~~~~~~
eth.c:194:34: note: in expansion of macro 'MICROPY_HW_ETH_RMII_TX_EN'
     mp_hal_pin_config_alt_static(MICROPY_HW_ETH_RMII_TX_EN, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, STATIC_AF_ETH_RMII_TX_EN);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from pin_static_af.h:31,
                 from eth.c:31:
build-BLACK_F407VE/genhdr/pins_af_defs.h:29:100: error: conversion from 'long long unsigned int' to 'uint32_t' {aka 'long unsigned int'} changes value from '18446744073709551615' to '4294967295' [-Werror=overflow]
 #define STATIC_AF_ETH_RMII_TX_EN(pin_obj) ( \
                                           ~~~
     ((strcmp( #pin_obj , "(&pin_B11_obj)")  & strcmp( #pin_obj , "((&pin_B11_obj))")) == 0) ? (11) : \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
     (0xffffffffffffffffULL))
     ~~~~~~~~~~~~~~~~~~~~~~~~
pin_static_af.h:42:48: note: in expansion of macro 'STATIC_AF_ETH_RMII_TX_EN'
         mp_hal_pin_config(pin_obj, mode, pull, fn_type(pin_obj)) /* Overflow Error => alt func not found */
                                                ^~~~~~~
eth.c:194:5: note: in expansion of macro 'mp_hal_pin_config_alt_static'
     mp_hal_pin_config_alt_static(MICROPY_HW_ETH_RMII_TX_EN, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, STATIC_AF_ETH_RMII_TX_EN);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from eth.c:31:
boards/BLACK_F407VE/mpconfigboard.h:152:38: error: 'pin_G13' undeclared (first use in this function); did you mean 'pin_B13'?
 #define MICROPY_HW_ETH_RMII_TXD0    (pin_G13)
                                      ^~~~~~~
pin_static_af.h:42:27: note: in definition of macro 'mp_hal_pin_config_alt_static'
         mp_hal_pin_config(pin_obj, mode, pull, fn_type(pin_obj)) /* Overflow Error => alt func not found */
                           ^~~~~~~
eth.c:195:34: note: in expansion of macro 'MICROPY_HW_ETH_RMII_TXD0'
     mp_hal_pin_config_alt_static(MICROPY_HW_ETH_RMII_TXD0, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, STATIC_AF_ETH_RMII_TXD0);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from pin_static_af.h:31,
                 from eth.c:31:
build-BLACK_F407VE/genhdr/pins_af_defs.h:932:100: error: conversion from 'long long unsigned int' to 'uint32_t' {aka 'long unsigned int'} changes value from '18446744073709551615' to '4294967295' [-Werror=overflow]
 #define STATIC_AF_ETH_RMII_TXD0(pin_obj) ( \
                                          ~~~
     ((strcmp( #pin_obj , "(&pin_B12_obj)")  & strcmp( #pin_obj , "((&pin_B12_obj))")) == 0) ? (11) : \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
     (0xffffffffffffffffULL))
     ~~~~~~~~~~~~~~~~~~~~~~~~
pin_static_af.h:42:48: note: in expansion of macro 'STATIC_AF_ETH_RMII_TXD0'
         mp_hal_pin_config(pin_obj, mode, pull, fn_type(pin_obj)) /* Overflow Error => alt func not found */
                                                ^~~~~~~
eth.c:195:5: note: in expansion of macro 'mp_hal_pin_config_alt_static'
     mp_hal_pin_config_alt_static(MICROPY_HW_ETH_RMII_TXD0, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, STATIC_AF_ETH_RMII_TXD0);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from eth.c:31:
boards/BLACK_F407VE/mpconfigboard.h:153:38: error: 'pin_G14' undeclared (first use in this function); did you mean 'pin_B14'?
 #define MICROPY_HW_ETH_RMII_TXD1    (pin_G14)
                                      ^~~~~~~
pin_static_af.h:42:27: note: in definition of macro 'mp_hal_pin_config_alt_static'
         mp_hal_pin_config(pin_obj, mode, pull, fn_type(pin_obj)) /* Overflow Error => alt func not found */
                           ^~~~~~~
eth.c:196:34: note: in expansion of macro 'MICROPY_HW_ETH_RMII_TXD1'
     mp_hal_pin_config_alt_static(MICROPY_HW_ETH_RMII_TXD1, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, STATIC_AF_ETH_RMII_TXD1);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from pin_static_af.h:31,
                 from eth.c:31:
build-BLACK_F407VE/genhdr/pins_af_defs.h:260:100: error: conversion from 'long long unsigned int' to 'uint32_t' {aka 'long unsigned int'} changes value from '18446744073709551615' to '4294967295' [-Werror=overflow]
 #define STATIC_AF_ETH_RMII_TXD1(pin_obj) ( \
                                          ~~~
     ((strcmp( #pin_obj , "(&pin_B13_obj)")  & strcmp( #pin_obj , "((&pin_B13_obj))")) == 0) ? (11) : \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
     (0xffffffffffffffffULL))
     ~~~~~~~~~~~~~~~~~~~~~~~~
pin_static_af.h:42:48: note: in expansion of macro 'STATIC_AF_ETH_RMII_TXD1'
         mp_hal_pin_config(pin_obj, mode, pull, fn_type(pin_obj)) /* Overflow Error => alt func not found */
                                                ^~~~~~~
eth.c:196:5: note: in expansion of macro 'mp_hal_pin_config_alt_static'
     mp_hal_pin_config_alt_static(MICROPY_HW_ETH_RMII_TXD1, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, STATIC_AF_ETH_RMII_TXD1);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [build-BLACK_F407VE/eth.o] Error 1

from black_f407ve.

mcauser avatar mcauser commented on June 20, 2024

My bad. This is the VET6 board, not the ZET6 or ZGT6. There's no G pins on this board. Use the B pins instead.

Try replacing this:

#define MICROPY_HW_ETH_RMII_TX_EN   (pin_G11)
#define MICROPY_HW_ETH_RMII_TXD0    (pin_G13)
#define MICROPY_HW_ETH_RMII_TXD1    (pin_G14)

With this:

#define MICROPY_HW_ETH_RMII_TX_EN   (pin_B11)
#define MICROPY_HW_ETH_RMII_TXD0    (pin_B12)
#define MICROPY_HW_ETH_RMII_TXD1    (pin_B13)

from black_f407ve.

untitledlt avatar untitledlt commented on June 20, 2024

Thanks, that helped a bit but still errors remains:

In file included from eth.c:31:
eth.c: In function 'eth_mac_init':
eth.c:190:106: error: implicit declaration of function 'STATIC_AF_ETH_RMII_REF_CLK'; did you mean 'STATIC_AF_ETH_RMII__REF_CLK'? [-Werror=implicit-function-declaration]
     mp_hal_pin_config_alt_static(MICROPY_HW_ETH_RMII_REF_CLK, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, STATIC_AF_ETH_RMII_REF_CLK);
                                                                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
pin_static_af.h:42:48: note: in definition of macro 'mp_hal_pin_config_alt_static'
         mp_hal_pin_config(pin_obj, mode, pull, fn_type(pin_obj)) /* Overflow Error => alt func not found */
                                                ^~~~~~~
cc1: all warnings being treated as errors
make: *** [build-BLACK_F407VE/eth.o] Error 1

from black_f407ve.

mcauser avatar mcauser commented on June 20, 2024

Fixed typo in stm32f405_af.csv
micropython/micropython#5308

from black_f407ve.

LouDnl avatar LouDnl commented on June 20, 2024

Tried about everything I could find online to get a LAN8720 from Aliexpress to work.
After compiling the board just doesn't seem to work. Green led on ETH port lights up and thats it.

>>> import network
>>> l = network.LAN()
>>> l.active(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 110] ETIMEDOUT

I know it's not the module as it works fine on an ESP32 with Micropython

from black_f407ve.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.