FW3A Firmware Flashing Guide

12 posts / 0 new
Last post
crgbt
Offline
Last seen: 1 month 3 weeks ago
Joined: 07/28/2019 - 15:53
Posts: 1
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 Smile

 

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: http://budgetlightforum.com/node/68263

 

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

Edited by: crgbt on 08/09/2019 - 16:38
Anthon
Offline
Last seen: 3 weeks 2 days ago
Joined: 09/07/2015 - 10:33
Posts: 666

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

Nicolicous
Nicolicous's picture
Offline
Last seen: 2 months 3 weeks ago
Joined: 04/16/2016 - 08:28
Posts: 1604
Location: Australia
:ARROW-RIGHT: Beer

Nico -.-

KevinZA1988
KevinZA1988's picture
Offline
Last seen: 2 weeks 3 days ago
Joined: 02/26/2018 - 02:26
Posts: 798
Location: South Africa

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

Armytek Prime C1 Pro, Armytek Prime C2 Pro, Armytek Tiara C1 Pro, Astrolux MF01 Mini, BLF Q8, BLF A6, BLF FW1A, BLF FW3A, BLF FW3C, BLF LT1, Convoy L6, Convoy C8+ , Convoy S3, Emisar D4, Fireflies E07, Jaxman E2L, Manker MC13, Manta Ray C8.2 long version, Olight S1R Baton II special edition series, S2R Baton II.

Most of them have been modded! =)

https://photos.app.goo.gl/JaJaDv4V838AEJf39

chops728
Offline
Last seen: 6 hours 46 min ago
Joined: 08/30/2014 - 16:00
Posts: 1156
Location: Swampland,La

Thanks SB

SammysHP
SammysHP's picture
Offline
Last seen: 31 min 8 sec ago
Joined: 06/25/2019 - 14:35
Posts: 784
Location: Germany
Quote:
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.

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

KevinZA1988
KevinZA1988's picture
Offline
Last seen: 2 weeks 3 days ago
Joined: 02/26/2018 - 02:26
Posts: 798
Location: South Africa

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

Armytek Prime C1 Pro, Armytek Prime C2 Pro, Armytek Tiara C1 Pro, Astrolux MF01 Mini, BLF Q8, BLF A6, BLF FW1A, BLF FW3A, BLF FW3C, BLF LT1, Convoy L6, Convoy C8+ , Convoy S3, Emisar D4, Fireflies E07, Jaxman E2L, Manker MC13, Manta Ray C8.2 long version, Olight S1R Baton II special edition series, S2R Baton II.

Most of them have been modded! =)

https://photos.app.goo.gl/JaJaDv4V838AEJf39

eskimo
Offline
Last seen: 1 month 3 weeks ago
Joined: 01/16/2021 - 06:46
Posts: 3
Location: Bosnia & Herzegovina

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 Big Smile

  • 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!

G0OSE
G0OSE's picture
Offline
Last seen: 18 min 16 sec ago
Joined: 09/03/2014 - 12:34
Posts: 2191
Location: UK SW

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 Thumbs Up

MtnDon
MtnDon's picture
Offline
Last seen: 7 hours 36 min ago
Joined: 08/27/2015 - 18:25
Posts: 3547
Location: Canuk in NM

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.

eskimo
Offline
Last seen: 1 month 3 weeks ago
Joined: 01/16/2021 - 06:46
Posts: 3
Location: Bosnia & Herzegovina

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.

amtaham
amtaham's picture
Online
Last seen: 9 min 50 sec ago
Joined: 04/09/2020 - 04:17
Posts: 81
Location: Indonesia

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.

“Come again, please, come again, Whoever you are. Religious, infidel, heretic or pagan. Even if you promised a hundred times, And, a hundred times you broke your promise, This door is not the door of hopelessness and frustration. This door is open for everybody. Come, come as you are.” ~ Mawlana Jalaludin Rumi