DFU and Boot Problem, Custom Board #11444
Unanswered
thestumbler
asked this question in
STM32 / Pyboard
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I built a very simple STM32 board using an F405 processor. I have two serial ports and an SWD connector. I also have a USB connected, connected just like the PyBoard but without the OTG circuitry. The main use of this board is with a C/C++ program, but I intentionally made it this way so I could experiment with MicroPython.
I cannot for the life of me get DFU working. I can connect in boot loader mode over the UART, and using an STLINK v3 device, no problems. Using these methods, usually STLink because it's faster, I can program the board with C/C++ programs from a makefile + STLink utils, and also using Keil. But I have never seen the DFU operating.
I was worried I had made a mistake with the USB connections, but I can build MP and it works just fine. The REPL appears over the UART and the USB virtual serial port.
But once MP is loaded onto the chip, something goes wrong with the boot loading process. I cannot connect anymore over STLink. DFU still doesn't work. The only way to remove MP (to return to C programming) is to use the UART boot loader, and then mass erase the chip. Then SWD works again and I'm back to "normal", albeit still without DFU. This at least shows me the USB connections aren't completely wrong, but I'm still nervous because I don't understand what's going on.
I have convinced myself that none of the other STM32F4 boot loader pins are toggling when reset is released (and BOOT0 asserted), although I'm a bit nervous about the VBUS detect pin which is also a boot loader serial port source.
The oscillator may be the problem. I don't see it starting up when I try to enter DFU mode. It isn't clear to me whether the boot loader just hasn't started the oscillator because it's not attempting to use DFU, or whether it fails DFU operation because the oscillator won't start.
Question -- what could I be doing wrong in the hardware or the MP configuration that would keep DFU and SWD from working when MP is loaded?
EDIT: one more clue. Once the board is programmed with MP, rebooting with BOOT0 active seems to have no effect. It appears to just boot up into MP as normal (see below). I've confirmed the reset and BOOT0 pins indeed work.
It doesn't entirely skip the boot loader mode, however. If I'm quick, I can grab the UART boot loader after BOOT0 reset, with one interesting restriction -- I can only grab it with the STM32CubeProgrammer. Using st32flash doesn't work (although it does work if the chip is blank or programmed with something other than MP)
Beta Was this translation helpful? Give feedback.
All reactions