2020-11-25 02:34 PM
I have a Zephyr application that uses the USB port on the STM32F373 to drive two serial ports. One serial port is used for console output and the other is used for sending commands to the application. I am trying to flash the chip in DFU mode from Linux using the dfu-util tool. I am able to flash the chip and enter my application, but neither of the serial devices appear. It appears that the state of the USB port doesn't get switched to runtime after using it for DFU flashing.
I've seen in the reference manuals that ST recommends disabling USB interrupts, resetting the USB core, and then restarting USB. I've tried the following code but am still unable to get the serial ports to appear after flashing with DFU.
// Disable USB interrupts
__NVIC_DisableIRQ( USB_LP_IRQn );
// Reset USB
__HAL_RCC_USB_FORCE_RESET();
__HAL_RCC_USB_RELEASE_RESET();
// Enable USB interrupts
__NVIC_DisableIRQ( USB_LP_IRQn );
// Enable USB
usb_enable(NULL);
I have also seen that others who have had similar issues have found success using a system reset rather than a USB reset. I've tried the system reset as well and the serial ports still do not appear.
Does anybody have any thoughts on what could be wrong?
Thanks