Upgrade firmware (Flash bootloader) - Ixox/preenfm3 GitHub Wiki

Firmware and pfm3 bootloader binaries can be downloaded from the Release section in the github repo.

If you already have a working preenfm3 (all PCBs that i ship are already flashed), you only need to Flash the pfm3 firmware.

Flashing the pfm3 bootloader only needs to be done once. In case your firmware has been erased for any reason, follow "Flash the pfm3 bootloader".

A preenfm3 cannot be bricked. So no stress about that ;)

Flash the pfm3 firmware

If your preenfm3 already has a firmware (PCBs are shipped already flashed from me), then upgrading to newer (older) version is easy.

  • Remove the SD card and copy the new firmware on it in the root folder (in '/' and NOT in /pfm3/). (This can be done from the bootloader without removing the SD card).

  • Press the Menu Key (key 7), while switching on the preenfm.

  • you should be now in the pfm3 bootloader mode

  • Select the firmware you want to flash with the + and - Key.

  • Flash by pressing button 1.

  • Reboot

Flash the pfm3 bootloader (should not be usefull in 99% of the cases)

Flash on Windows

You must first have your preenfm3 in DFU mode. To do so, follow the 3 steps bellow:

  1. Unplug the preenfm
  2. Connect the boot0 pins with vcc on back side of the main PCB.
  3. Plug the preenfm with a USB cable.

WebDfu

The easiest solution is to go to this URL with Google Chrome (does now work with other browsers):
https://devanlai.github.io/webdfu/dfu-util/

  • Click then Connect button and select "DFU in FS Mode"
  • Then select the first interface of the list: "DFU: cfg=1, intf=0, alt=0, name="@Internal Flash /0x08000000/16*128Kg""
  • Keep default values and go to "Firmware Download".
  • Click "Chose file" and select your "p3_boot_1_XX.bin" bootloader file from your computer.
  • Click Download

Reconnect the Boot0 to GND and turning off and back on your preenfm.

DfuSe

An other solution is to download DfuSe from STMicroelectronics. It requires its own driver that are very difficult to remove. So try this only if the first solution does not work. Follow the installation step..

If you don't see STM device in DFU mode in the top left corner, it means you have a problem with the STM driver. Try to reinstall them, drivers can be found in the DfuSe install folder.

Once you see the "STM device in DFU mode" in the top left corner, go in the "Upgrade or Verify Action" click on Chose, select the pfm3_VERSION.dfu that you cand find here. And click on Upgrade. The pfm3_VERSION.dfu contains both pfm3 bootloader and pfm3 firmware and both will be flashed at their correct address.

Reconnect the Boot0 to GND and turning off and back on your preenfm.

Last solution

Run the commands from a Windows terminal as described in "Mac and Linux" section just bellow.

Flash on MacOs or Linux

On those platforms you'll have to use "dfu-util".

On linux create a new file /etc/udev/rules.d/46-stm32.rules and add this content :

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

First follow steps 1,2,3 above to enter bootloader mode.

Then flash the bootloader at the adress 0×8000000. (run install_bootloader.cmd from the firmware zip file or from the current folder)

dfu-util -a0 -d 0×0483:0xdf11 -D p3_boot_1.01.bin -s 0x8000000

Flash the firmware at the adress 0×8020000. (run install_firmware.cmd from the firmware zip file)

dfu-util -a0 -d 0×0483:0xdf11 -D p3_0.3.bin -s 0x8020000