Get_SerialNum () crashes when USB middleware is used in STM32H7 CM4 core. - Workaround?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-21 5:55 AM
Hello dear people,
Of course, the reason is that Get_SerialNum () tries to read the device ID (UID_BASE), which unfortunately is not supported in CM4 core. So i get a Hard Fault.
I do have a solution getting the UID from the CM7 core, but alas, it's quite difficult to put this solution into the cube-generated source code.
One workaround would be, to have an USER CODE area somewhere before the buggy code (in USBD_HS_SerialStrDescriptor before the call of Get_SerialNum or in Get_SerialNum before the buggy code). Then i could simply execute different code and then just return, so to skip that particular code.
So can anyone tell me how to change the Cube template in that way?
Any better solutions to fix this?
Thanks in advance!
-Albert
- Labels:
-
STM32H7 series
-
USB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-21 12:32 PM
There aren't any hooks into that part of the code that you can modify without touching non-user code sections. You just need to change it, or lobby ST to change it.
Related:
https://community.st.com/s/question/0D53W000002diUsSAI/stm32cubemx-h7x5h7x7-usb-cdc-bug
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-21 12:50 PM
Thanks for your answer.
Unfortunately, none of it answeres my questions.
These are my questions:
Can anyone tell me how to change the Cube template in that way?
Any better solutions to fix this?
