2025-06-04 8:28 AM - last edited on 2025-06-05 8:06 AM by FBL
I am trying to add the NUCLEO-N657X0-Q (MB194-N657X0Q-C01) to the IMBootloader project, which currently uses the Legacy Classic USB device middleware. I ran into a problem where, after calling the HAL_PCD_Start() function, I receive an unexpected interrupt.
If I comment out the line
USBx_DEVICE->DCTL &= ~USB_OTG_DCTL_SDIS;
the issue no longer occurs.
Exact position of line in the code:
https://github.com/IMProject/IMBootloader/blob/add_nucleo-stm32n657x-q/Drivers/STM32N6xx_HAL_Driver/Src/stm32n6xx_ll_usb.c#L1152
The full code is available in this branch:
https://github.com/IMProject/IMBootloader/tree/add_nucleo-stm32n657x-q
It can be built with a simple command: make nucleo_n657x0_q_ram
Also attaching a video showing how the issue occurs.
Any pointers to help save time would be appreciated. Thanks in advance!
Solved! Go to Solution.
2025-06-05 10:11 AM
I was able to solve it thanks to this example:
https://github.com/STMicroelectronics/stm32n6-classic-coremw-apps/blob/main/Projects/NUCLEO-N657X0-Q/Applications/USB_Device/CDC_Standalone
In the end, I figured out that I was missing the implementation of
USB1_OTG_HS_IRQHandler(void);
2025-06-05 10:11 AM
I was able to solve it thanks to this example:
https://github.com/STMicroelectronics/stm32n6-classic-coremw-apps/blob/main/Projects/NUCLEO-N657X0-Q/Applications/USB_Device/CDC_Standalone
In the end, I figured out that I was missing the implementation of
USB1_OTG_HS_IRQHandler(void);