cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX initialize MAC adress from external memory

SiegiAtHome
Associate

Hi,

what is the correct way to initialize the MAC address read from an external memory by using LwIP?

 /* Initialize all configured peripherals */

..

=> need MAC address here do correct initalization...

 MX_LWIP_Init();

...

=> MAC address can be read here from SPI flash or similar...

 MX_SPI2_Init();

 MX_SPI1_Init();

...

my suggest (but not possible within user code sections):

 /* Initialize all configured peripherals */

...

=> MAC address can be read here from SPI flash or similar...

 MX_SPI2_Init();

 MX_SPI1_Init();..

...

 /* USER CODE BEGIN READ MACADDRESS */

=> USER CODE SECTION could be useful here to read MAC address from external memory

 /* USER CODE END READ MACADDRESS */

...

 MX_LWIP_Init();

...

thanks

2 REPLIES 2
AvaTar
Lead

In my experience, manufacturers most often avoid the costs of external chips, and rather patch the MAC address (or other specific data) into the HEX file.

SiegiAtHome
Associate

Thanks,

but however, I have to read out MAC Address from an external memory. If an firmware update has to be done, I can't patch all the HEX files individually.

Perhaps others have the same problem?

best reagrds