Firmware Update

From Medusa
Revision as of 14:40, 2 March 2023 by Acid (talk | contribs) (→‎Using medusa.inf or stmcdc.zip)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Firmware Update

  1. Download firmware from Medusa Firmwares Page. Firmware updater is a binary application that will update the firmware automatically. Binaries are available for Linux (64bit binary for Intel), Max OS X (Intel and ARM binaries) and Windows (32bit and 64bit binaries for Intel).
  2. Make sure that Medusa has been correctly detected by your operating system. Medusa uses standard "virtual serial port" (CDC) protocol on USB, so usually it should work without any drivers on Linux, Macos and Windows 10+. In case of Window 8.1 and older you need this file: medusa.inf (unsigned file specifically designed for Mesusa) or this file: stmcdc.zip (signed driver for all CDC devices with stm32 chips). See below how to use those files.
  3. Run the application. On the console you should see something like this (typically it takes less than 10 seconds):
$ ./firmware_updater_macosx_arm
firmware leng: 170328B
Found port: /dev/cu.usbmodemF2ECEB871
port: /dev/cu.usbmodemF2ECEB871 - main app
Sending fwupdater data
......................................
Sending fwupdater hmac
Found port: /dev/cu.usbmodemF2ECEB871
port: /dev/cu.usbmodemF2ECEB871 - updater
Sending main code data
...................................................................................................................................
Sending main code hmac
Sending fpga core data
........................................................................................................................................................................
Sending fpga core hmac

Using medusa.inf or stmcdc.zip

In case of Windows 10 and newer nothing needs to be done and any CDC device is automatically recognized, but in case of older Windows systems the user has to manually assign a driver (usbser.sys in this case) to a specific device (Medusa in this case). By default Medusa is shown in "device manager" as an "unrecognized device". To allow Windows to use usbser.sys you need to:

Option 1 - using unsigned medusa.inf file:

  1. go to "device manager" and find Medusa under "other devices";
  2. right click on it and pick "update driver software..." and then "browse my computer for driver software";
  3. click the "browse" button and select the catalog with the "medusa.inf" file that you downloaded from this page and then click the "next" button;
  4. you will see a red warning that the file you are going to use can be dangerous (because this inf file is not signed) - pick "install this driver software anyway".

Option 2 - using signed, universal stmcdc.zip file:

  1. unzip the "stmcdc.zip" file;
  2. go to "device manager" and find Medusa under "other devices";
  3. right click on it and pick "update driver software..." and then "browse my computer for driver software";
  4. pick the option "let me pick from a list of available drivers on my computer";
  5. if windows asks you to choose a device type - just click "next";
  6. in the next window click on "Have disk...";
  7. click the "browse" button and select 'stmcdc.inf' in the 'stmcdc' folder;
  8. click "ok" and then "next";
  9. Windows will inform you that this driver might not be good for the selected device (because it is a universal driver for all STM32 CDC devices - not specifically for Medusa, but it works perfectly ok) - press the "yes" button.

In both cases you should see a new COM port in your system. In case of using medusa.inf you will see "Medusa CDC serial port" and in case of using stmcdc.zip you will see "STMicroelectronics Virtual COM Port" - it doesn't matter. In both cases the medusa firmware update software should work without any problems.

To brick or not to brick

Firmware in Medusa is divided into two parts - a simple updater (let's call it part A) and the main program (call it part B).

Part A updates part B (plus FPGA core) and part B updates part A

The boot code in Medusa checks checksums of both parts. If both checksums are correct then it jumps to part B (or part A when the "right" button is pressed). If only one of them is correct then it jumps to this part directly. This design prevents device "bricking". Even if you loose power during Medusa firmware update, after you turn it back on it will just use the valid part of the firmware. You will only need to run the updater again to complete the procedure.