2021-06-15 03:48 AM
I had a previous issue with the generated CubeMX code, but saw it was already found in:
As per this fix, I am able to get USB DFU working in user flash. However, once connected in bootloader mode the device is not recognized, and in Windows I get a Device Descriptor Request Failed. This is the same error I got without the aforementioned fix in user flash.
PS: As of now I don't expect any hardware issues, as the STM32G0B1 connections are very straightforward, and I was able to get the USB working in user flash.
PPS: Previous issues I found on the community are not relevant to this MCU, as this has all the hardware for USB already built in. The reference manual and datasheet also confirm that the internal clock should be sufficient.
2021-06-15 08:53 AM
How are you activating bootloader mode?
2021-06-15 09:21 AM
From user flash:
Deinitializing the HAL, resetting the clock configuration, setting syscfg to system flash, setting the msp/psp and finally a function call to the system memory.
2021-06-15 09:30 AM
2021-06-15 09:56 AM
What's wrong with using BOOT0 pin and reset?
JW
2021-06-15 01:28 PM
I also disabled all interrupts, as the code might otherwise be interrupted. I'm running the code from FreeRTOS. I think the code might not be at fault, as I have it working on the the STM32G071 and STM32G474.
I will look into the magic word solution to see if that provides an alternative, thank you for the suggestion.
By the way, I am able to connect to the UART pins using a STLINK Mini v3 and cube programmer. Unfortunately it seems like it is only the USB which does not respond.
@Community member
In this specific project we are using the 32 pin version, without spare pins left. (As these were the only ones available due to the chip shortages). Besides, the STM32G0B1xx offers the super useful feature of only needing a USB cable to program it in DFU mode. Which requires no hardware interactions/ interruptions.
2021-06-15 03:59 PM
> I also disabled all interrupts
> ...only needing a USB cable to program it in DFU mode. Which requires no hardware interactions/ interruptions.
I'm fairly certain the DFU bootloader requires interrupts to be enabled and that the UART does not. This is not documented but there are other threads like this that lead me to believe it. Regardless, things should be in a reset state (PRIMASK=0) before calling the bootloader.
Here are two such threads, but there are others:
https://community.st.com/s/question/0D50X00009sTgmr/usb-dfu-bootloader-start-from-source
2021-06-15 06:43 PM
>In this specific project we are using the 32 pin version, without spare pins left.
You surely can give up one pin for an experiment, i.e. to find out whether the problem is in software or hardware. Our just use a "known good" board such as Nucleo for experimenting.
JW