2017-03-08 07:22 AM
static
voidlow_level_init(
structnetif
*netif)
{
uint32_t
regvalue = 0;
HAL_StatusTypeDef
hal_eth_init_status;
/*
Init
ETH */uint8_t
MACAddr[6] ;
heth.
Instance
= ETH;
heth.
Init
.
AutoNegotiation
= ETH_AUTONEGOTIATION_ENABLE;
heth.
Init
.
PhyAddress
= LAN8742A_PHY_ADDRESS;
MACAddr[0] = 0x00;
MACAddr[1] = 0x80;
MACAddr[2] = 0xE1;
MACAddr[3] = 0x00;
MACAddr[4] = 0x00;
MACAddr[5] = 0x00;
heth.
Init
.
MACAddr
= &MACAddr[0];
heth.
Init
.
RxMode
= ETH_RXINTERRUPT_MODE;
heth.
Init
.
ChecksumMode
= ETH_CHECKSUM_BY_HARDWARE;
heth.
Init
.
MediaInterface
= ETH_MEDIA_INTERFACE_RMII;
heth.Init.MACAddr is a pointer to the MACAddr. but when i leave this funtion the pointer is not pointing to a defined
memory space. It is later on in the program not possible to get the MacAddr info form
heth.Init.MACAddr. The pointer must point to a MACAddr that is available all the time the program is running.
2017-03-09 08:51 AM
Hi
Poelmans.Jos
,Could you please give more explanation about your issue?
Init
.
MACAddr
= &MACAddr[0]; orheth.
Init
.
MACAddr
= MACAddr;point on the first address of the array.
Otherwise you can start from ready example under the STM32F7:
STM32Cube_FW_F7_V1.6.0\Projects\STM32F769I_EVAL\Applications\LwIP\LwIP_IAP
-Nesrine-
2017-03-09 10:30 PM
the MACAddr is in local memory of the low_level_init function.
When you leave this funtion the reserved memor for MACAddr is give free for other use.
If you then want look to the info of the mac addres with heth.Init.MACAddr the data where this pointer
is pointing is not anymore valid.
I have use the code from
STM32Cube_FW_F7_V1.6.0.