Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stm32/mphalport: fix ethernet for stm32f429 #5029

Closed
wants to merge 1 commit into from

Conversation

MichaelAkhnoukh
Copy link

Ethernet driver was failing to start because of incorrect OTP area address for the stm32f429 as the MAC address is stored in the OTP area.

Ethernet driver was failing to start because of incorrect OTP area address for the stm32f429 as the MAC address is stored in the OTP area.
@dpgeorge
Copy link
Member

Good find!

But I think it should be fixed differently: this OTP search code is really specific to PYBD boards and so I'd suggest that there'd just be a general hook at the start of mp_hal_get_mac() which would call into an (optional) board-provided macro to get the MAC address, and if that fails then it falls back to the LAA. Then PYBD boards would define this macro as appropriate.

@MichaelAkhnoukh
Copy link
Author

MichaelAkhnoukh commented Aug 21, 2019

i think this can be easily achieved because each board declares FLASH_OTP_BASE & FLASH_OTP_END macros and since the mac address lives in the last block (32 bytes) before the lock block (16 bytes) then OTP_ADDR can be FLASH_OTP_END - 48 bytes

@dpgeorge
Copy link
Member

@MichaelAkhnoukh see #5034 for my attempt to fix this issue.

@MichaelAkhnoukh
Copy link
Author

I have a question does the mac address always exists in the otp region for all stm32 based boards?

@dpgeorge
Copy link
Member

does the mac address always exists in the otp region for all stm32 based boards?

No. stm32 MCUs don't include any MAC address assignments. And I don't know of any Nucleo/Discovery board that has a MAC address either. When you build a product you generally need to purchase and assign a MAC address yourself. PYBD-based boards are special in this regard because they do already have four MAC addresses assigned to them during production.

@dpgeorge
Copy link
Member

Fixed by b1e0484

@dpgeorge dpgeorge closed this Aug 28, 2019
tannewt pushed a commit to tannewt/circuitpython that referenced this pull request Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants