STM32F401CCU6 DFU Mode problems?

Post Reply
otter2016
Posts: 6
Joined: Wed Apr 15, 2020 8:38 pm

STM32F401CCU6 DFU Mode problems?

Post by otter2016 »

Is anyone having problems putting their 'black pill' STM32F401CCU6 based boards into DFU mode?

I just received today and haven't been able to get it to change into that mode. According to what I've read, I hold down the BOOT0 switch and then do a reset of the board. I've tried doing that using the NRST switch and the Reset line as well.

I had bought a STM32F411 version of the board and it had no problem going to DFU mode so I'm stumped.

Any Suggestions?

Otter2016
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: STM32F401CCU6 DFU Mode problems?

Post by mrburnette »

Instructions here (if the same board)

https://github.com/WeActTC/MiniF4-STM32 ... /README.md

Image


Looks like a nice board.

Ray
stas2z
Posts: 131
Joined: Mon Feb 24, 2020 8:17 pm
Answers: 8

Re: STM32F401CCU6 DFU Mode problems?

Post by stas2z »

try to pull down PB2/BOOT1 while trying to enter DFU with boot0 pulled up
otter2016
Posts: 6
Joined: Wed Apr 15, 2020 8:38 pm

Re: STM32F401CCU6 DFU Mode problems?

Post by otter2016 »

Thanks for the replies -

The board is the F401c version so it doesn't have the user switch on the right hand side, only the Boot0 and Nrst.

According to the 'lore' I found so far, holding down the Boot0 switch and touching the NRST is supposed to put it into DFU mode. What brought me to this situation needs a little explanation (just in case some other person finds themselves in this fix).

Starting with a new 'black pill' board (Wingat version from Ali Express) I was able to plug it up with my arduino version and the board's bootstrap came up and installed the serial port without any problem.

I looked around at the STM32 board setup (1.8.10) which it turns out supports the 401cc but isn't very clear what the settings are for the programmer, etc. would be. After a number of failed attempts of installing the blinky I decided I would try another approach.

I've been successful flashing from MBED through my ST-LINK V2, but the flashing I did before was on the larger version, the STM32F411C. I looked through MBED's boards, and found a board for the STM 401re, which like the 411re I assumed would work. I tried flashing it and it acted as if it had worked, but when I tried to execute the binary it wouldn't start.

I then tried to go back to the Arduino configuration, but by that time the bootstrap no longer was working, and so I couldn't do anything with it with Arduino. Being the resourceful guy that I am, I decided to compile the blinky in Arduino and export it to a binary file, and flash it in with my ST-link V2.

ST-Link recognized the board okay. I had read in the MBED notes that the 401re wouldn't work unless the firmware had been updated and so my task then was to update the firmware. The STM code to do that wouldn't recognize that the board was in DFU mode and so would not update. That is when I posted about possible problems with getting into DFU mode.

My analysis is that when I attempted to use the STM32F401re board template, it was programming flash with the belief I was using a 512k board (the Wingat version is 256kb) so when MBED created the binary it somehow allocated the bootstrap area as part of the flash memory. The ST-LINK V2 dongle, when it programmed the board later clobbered the bootstrap.

Surprisingly, I can compile the STM32 blinky and export it as a binary. THAT binary understands about the 256k limit, and when I program that into the F401C everything works out okay (at least for that simple routine).

The moral of the story is to beware, there are differences between the various configurations out there. Apparently there is a newer board template coming for STM32F401C's and STM32411C's soon.

Otter16
User avatar
Hackswell
Posts: 21
Joined: Sat Mar 14, 2020 9:04 pm
Location: State of Confusion

Re: STM32F401CCU6 DFU Mode problems?

Post by Hackswell »

I had to pull the github repository for pre 1.9.x in order to have proper selection and functioning for my STM32F4xx boards (Both F401 and F411). I'm using the WeAct versions of the black pill F4xx boards, BTW, which have the 3 buttons.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: STM32F401CCU6 DFU Mode problems?

Post by ag123 »

the button dance normally is press both NRST & BOOT0, release NRST while holding BOOT0, after 1-2 seconds after reset release BOOT0.

normally in linux i'd use dfu-util -l and it'd list the dfu device.
note that in linux i've encountered situations that even that button dance didn't quite work that.
i used a utility usbreset
https://github.com/jkulesza/usbreset
which seem to cause it to enumerate.
i'm not too sure about the reasons, but it may possibly be electrical, e.g. that a a usb 'single ended zero' did not after all occur, which would signal to the host to enumerate
Post Reply

Return to “STM32F4 based boards”