Main Site Documentation

FezCerb40 DFU hardware design


#1

I recently bought a Fez cerb40 and had a question related to the hardware design of the board. In ST’s AN2606 bootloader appnote it says:

“If DFU (USB FS Device) is used to connect to the bootloader: the USART1_RX (PA10), USART3_RX (PC11 and PB11) and CAN2_RX (PB05) pins have to be kept at a high or low level and must not be left floating during the detection phase.”

Looking at the schematic of the cerb40 I noticed that both pins PA10 and PB05 are connected to VDD via pull up resistors to keep these pins from floating. I imagine this was done to keep these pins at a known state when not in use to allow for proper DFU functionality as per AN2606.

If that is indeed the case, how come the USART3_RX pin is not connected to VDD via pull up resistor as well ?


#2

They have internal pull-ups.
Welcome to the forum!


#3

Thanks architect for the welcome and the prompt reply!..The STM32F4 datasheets/manual seem to be somewhat unclear on this…do you know why these pins have internal pull-ups i.e. which peripheral or for what purpose e.t.c?

Thank you.

Halherta


#4

No problem. Internal pull-up/down resistors are available for all GPIO pins. You can enable/disable internal resistors in a similar way as you configure a pin to do a certain function - through a register.

When there is no requirement on a specific value of a resistor you can use internal one for that exact purpose - to give a pin a determined default state.


#5

Architect,
My understanding is that the DFU bootloader (system memory) takes control of the chip out of reset (when BOOT11 is VDD and BOOT0 is GND) and out of reset all GPIO pins are in input floating mode except for the JTAG pins…

If that is the case, the bootloader is activated before the user can configure the pull-ups in the user code…

Is it correct to assume so? This means that in order for the PB11 and PC11 pins to have internal pull-ups enabled, the built-in bootloader code has to enable them, not the user code.

Also if we could activate internal pull-ups on PA10 and PB05, why don’t we just do that instead of adding the two external pull-ups on the pins?

Thank you for your clarifications and patience.
halherta


#6

I see your point. I have to dig into the user guide to find exact answer, but certain pins have default function and state. May be the pin in question has that default function/state and it is not in fact floating.


#7

Indeed. In fact, the chip is booting from a whole different memory space (the manual calls it “system memory”).

Correct. The code in system memory comes factory programmed with the DFU bootloader. There’s no user code to be run.

You need external pullups, because it’s the bootloader that’s attempting to detect whether you’re connecting over the UART or USB. It does this by detecting the state of certain pins. If they happen to “float” to the wrong level during this detection process, the bootloader may pick the wrong connection type, and you won’t be able to connect to it.

This is, I would guess, the exact same thing that happens to some people who set their Panda II to COM debugging with the MOD pin, and fail to pull the COM2 pins to the correct levels. I’ve done it several times without issue, and you apparently have too. In our cases, it seems to be dumb luck :wink: