I know many of you would prefer the D4 with Anduril and Lexels AWESOME Aux Boards controlled by Anduril. So far people seem to either hard-wire the Aux boards to battery or flash the D4s Variant of Anduril/Ramping OS. While this seems to work it’s not perfect, as the D4s is different in driver components and thermal mass, which is reflected in its firmware.
I have never edited or compiled firmware before. It’s actually rather straight forward, but I did struggle a lot in the process because you have to skim info from many different threads and places. So here is my guide which hopefully makes the process easier for others.
1 Editing the files for the D4 to enable Aux support
This is done to tell the software that the light has a board with aux LEDs. Without that step, the Aux Pad next to the switch will not work!
1.1 Add those lines to the D4 hwdef file:
1.2 Add those lines to the D4 cfg file:
This is also a good time to adjust Anduril to your preferences. You can easily comment out additional flashing modes etc. I for instance removed bike, party and tactical modes.
2.1 Download and install Atmel Studio 7
2.2 Create a new Project “Anduril_d4aux” (Executable Project)
2.3 Paste the required files into the directory which Atmel Studio just created for your project. This is important and the main reason why I failed before.
these are located in:
Important: hwdef and cfg need to be replaced with the ones you just edited before!
2.4 Replace the code in the active Atmel Studio window for “main.c” with the code for Anduril, which you take from anduril.c
2.5 add the line to define Attiny85 to main.c (which is now anduril c)
2.6 compile the code buy selecting “Build Anduril” from the menu
2.7 if you did everything right you will get no errors. Several new files are created in the working dir, one of them is anduril_d4aux.hex
3.0 connect everything to the ATTINY85
3.1 get the drivers from https://protostack.com.au/shop/accessories/usbasp-avr-programmer/
3.2 get AVRDude
3.3 To test your connection! make a backup using AVRDude by running: avrdude.exe -p attiny85 -c usbasp -U eeprom:r:backup.hex:a
3.4 To finally flash run this command (the hex should be in the avrdude directory): avrdude.exe -p attiny85 -c usbasp -Uflash:w:anduril_d4aux.hex:a
4 The Aux Board needs to be soldered to the Aux Pad (the empty pad next to the switch pad) and ground (the big pad at the AMC for example).
good luck and have fun!