USB bootloader: Hard Fault when STM32cubeProgrammer connects to STM32L562 DFU
Processor: STM32L562QEI
Board: proprietary
When connecting STM32CubeProgrammer to my STM32L562QEIx board via USB, I get a Hard Fault interrupt.
The USB interface is initialized with MX_USB_Device_Init() and STM32CubeProgrammer correctly detects it. But as soon as I click on "Connect", the processor enters the Hard Fault handler.
Some investigation shows that HAL_PCD_EP_Transmit() is called with <pBuf> being NULL while <len> = 1204. This leads to a Hard Fault in USB_WritePMA() further down the call tree.
The (DFU) code was generated with STM32CubeMX using "STM32Cube FW_L5 V1.4.0".
The USB hardware interface is OK, when running the application firmware on the board, it presents itself as a virtual COM port over which I am able to communicate (except that when USB is connected to a PC at startup, I may sometime experience Hard Faults as well)
Any thoughts / help is very much appreciated !
Jeroen
