2020-10-15 02:44 PM
Hello guys,
I'm not new using DFU but I have this strange problem.
When I try to jump in DFU from my code, I get an "Unknown usb device" from my PC.
I have also 2 push button in my board. Reset and DFU pin (keep PH3 high ).
If I keep pressed DFU button and then pressing Reset it fall in the same state (Unknown device).
If I keep pressed DFU button and plug the usb (I get the power from usb) it works.
Investigating I discovered that commenting this line
HAL_SPI_Transmit_DMA(&hspi1,(uint8_t *)bProgADC,sizeof(bProgADC));
DFU works in every case.
What is very strange is that resetting MCU while keep pressed DFU button is not enough, I must cut the power and plug the usb cable while pressing DFU button to go in DFU.
While commenting that SPI line everything is fine
How HAL_SPI_Transmit_DMA can cause this?
How can I fix it?
Thanks in advance
--
Mario
2020-10-15 08:30 PM
Does your program use the USB at all? Are any other bootloader peripherals active during reset, possibly the SPI? What exactly does the DFU button do?
2020-10-15 11:23 PM
My program use USB. It is configured as VCP
Bootloader peripheral are USB, USART1 and SPI1. When I jump to DFU from code I tried to stop/disable everything but still the same issue.
DFU button link PH3 to VCC. Pushbuttons are working, I checked with oscilloscope.