Runtime configurable USB_DEVICE_NETWORK_ECM_MAC #62006
Unanswered
Hiihtaja77
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Looks like ECM MAC address is hardcoded and can't be changed during runtime.
zephyr/subsys/usb/device/class/netusb/function_ecm.c
Line 403 in 6063490
API
net_if_set_link_addr(iface_eth, "\x00\x00\x5e\x00\x53\xff", 6, NET_LINK_ETHERNET);
Can be used for native network interfaces but not for cases when Ethernet is mounted via a USB NET class.
USB descriptor can be made global and after that MAC address can be set online:
#if defined(CONFIG_USB_ECM_MAC)
uint8_t *ecm_mac_ptr = &utf16le_mac.bString[0];
endif
....
and in source code :
ecm_mac_ptr[20] = str[0];
ecm_mac_ptr[22] = str[1];
How to set ECM MAC address during runtime ?
Beta Was this translation helpful? Give feedback.
All reactions