Difference between revisions of "Firmware Update"

From Medusa
(Created page with "== Firmware Update == # Download firmware from [http://medusasc.org/machina 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). # Make sure that Medusa has been correctly detected by your operating system. Medusa uses standard "virtual serial port" (CDC) protocol on USB, s...")
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Firmware Update ==
== Firmware Update ==


# Download firmware from [http://medusasc.org/machina 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).
# Download firmware from [//medusa-sc.org/firmware/ 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).
# 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 and Macos. In case of Windows the needed driver is usually installed, but if it is not, then install it. Description is [https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/usb-driver-installation-based-on-compatible-ids here]
# 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-sc.org/firmware/medusa.inf medusa.inf] (unsigned file specifically designed for Mesusa) or this file: [//medusa-sc.org/firmware/stmcdc.zip stmcdc.zip] (signed driver for all CDC devices with stm32 chips). See below how to use those files.
# Run the application. On the console you should see something like this (typically it takes less than 10 seconds):
# Run the application. On the console you should see something like this (typically it takes less than 10 seconds):
<pre>
<pre>
Line 21: Line 21:
Sending fpga core hmac
Sending fpga core hmac
</pre>
</pre>
== 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: ===
# go to "device manager" and find Medusa under "other devices";
# right click on it and pick "update driver software..." and then "browse my computer for driver software";
# 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;
# 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: ===
# unzip the "stmcdc.zip" file;
# go to "device manager" and find Medusa under "other devices";
# right click on it and pick "update driver software..." and then "browse my computer for driver software";
# pick the option "let me pick from a list of available drivers on my computer";
# if windows asks you to choose a device type - just click "next";
# in the next window click on "Have disk...";
# click the "browse" button and select 'stmcdc.inf' in the 'stmcdc' folder;
# click "ok" and then "next";
# 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 ==
== To brick or not to brick ==


Firmware in Medusa is divided into two parts - simple updater (let's call it part A) and the main program (call it part B).
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
Part A updates part B (plus FPGA core) and part B updates part A


Boot code in Medusa checks checksums for both parts. If both checksums are correct then it jumps to part B (or part A when "right" button is pressed). If only one of them is correct then it jumps to this part directly. This design prevents device "bricking". Even 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.
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.

Revision as of 14:40, 2 March 2023

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.