Nucleo F411RE stm32cubeProg not detect USB

Post here first, or if you can't find a relevant section!
Post Reply
heretop
Posts: 39
Joined: Sun Jun 20, 2021 2:09 pm

Nucleo F411RE stm32cubeProg not detect USB

Post by heretop »

Hi,

I try to use connect USB type c with Nucleo F411RE. I connected:
  • BOOT0 (red wire) and 5V (yellow wire) to USB C VCC
  • GND (black wire) to USB C GND
  • DP PA12 (green wire) to USB C DP1
  • DM PA11 (blue wire) to USB C DN1
  • BOOT1 PB2 (brown wire) to board GND
Shown in the picture:
Image

After I connect to the PC with stm32CubeProgrammer v2.10.0 installed. The red led on the nucleo turns on. But there is no device detected at PC (unlike when I plug in a usb drive it shows find something) and no new device shown in my device manager. And there is "No DFU detected" in stm32CubeProgrammer like:
2022-06-08 221629.png
2022-06-08 221629.png (11.82 KiB) Viewed 1882 times
May I know anyone know what wrong with this? Thanks a lot!
by ag123 » Wed Jun 08, 2022 2:34 pm
i think it may need something like this:
- solder that 8 mhz crystal
- check the manuals set the jumpers so that the Nucleo use the crystal as HSE.
- you would need to configure your board as like a custom board
you need to make a SystemClock_Config() that runs on the 8 mhz crystal
Go to full post
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Nucleo F411RE stm32cubeProg not detect USB

Post by ag123 »

i think it may need something like this:
- solder that 8 mhz crystal
- check the manuals set the jumpers so that the Nucleo use the crystal as HSE.
- you would need to configure your board as like a custom board
you need to make a SystemClock_Config() that runs on the 8 mhz crystal
heretop
Posts: 39
Joined: Sun Jun 20, 2021 2:09 pm

Re: Nucleo F411RE stm32cubeProg not detect USB

Post by heretop »

ag123 wrote: Wed Jun 08, 2022 2:34 pm i think it may need something like this:
- solder that 8 mhz crystal
- check the manuals set the jumpers so that the Nucleo use the crystal as HSE.
- you would need to configure your board as like a custom board
you need to make a SystemClock_Config() that runs on the 8 mhz crystal
Thanks for reply and suggestions!
I checked the UM1724 https://www.st.com/resource/en/user_man ... ronics.pdf and found if I use 8 MHz 16pf crystal, I need:
8 MHz, 16 pF, 20 ppm, and DIP footprint. It is recommended to use 9SL8000016AFXHF0 manufactured by Hong Kong X'tals Limited.
The following configuration is needed:
– SB54 and SB55 OFF
– R35 and R37 soldered
– C33 and C34 soldered with 20 pF capacitors
– SB16 and SB50 OFF
What I have are 12 MHz and 16 MHz crystal in correct footprint and 12pf and 15pf c0g 0603 capacitor. I used 16 Mhz crystal and 12pf cap on my custom board (it works for other tasks but I did not test usb there as no way to add usb with current design, so I first test usb on nucleo), and is that OK just use 16 Mhz crystal and 12pf cap for nucleo to use USB?
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Nucleo F411RE stm32cubeProg not detect USB

Post by ag123 »

I'm not sure about the electrical aspects, i.e. 12 mhz, 16 mhz may or may not work. So for that you'd need to check and test it separately.

if that works to use a 12 mhz or 16 mhz crystal, the main thing is to setup the SystemClock_Config() in a variant for your board.
you can take a look at that in the current variants for the custom boards.

there is also a python script that you can use to explore the clock configs
viewtopic.php?f=41&t=78
heretop
Posts: 39
Joined: Sun Jun 20, 2021 2:09 pm

Re: Nucleo F411RE stm32cubeProg not detect USB

Post by heretop »

ag123 wrote: Thu Jun 09, 2022 2:18 pm I'm not sure about the electrical aspects, i.e. 12 mhz, 16 mhz may or may not work. So for that you'd need to check and test it separately.

if that works to use a 12 mhz or 16 mhz crystal, the main thing is to setup the SystemClock_Config() in a variant for your board.
you can take a look at that in the current variants for the custom boards.

there is also a python script that you can use to explore the clock configs
viewtopic.php?f=41&t=78
Thanks for the tips!

I will try with 16mhz and 12pf first.

For the setup the SystemClock_Config(), I'm curious that the bootloader is before the normal program right? Will these changes also affect the bootloader stage?
heretop
Posts: 39
Joined: Sun Jun 20, 2021 2:09 pm

Re: Nucleo F411RE stm32cubeProg not detect USB

Post by heretop »

ag123 wrote: Thu Jun 09, 2022 2:18 pm I'm not sure about the electrical aspects, i.e. 12 mhz, 16 mhz may or may not work. So for that you'd need to check and test it separately.

if that works to use a 12 mhz or 16 mhz crystal, the main thing is to setup the SystemClock_Config() in a variant for your board.
you can take a look at that in the current variants for the custom boards.

there is also a python script that you can use to explore the clock configs
viewtopic.php?f=41&t=78
After I config based on UM1724 wtih16MHz crystal and 12pf cap with setting up the SystemClock_Config, the board is recognized by my computer and stm32CubeProg. I can read data from memory now. Thanks a lot for all the help!
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Nucleo F411RE stm32cubeProg not detect USB

Post by ag123 »

I think Nucleos has a separate st-link chip (probably a stm32f103) on board, it isn't a boot loader, it is a full SWD programmer.
it is probably also the firmware that offers serial, and other 'boot loader' (mass storage?) features.
Note that i'm not sure, you'd need to check that in the manuals etc.
heretop
Posts: 39
Joined: Sun Jun 20, 2021 2:09 pm

Re: Nucleo F411RE stm32cubeProg not detect USB

Post by heretop »

ag123 wrote: Thu Jun 09, 2022 2:50 pm I think Nucleos has a separate st-link chip (probably a stm32f103) on board, it isn't a boot loader, it is a full SWD programmer.
As shown in my picture in my initial post, I did not connect to ST-LINK part, I only connect usb to DP and DM of f411re. It will not go through that SWD right. And I also selected USB in stm32CubeProg
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Nucleo F411RE stm32cubeProg not detect USB

Post by ag123 »

think that'd goto the F411, likely independent of the st-link. But check the docs / schematics etc.
for one thing, after you have checked in schematics that it is only going to f411, and you have soldered the crystal
you can try to set boot0 on f411, then connect usb to pc.
the pc should detect it as a USB DFU device.
if it does, then you are in luck, you can next program it using stm32cubeProg
for your own sketch, you'd still need your own SystemClock_Config() that use the crystal.
heretop
Posts: 39
Joined: Sun Jun 20, 2021 2:09 pm

Re: Nucleo F411RE stm32cubeProg not detect USB

Post by heretop »

ag123 wrote: Thu Jun 09, 2022 2:55 pm think that'd goto the F411, likely independent of the st-link. But check the docs / schematics etc.
for one thing, after you have checked in schematics that it is only going to f411, and you have soldered the crystal
you can try to set boot0 on f411, then connect usb to pc.
the pc should detect it as a USB DFU device.
if it does, then you are in luck, you can next program it using stm32cubeProg
for your own sketch, you'd still need your own SystemClock_Config() that use the crystal.
The Boot0 is connected to USB VCC as shown in initial post. My PC detected it as stm32 bootloader and my stm32cubeProg is able to open it with USB model
Post Reply

Return to “General discussion”