FW3A Firmware Flashing Guide

Hi everyone,

I'm new to BLF, but have been a lurker over at CPF for many years. I recently signed up here after purchasing an FW3A, and then subsequently a D4V2 too - needless to say I've rediscovered the flashlight bug!

Whilst my FW3A was in transit, I noticed posts about the muggle mode bug in the FW3A firmware and set about finding out how the firmware is flashed on the FW3A. I couldn't find one single source of information, so I decided to pull together a post in a similar fashion to Terry Oregon's post on how to upgrade the firmware on a D4V2.

All comments, feedback & constructive criticism welcome :)

Tools Required

This guide assumes you know how the various parts of the FW3A (or FW3C) flashlight, know how to solder, and have already de-soldered the positive and negative wires from the MCPCB and removed the driver board. If there is enough interest in a how-to for this, I may well add this into the guide.

On the side of the driver board without the spring, you will find an ATtiny85 AVR Microcontroller, located here on the board with the corresponding pin locations:

(Credit to fritz15 for the image)

The pins on the ATTiny85 are assigned as follows:

  1. RESET
  2. INP
  3. INP
  4. GROUND
  5. MOSI
  6. MISO
  7. SCK
  8. VCC (+)

Next, look at your USBASP Programmer. It will have a 10-pin connector, typically found on the top-right hand side of the board or mounted horizontally on the right-hand end of the board. The pin locations are typically as follows, however if in doubt check the markings on the top or bottom of the board, or the manual that came with your USBASP Programmer:

The pins on the USBASP Programmer are assigned as follows:

  1. MOSI
  2. VCC (+)
  3. GROUND
  4. NC
  5. RESET
  6. GROUND
  7. SCK
  8. GROUND
  9. MISO
  10. GROUND

Next, look at your SOIC Adapter. Depending on your model, you will either have bare pins at the top of the clip, cables going from the male pins to an 8-pin connector, or cables going from the male pins and male or female Dupont connectors on the end. On my adapter, these pins are labelled 1 through 8, with the cable connecting to 1 on both ends designated with a red colour.

You may need to use a multi meter to find out which pin is which if there are no markings. If you have one of the SOIC Adapters with bare pins on the top of the clip, these are mapped straight down to the bottom of the connector.

For flashing the FW3A (or FW3C) firmware, we are interested in the pins for MOSI, VCC (+), RESET, SCK, MISO and GROUND.

In order to make things simpler for myself, I’ve always stuck with the same pin/wire colour combination:

MOSI: Blue

VCC (+): Orange

RESET: Purple

SCK: Yellow

MISO: Green

GROUND: Grey

Next, using your Dupont wires, wire up the USBASP Programmer, SOIC Adapter and ATTiny85 microcontroller as follows:

This is all the wiring complete. Do not connect the SOIC connector to the ATtiny85 just yet.

Note: There is another fantastic guide to installing the USBASP Programmer driver and AVRDUDE written by Terry Oregon which covers many of the same steps I cover below but more in-depth, if you get stuck with my instructions you can find Terry’s guide here: https://budgetlightforum.com/t/-/57807

On your Windows machine, plug in the USBASP Programmer to a spare USB-A port, and then run Zadig from the folder you downloaded it to.

In the top menu, click Options and then select List All Devices. In the drop-down list, you should see USBasp. Select it.

You will see a window like this; however, you should see ‘None’ in the Driver field, and the ‘Reinstall Driver’ button should say ‘Install Driver’:

From the Driver field on the right, scroll down using the buttons until libusbK is selected, then click Install Driver.

The installation will take around a minute, after this has completed you can close Zadig.

Next, create the directory C:\AVRDUDE on your Windows machine, then launch the MHV AVR Tools installer from the folder you downloaded it to.

On the first screen of the Setup Wizard, click Next, and then click I Agree on the License Agreement page.

On the Choose Install Location page, click Browse…

Back on the Choose Install Location screen, click Next

On the Choose Components page, leave the defaults and click Next

The installer will now install MHV AVR Tools in C:\AVRDUDE. Once the installer completes, click Finish to close the installer.

Next, copy the FW3A firmware file from the folder you downloaded it to, to the C:\AVRDUDE\MHV AVR Tools\bin directory.

Open a Command Prompt as an Administrator (right-click on the Command Prompt icon, then select Run as administrator)

Change directory to C:\AVRDUDE\MHV AVR Tools\bin by using the command "cd 'C:\AVRDUDE\MHV AVR Tools\bin'" (without double quotes) and then hitting enter.

Now, connect the SOIC Adapter to the ATtiny85 microcontroller, ensuring that the adapter is in the correct orientation so that the pins are in the correct order.

Back in the Command Prompt Window, run the command "avrdude -p t85 -c usbasp -n" (without double quotes). If your wiring is correct and the SOIC adapter is connected correctly, you will see an output like the following:

C:\AVRDUDE\MHV AVR Tools\bin>avrdude -p t85 -c usbasp -n

avrdude: warning: cannot set sck period. please check for usbasp firmware update.

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e930b

avrdude: safemode: Fuses OK (H:FF, E:DE, L:E2)

avrdude done. Thank you.

If the above test passes, you are ready to flash your FW3A (or FW3C) with the latest firmware.

At the same Command Prompt you ran the previous test in, run the command "avrdude -p t85 -c usbasp -Uflash:w:anduril.2019-08-05.fw3a.hex" (without double quotes), replacing anduril.2019-08-05.fw3a.hex with the name of your firmware file.

You will then see an output like the following:

C:\AVRDUDE\MHV AVR Tools\bin>avrdude -p t85 -c usbasp -Uflash:w:anduril.2019-08-05.fw3a.hex

avrdude: warning: cannot set sck period. please check for usbasp firmware update.

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e930b

avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed

To disable this feature, specify the -D option.

avrdude: erasing chip

avrdude: warning: cannot set sck period. please check for usbasp firmware update.

avrdude: reading input file "anduril.2019-08-05.fw3a.hex"

avrdude: input file anduril.2019-08-05.fw3a.hex auto detected as Intel Hex

avrdude: writing flash (7760 bytes):

Writing | ################################################## | 100% 5.11s

avrdude: 7760 bytes of flash written

avrdude: verifying flash memory against anduril.2019-08-05.fw3a.hex:

avrdude: load data flash data from input file anduril.2019-08-05.fw3a.hex:

avrdude: input file anduril.2019-08-05.fw3a.hex auto detected as Intel Hex

avrdude: input file anduril.2019-08-05.fw3a.hex contains 7760 bytes

avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 4.18s

avrdude: verifying ...

avrdude: 7760 bytes of flash verified

avrdude: safemode: Fuses OK (H:FF, E:DE, L:E2)

avrdude done. Thank you.

You have now successfully flashed your FW3A (or FW3C)! You can now disconnect the SOIC Adapter from the ATtiny85 microcontroller and re-assemble your flashlight.

It is highly recommended to perform a factory reset on the flashlight following an update. You can do this by letting the flashlight settle to room temperature, then hold in the tail button whilst tightening the tail cap to connect power, whilst holding the tail button for around 3 seconds until the flashlight emits a bright flash. You can also perform a factory reset by doing 13 clicks from off.

I hope this has helped someone. If you run into any issues feel free to reply and I'll do my best to troubleshoot with you.

Thanks,

crgbt

1 Thank

Thanks a lot for this useful thread, now I don’t have a reason to not flashing the latest anduril build in my FW3’S

:arrow_right: :beer:

Thank you for this. I’m definitely gonna attempt to flash mine!

Thanks SB

There is no muggle mode bug in the FW3A. That bug was specific to the D4V2.

Ordered all the equipment from AliExpress. Soon I’ll wreck my FW3A.

Posted this in another thread but thought it might fit better here:

I built my own ISP programmer because I didn’t have one at hand and couldn’t wait a month or two for it to arrive. I’ve used a NodeMCU (ESP8266 development board) as an ISP programmer that would wirelessly program the attiny85 using avrdude network upload.
Thought it might be useful for somebody else as well, so here’s how I did it:
You need: A NodeMCU (or any other ESP8266 dev board), 6 thin wires, a soldering iron and a disassembled flashlight so you have access to the microcontroller.
Please note that this method is potentially destructive as you’ll be soldering wires directly to the ATTINY85 while it’s on its PCB so I’m assuming you have decent soldering skills, are familiar with Arduino and have no other options :smiley:

  • In Arduino IDE, open Examples > ESP8266AVRISP (assuming you installed ESP8266 Arduino core)
  • Change the WiFi credentials in the code to fit your WiFi network credentials
  • Connect your NodeMCU to your computer via USB and upload the Arduino sketch to it
  • Open Serial Monitor in arduino to check if it’s connected to WiFi and to see the IP address and the port of the device.
  • Disconnect NodeMCU from your computer
  • Solder the following NodeMCU pins to the ATTINY85 pins in FW3A/FW4A/FW1A/etc:
ATTiny85 NodeMCU (ESP8266)
1 - RESET D1 (GPIO5)
4 - GND GND
5 - MOSI D7 (GPIO13)
6 - MISO D6 (GPIO12)
7 - SCK D5 (GPIO14)
8 - VCC 3v3
  • Connect NodeMCU (with the attiny85 wired to it) to power (and maybe check if the IP address has changed)
  • Open terminal (MacOS) and run the following command to check if you’ve wired everything correctly:
    ./Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C /Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -c arduino -p t85 -n -P net:YOUR_NODEMCU_IP:YOUR_NODEMCU_PORT
  • You should see the attiny85 identified in your terminal
  • Now download the firmware .hex file that you want to use
  • Use the following command to upload the firmware:
    ./Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C /Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -c arduino -p t85 -P net:YOUR_NODEMCU_IP:YOUR_NODEMCU_PORT -Uflash:w:/PATH/TO/YOUR/ANDURILFIRMWARE.hex
  • Now carefully desolder the wires from attiny85 and make sure that there’s no solder shorting any two pins on it.
  • Assemble your flashlight and you’re done!

If you’re on PC, you’re going to have to change the paths, but it shouldn’t be too much of a hassle.
I’m also here if anybody who tries this needs some help.
Cheers!

Just a quick question - does the newer firmware get rid of the ‘flashes’ while ramping? I seem to get 2 tiny flashes when ramping up, and 1 tiny flash when ramping down (FW3C).
Thanks for the guide, it is well explained and set out :+1:

I believe the blinks are intentional if I am thinking of the same thing you are seeing.
I think this is correct. Maybe someone can verify or point out my error.

Starting from the lowest setting and ramping up, there is a blink when the firmware powers up to and through the level provided by the first 7135. Then another 2 blinks at the high end when all the 7135’s are implemented and the firmware switches to direct drive turbo. The blinks are also seen at the same points as one ramps back down.

Yup, that is correct. According to ToyKeeper, even if she removed the blinks, it would be visible because of small differences in regulators so it’s best to keep it.

I thought that I was the only one who experienced the ‘blinks’ while ramping up/ down. So, I guess this is normal. Thanks for sharing.

Am I right in thinking this same method can be used to flash Anduril 2 to the original BLF Q8? (Programmer on order)

USBasp programmer and IC clip arrived today. Followed instructions above to program spare Q8 driver with Anduril 2 Q8 Hex firmware file - worked a treat. Then proceeded to flash my Q8 - worked first time. Many thank for the excellent firmware and for the excellent guide.