DFU

From krtkl wiki
Revision as of 19:30, 12 February 2021 by Jasonnet (talk | contribs) (→‎Which pads to short?)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Device Firmware Upgrade

To upgrade the firmware of the STM32 microcontroller on your Snickerdoodle, please consult

Additionally, we'll provide a few tips here.



Which pads to short?

It is highly recommended that one use the chorded button approach, rather than the R55 resistor shorting approach, to boot a Snickerdoodle in to DFU mode. But if one finds ones self in a situation where shorting the R55 resistor is the only option, it might not be clear exactly which two pads to short with a small screwdriver or breadboard jumper wire. The following images indicate where the R55 pads can be found on recent Snickerdoodle boards.

R55 on Rev 4.x board
R55 on Rev 3.x board (zoom to see orange arrows)

The update seems to be hung or very slow

Normally the DFU SE Demo application updates the microcontroller firmware in five seconds. But on very rare occasions, we've seen the update take over two hours and have seen evidence that it sometimes could take over four hours. In fact the update can run so slowly that it might not appear to do anything for 12 minutes or more, consuming almost no CPU cycles, leading one to think it is hung when it is not.

If this occurs, do not try to terminate the program, do no disconnect your Snickerdoodle, and do not let your laptop go to sleep. The reason for this is that if the update process ends prematurely, the Snickerdoodle is very likely to be left in very difficult state.

To avoid letting your laptop go in to sleep mode, try to plug it in to power and adjust its power settings to prevent it from entering sleep mode. And then be very patient.

TODO: add suggestions here for what to do if one does put the Snickerdoodle in a bad state.

NB: There is a hypothesis that this slowness only occurs on Lenovo laptops and can be avoided by using a USB hub rather than a direct connection to these laptops. If you experience the problem, please share your experience on the krtkl.com community forum. (TODO: create a link to a thread for this purpose.)

No LED's in DFU mode

The LED pattern seen when booting in to DFU mode varies depending on the version of the firmware booted. Some of the earliest firmware versions do not light the LED's at all.

How long to hold down the two buttons?

Various pages suggest that you hold down the Reset button and the Select button together when booting to enter DFU mode. This works for nearly all versions of the firmware, but some pages suggest that this be done for three seconds, others say four or more seconds. This might lead to some confusion.

If your Snickerdoodle is connected to a Win10 machine, you should be able to release those buttons as soon the Windows 10 machine emits the sound that indicates that a USB device has just been plugged in. For most versions of the firmware, that will also be when you see the LED's on the Snickerdoodle flash.

Win10 DfuSeDemo can not find the Snickerdoodle

If you follow the steps in the Firmware User Guide, yet the DfuSeDemo window does not seem to find the Snickerdoodle STM32, you probably need to take some additional steps.

STM32 BOOTLOADER in DeviceManager

First open up Window's Device Manager. You should see the "Other Devices : STMicroelectronics Virtual COM port (COMxxxx)" or "Universal Serial Bus controllers : STM Device in DFU Mode" device active. If you instead see "STM32 BOOTLOADER" or even "STM32 BOOTLOADER" with a caution symbol, you might not have proper device drivers installed on Windows.

The documentation for the DFU package indicates that one needs to install the proper device driver after doing the initial install.

Assuming that you have installed DfuSe, you probably have a DfuSe installation directory at a location like "C:\Program Files (x86)\STMicroelectronics\Software\DfuSe v3.0.6" , and the directory tree below it probably contains the device driver you need as well as a .exe file to help you install the driver.

To find that .exe look in the Bin/Driver directory below the installation directory you found above. Here you should see some directory names like "Win7", "Win8", "Win8.1", and "Win10". Double click on the appropriate one for your installation of Windows.

In this subdirectory you should see two .exe files that should help with the installation of the device driver. One (ex. "dspinst_amd64.exe") installs the 64 bit driver whereas the other (ex. "dpinst_x86.exe") installs the 32 bit driver. Invoke the appropriate one. It should lead you through the device driver installation process.

After completing this, restart DfeSEDemo.