Need step-by-step guide for idiots on how to flash Emisar D4 with Anduril

You will have to set them up like in Hoops photo

the colors don’t matter as long as they are the same on both ends. My colors don’t match Hoops but they work.

I used that photo for the Attiny85 so I think they are all the same.

Do you have a link to Hoops photo?

This is what I used to hook mine up. Post 2.

There are no pictures in Post 2. Do you mean this picture from Post 1? I understand that was for the ATiny13a. So the same wiring works for the ATiny85?

Yes. 13A, 25/45, 85, they’re all the same pinout.

I marked my clip with a dot of paint, that way I know that side goes on the side of the MCU with pin 1-4 and don’t have to figure it out by tracing wires every time I want to use it.

Yeah, sorry beer. Thats the photo I used.

Thanks.

Good Idea on marking them. I have hooked my upside down several times. If its wrong the light on the programmer goes off.

Wire 5 goes on the dot.

Drat.

Installing the USBasp driver doesn’t allow AVRdude run. And unfortunately, I waited too long to system restore and no longer have a restore point from before Windows blocked AVRdude.

Currently, when I type “AVRdude” from the command prompt I immediately get “does not have permission” and a pop up window saying the app will not run on my computer (even though I have the latest version of AVRdude installed). I even get the same result even after uninstalling AVRdude if I go to the command prompt and type “AVRdude”.

I haven’t found any way to bypass this apparent “feature” of Windows and allow AVRdude to actually run.

However, I did download AVRdudess and at least it launched when I tried running the app.

Unfortunately, I have no idea how to use AVRdudess. I can’t just cut and paste from Zeroflow’s guide into a command line since its a graphical windows interface with tons of options to fill in.: “avrdude.exe -p attiny85 -c usbasp -Uflash:w:anduril.YYYY-MM-DD.EMISAR_D4S.hex:a”

Hey guys, I think I can help here. This guide should work for anyone using Windows10.

Step 1: get your appropriate driver from: Index of /torches/fsm , rename it something easy like D4S.hex (or what ever your light is)

Step 2: get WinAVR from: https://sourceforge.net/projects/winavr/ , install it to the root of your C: drive. Take your hex file from the previous step and copy it into the WinAVR folder
that has now been installed on your C: drive.

Step 3: get Zadig from: https://zadig.akeo.ie/ , don’t worry, it’s a safe program, and quite handy.

Step 4: plug your USBasp in

Step 5: run the zadig.exe file, in the window that opens, click the “Options” menu and click “List all devices”. In the dropdown menu, USBasp should appear, if it doesn’t, select it. (if it
isn’t there, check all your connections).

Step 6: what ever the driver listed is, select “libusbK” from the menu to the right of the green arrow, and click the “Replace Driver” button. Congratulations, you have now circumvented
98% of Microsoft’s bullshit.

Step 7: use the connection guide from earlier in the thread or here: AVR Drivers - Flashlight Wiki , make your connections to your solder pads or clip, which ever you are using.

Step 8: open a command prompt (click start menu, type “cmd”, enter) and type “cd \” enter. (do not type the quotation marks). Now type “cd WinAVR” and press Tab, the rest of the
name of the folder will fill in, then press enter. Your command prompt should now show “C:\WinAVR-20100110>”

Step 9: hook everything up and test your connection by typing the following: avrdude -p t85 -c usbasp -n , if your connections are successful, you will get a message that says “device
initialized and ready to accept instructions” along with a progress bar and some other stuff. Ignore the warning about not being able to set sck period.

Step 10: assuming you are successful up to this point, you are almost done! Now enter in your command prompt: avrdude -p t85 -c usbasp -u -Uflash:w:FILENAME.HEX:a ,
and obviously replace “FILENAME.HEX” with the name of your file that you saved. The flash should begin immediately and take no more than 10-12 seconds. You will see
two progress bars, one writing and one verifying. Once it’s finished…

Step 11: bask in the glory of your new firmware. Or fume at your lack of success, in which case post back here and I will try to help you!

Edit: I do not know how to format on forums :frowning:

Excellent guide, very short i clear, i have successfully flashed my D4. Thank you!
Also, there are so many hex file in the link in step 1, do you know where can i get some description for each file?

They are mostly sorted by date I believe. I just scroll to the bottom and get the most recent one for my light. The one with lower muggle ceiling has just that: a lower max for muggle mode making it safer to give to kids and such.

Yes, when sorted alphabetically, they also end up sorted by date. But it’s generally a good idea to click the “Last Modified” column to actually sort by date, just in case there’s something which doesn’t follow the naming convention.

http://toykeeper.net/torches/fsm/?C=M;O=D

This guide was really helpful for flashing my D4S.

Is there something similar for flashing the FW3A? I’d like to put in the latest “fancy (2-level) lockout momentary moon.”

The process is identical, save for using a clip on the chip instead of the PCB pads. And of course, the proper firmware

FW3A also uses an ATiny85… the same MCU in the D4 v1.

The guide in this thread for the D4 should work perfectly for flashing the FW3A. Only difference is getting to the MCU is a bit easier since the driver is held in via retaining ring rather than glue.

i used the instructions at the top of the page to update mine today to Anduril so much nicer being able to do the lockout on 4 clicks instead of 6

Anyone else have trouble getting their D4S to flash using the dupont cable method? I flashed mine a while back to Anduril and had trouble getting it to flash but eventually got it to work. Then with Anduril2 being a thing I wanted to update it to that but can’t get it to work on avrdude via a mac or using the new android app method. I got the test command to show 100% success 1 time so I quickly ran the full flash command and it failed and the light is now not functioning at all and I cant get the cables to make proper connection long enough to do anything. Is it possible to “wollow” out the pinholes and render them unusable?

To flash my D4S I used a fine diamond file to make the points on the dupont cables thinner and with a shallower angle. It didn’t take that much on each one and now they’ll wedge nicely in the holes. I’ve kept the 6 together to use solely for the D4S, which I’ve flashed a couple of times now.

I tried sharpening mine and still can’t successfully flash mine. I get close to success but always end up with this when it does actually try to flash

avrdude: error: usbasp_transmit: Input/output error
avrdude: error: wrong responds size
avrdude: error: usbasp_transmit: Input/output error
avrdude: error: wrong responds size
Writing | ################################################## | 100% 5.94s

avrdude: 7864 bytes of flash written
avrdude: verifying flash memory against anduril.2020-09-27.emisar-d4s.hex:
avrdude: load data flash data from input file anduril.2020-09-27.emisar-d4s.hex:
avrdude: input file anduril.2020-09-27.emisar-d4s.hex auto detected as Intel Hex
avrdude: input file anduril.2020-09-27.emisar-d4s.hex contains 7864 bytes
avrdude: reading on-chip flash data:

Reading | | 0% 0.00savrdude: error: usbasp_transmit: Input/output error
avrdude: error: usbasp_transmit: Input/output error
avrdude: error: wrong reading bytes ffffffff
avrdude: error: usbasp_transmit: Input/output error
avrdude: error: wrong responds size
avr_read(): error reading address 0x0000
read operation not supported for memory “flash”
avrdude: failed to read all of flash memory, rc=–2
avrdude: error: usbasp_transmit: Input/output error

avrdude done. Thank you.

The whole time its “writing” its constantly spamming
avrdude: error: usbasp_transmit: Input/output error
avrdude: error: wrong responds size

Any ideas?