CubeMX 5 ErrorHandler in USB CDC is called too often
Hello All,
I updated to CubeMX 5 and use STM32F4 USB CDC.
After update my programm crashes directly after init.
This is because the USB driver calles directly into ErrorHandler when USB is not connected.
The ErrorHandler does a while(1) forever loop.
Why did STM changed that behaviour?
As in the ErrorHandler itself I have no possibility to test where it comes from and react according to the problem. The ErrorHandler is generic and global and should only be called on severe problems.
But a not connected USB interface is not "severe" but is a generic use-case.
What I currently do is to modify the ErrorHandler to return immediately.
I think this behaviour now is not good solution.
There should be a parameter in the call to ErrorHandler, so that ErrorHandler can react properly to the problem.
My 2ct.
Adib.
