Help compiling custom Anduril 2 for FW3A 1+7+FET driver with AUX

I’m trying to repeat the FW3A 1+7+FET AUX mod (here), but using Anduril 2 instead of Anduril 1.

I looked at the A1 changes described here and applied them to the latest /lumintop/fw3a A2 configuration (in a fork of @ToyKeeper 's repository).

Changes made were similar to those made for a lume1 single AUX configuration, as described here, but with a different starting point – e.g., just adding the various configuration for USE_INDICATOR_LED and using the hardware definitions for the 1+7+FET driver.

Now, when compiling, I get the following error:

/usr/lib/gcc/avr/5.4.0/../../../avr/bin/ld: ui/anduril/anduril.elf section `.text' will not fit in region `text'
/usr/lib/gcc/avr/5.4.0/../../../avr/bin/ld: region `text' overflowed by 546 bytes

I assume this means that the hex would be too large for the MCU.

I had noticed that there were already a few features turned off in the basic FW3A Anduril2 configuration, indicating a shortage of space:

// too big, turn off extra features
#undef USE_TACTICAL_MODE
#undef USE_SOS_MODE

so I turned off more features:

#undef USE_TACTICAL_MODE
#undef USE_SOS_MODE
#undef USE_BEACON_MODE
#undef USE_RAMP_AFTER_MOON_CONFIG
#undef USE_RAMP_SPEED_CONFIG
#undef USE_2C_STYLE_CONFIG
#undef USE_TACTICAL_STROBE_MODE
#undef USE_MOMENTARY_MODE

The result is still an error:

/usr/lib/gcc/avr/5.4.0/../../../avr/bin/ld: ui/anduril/anduril.elf section `.text' will not fit in region `text'
/usr/lib/gcc/avr/5.4.0/../../../avr/bin/ld: region `text' overflowed by 212 bytes

At least the overflow is now only 212 bytes, instead of 546 bytes. However, I don’t know what other features I could turn off now to make it fit.

Can anyone help?
Am I on the right track assuming the build is too large, or does the error indicate something else?
Will it even be possible to add AUX handling to an Anduril 2 build for the 1+7+FET, or am I trying to do something that anyhow won’t work due to the old MCU? Has anyone else achieved this?

Any ideas would be much appreciated.

1 Thank

I remove Simple UI to make room for Anduril2 with Aux.

In the anduril.h:
#undef USE_SIMPLE_UI

Ah, I didn’t think of removing simple UI.
My mind just assumed that simple UI is necessary, but now you mention it, of course it isn’t.
I’ll try that.

1 Thank

Disabling individual config menu items usually don’t save much. The whole config menu itself takes quite a bit. Another good candidate is sunset mode.

1 Thank

I did some more investigation.

I looked in config-default.h and picked out a bunch of different USE_* configuration switches. I put these all into my custom anduril.h and then switched them all on and off individually to see which ones contribute the most to the build size. There are the results of the ones I tried, largest first:

Feature flag Contribution to build size (Bytes) Notes
USE_SUNSET_TIMER 494
USE_CANDLE_MODE 476
USE_TACTICAL_MODE 298
USE_MOMENTARY_MODE 244 Can only be deactivated if Tactical Mode also deactivated
USE_MANUAL_MEMORY 200
USE_SIMPLE_UI 198
USE_LIGHTNING_MODE 168
USE_BEACON_MODE 128
USE_SOS_MODE 112
USE_BIKE_FLASHER_MODE 112
USE_2C_STYLE_CONFIG 66
USE_MANUAL_MEMORY_TIMER 50
USE_PARTY_STROBE_MODE 42
USE_CHANNEL_PER_STROBE 38
USE_TACTICAL_STROBE_MODE 26
USE_RAMP_SPEED_CONFIG 22
USE_RAMP_AFTER_MOON_CONFIG 20
USE_POLICE_STROBE_MODE 0 No effect as testing only with single channel AUX configuration

In my case, with none of these deactivated the build was 1132 bytes too big for a 1+7+FET driver with a single AUX channel. So based on that, and my own preferences, I chose to deactivate the following:

//#undef USE_SIMPLE_UI
#undef USE_SUNSET_TIMER
//#undef USE_BEACON_MODE
//#undef USE_SOS_MODE
//#undef USE_BIKE_FLASHER_MODE
#undef USE_PARTY_STROBE_MODE
#undef USE_TACTICAL_STROBE_MODE
#undef USE_POLICE_STROBE_MODE
//#undef USE_LIGHTNING_MODE
//#undef USE_CANDLE_MODE
#undef USE_CHANNEL_PER_STROBE
#undef USE_MOMENTARY_MODE
#undef USE_TACTICAL_MODE
//#undef USE_MANUAL_MEMORY
//#undef USE_MANUAL_MEMORY_TIMER
//#undef USE_RAMP_SPEED_CONFIG
//#undef USE_RAMP_AFTER_MOON_CONFIG
//#undef USE_2C_STYLE_CONFIG

This way, I could keep Simple UI.

1 Thank