With some basic technical knowledge, the Mini Gerbil 2’s firmware can be updated! Read on for full instructions and relevant links. This blog does not apply to the Mini Gerbil 3.
Step 1 – Preparations:
- Purchase an STM ST-Link V2 dongle from your favourite online marketplace. The look like this, the color of the unit and wires doesn’t matter
- Backup your $ settings. Simply type $$ in the console window and copy the results into a text document that you name and save in an appropriate place. Or use the Lightburn app (Machine settings, read, and save settings).
- Download the STM Link utility here.
- Download the Mini Gerbil firmware from Paul’s github page. Note: Ensure you save as plain text with a .hex or .bin extension (not as a .txt or HTML extension). The easiest way is to click on RAW, then right click Save As and edit the file ending to .hex Or, you can just download all files as a ZIP file and extract just the one you need, the .hex or .bin file.
- In preparation for programming, remove the power connections to the Mini Gerbil – you may even prefer to completely uninstall it.
- Completely remove the JP9 jumper from the position shown. Keep it – you’ll need it afterwards. The jumper isolates the line which allows reprogramming of the microcontroller, so it must be removed to allow programming.
Step 2. Wire up your ST LINK V2 dongle to the Mini Gerbil according to the following controller board to dongle connections:
- 3V3 -> 3.3 Pin 8 of the dongle
- IO -> SWDIO Pin 4 of the dongle
- CLK -> SWCLK Pin 2 of the dongle
- GND -> GND Pin 6 of the dongle
Beware that some dongles may have labelling errors and/or different pin assignments (seriously!). The error we have seen from some suppliers shows SWDIO and SWCLK labels swapped.
Insert the dongle into your PC USB.
Step 3. Install and run the STM LINK Utility software you downloaded in Step 1.
Step 4. Click on the third icon on the left – Connect to Target.
Once connected, load the relevant firmware file that you saved during Step 1, via the File/Open menu.
If the dongle does not connect that try to set the dongle settings via menu choice “Target>Settings”. The frequency can be lowered to 480kHz. Or try to swap the SWDIO and SWCLK leads (wrong labels on the dongle..).
Step 5. Flash the firmware by clicking the 6th icon (book/pencil icon) on the left. The firmware is being flashed.
Press start, and it just takes a moment. Then you’ll expect to see something like this:
Failing to flash can be caused by:
- swapped SWDIO/SWCLK connections (we had a few of those dongles with incorrect labels),
- loose Dupont connectors,
- you forgot to remove the JP9 jumper,
- (rarely) you might need to erase the existing flashed firmware first via the 5th icon on the left (eraser icon).
- incorrect dongle settings (use settings ‘connect under reset’, ‘hardware reset’, or incorrect frequency above 4MHz just lower it till it connects)
Step 6. Once you’ve succesfully flashed the new firmware, carefully reinstall jumper lead JP9 in original position to avoid memory erasure (see photo in Step 1).
Step 7. Check your controllers $ settings by comparing to the backup of $ settings that you took in Step 1. Read the release note to understand the implications of the relevant settings before deciding to revert or keep them changed.
Congratulations, your Mini Gerbil has its new firmware and you’re ready to try it out. Keep in mind that any misconfiguration or firmware bug could result in unpredictable behaviour, so observe safe practice when testing it out. Do not leave your laser unsupervised.