Hello
my previous board has the same setup 32f427 and mac in eeprom.
To achieve this programmatically (without using a shell command), I have
used my application.
The application boots a system app instead of NSH. This app starts some
useful threads.
If I need to use NSH, I can start the shell from here by just calling
nsh_main. My damon threads continue to run in the background, and exit
from nsh returns to my application main loop.
Part of the app initialization calls hn70ap_netmonitor_init here:
https://github.com/f4grx/hn70ap/blob/master/apps/sysdaemon/sysdaemon_netmonitor.c#L412
This is where I read the EEPROM and set the MAC address using
netlib_setmacaddr. This function does not depend on the platform being
stm32 or other.
Then I start a netmonitor thread to detect cable plugs and run DHCP
negotiation whenever the cable is plugged, this is useful to know, but
unrelated.
Sebastien
Le 02/08/2020 à 12:59, Fotis Panagiotopoulos a écrit :
Hi,
I am using an STM32F427 MCU on a project that I am porting to NuttX.
For the moment everything seems to be working, apart from the Ethernet MAC.
I really can't find the correct way to set the MAC address to the Ethernet
driver.
My hardware uses an I2C EEPROM to store the MAC address. I will have to
read the EEPROM, and pass the address to the MAC driver.
Which is the correct function to use to set the MAC address?
When is the correct time during system initialization to do so?