Burn Firmware

If your CERB40 comes from the preenFM kit or if you already installed the bootloader
This page is not for you go to Upgrade Firmware.

Once the PCB is fully assembled (internal USB to CERB40 connection required), and if your CERB40 is not already flashed you now have to flash the bootloader and the preenFM firmware to the STM32F4 microcontroller.

The firmware will be uploaded with dfu-util using the DFU microcode provided by ST directly on the microcontroller.

 

1. Windows

Download the last dfu-util binaries here http://dfu-util.sourceforge.net/ and extract the one for you OS. Under Windows look for « win32-mingw32″ and extract the 4 files (dfu-suffix.exe, dfu-util-static.exe, dfu-util.exe, libusb-1.0.dll).

Copy these 4 files in the firmware « build » folder. PreenFM2 firmwares are available from the download page.

 

Let’s put the microcontroller in DFU mode.

  1. Have you preenFM unpluged
  2. Shortcut the Jmp3 connection.
  3. Power up with the USB connector
  4. Nothing on the LCD is normal. The STM32F4 is in DFU mode.

Once the preenFM is in DFU mode. You should see some error message complaining about the « STM32 bootloader » driver not installed and a yellow exclamation mark in the device manager in front of « STM32 Bootloader ».

If you already installed the driver go to the bottom of this page to run the dfu-util commands.

 

Install WinUSB driverDriver

On the dfu-util page one can read :

« We offer binaries for Microsoft Windows and some other platforms. dfu-util uses libusb 1.0 to access your device, so on Windows you have to register the device with the WinUSB driver (alternatively libusb-win32 or libusbK if libusbx 1.0.13 or later), please see the libusbx wiki for more details. »

To register the device an easy way is to use : Zadig

Download Zadig for your OS. Run it.

 

Zadig

 

 

Click on Install driver. Then you should see this in your device manager :

DeviceManager

 

2. MacOS X

dfu-util is available from MacPort or brews.

MacPort : Install MacPort. With Macport install dfu-util and you’re ready to run the dfu-util command.

Breaws : run the installation command at the bootom of the brews home page… Then ‘brews install dfu-util’.

Boot microcontroller in DFU mode.

  1. Have you preenFM unpluged
  2. Shortcut the Jmp3 connection.
  3. Power up with the USB connector
  4. Nothing on the LCD is normal. The STM32F4 is in DFU mode.

Downlad the last PreenFM2 firmwares from the download page.

Then  goto 4 to run the commands.

3. Linux

Install dfu-util (apt-get install). Check version is at least 0.7. If not get the source and compile it.

Create a file /etc/udev/rules.d/46-cerb40.rules

with the following content :

   ATTRS{idProduct}=="df11", ATTRS{idVendor}=="0483", MODE="664", GROUP="plugdev" SYMLINK+="cerb40"

 

Boot microcontroller in DFU mode.

  1. Have you preenFM unpluged
  2. Shortcut the Jmp3 connection.
  3. Power up with the USB connector
  4. Nothing on the LCD is normal. The STM32F4 is in DFU mode.

Then  goto 4 to run the commands.

 

4. dfu-util commands : 

 

Flash the bootloader at the adress 0×8000000. (run install_bootloader.cmd from the firmware zip file)

> dfu-util -a0 -d 0×0483:0xdf11 -D p2_boot_1.00.bin -R -s 0×8000000

Flash the firmwareat the adress 0×8040000.  (run install_firmware.cmd from the firmware zip file)

> dfu-util -a0 -d 0×0483:0xdf11 -D pfm2_100.bin -R -s 0×8040000

 

If nothing works, check that dfu-util sees

>dfu-util -l

dfu-util 0.7

Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2012 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=0, name= »@Internal Flash /0×08000000/04*016Kg,01*064Kg,07*128Kg »
Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=1, name= »@Option Bytes /0x1FFFC000/01*016 e »
Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=2, name= »@OTP Memory /0x1FFF7800/01*512 e,01*016 e »
Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=3, name= »@Device Feature/0xFFFF0000/01*004 e »