starryalley / Anduril2

my Anduril2 fork that provides much more features
GNU General Public License v3.0
45 stars 2 forks source link

Exceeds memory limit #3

Closed flashquark closed 1 year ago

flashquark commented 1 year ago

Whenever I try to compile your fork, it says that "GccApplication4.elf section .text' will not fit in regiontext'" and that it overflowed by 1534 bytes. By any chance do you remove anything before you compile your hex files, or is there something that might be causing something extra to compile on my side? ToyKeeper's original code compiles just fine for me.

starryalley commented 1 year ago

Hi @flashquark I added many things to the codebase and I only have D4v2, SP10 pro and TS10 where there are still plenty of spaces available. Not sure what target you are building but yes that error can happen for other lights. But if you are building for D4v2 (single or dual channel), sp10 pro, ts10, then that error should not happen.

I use Mac and Ubuntu to build the hex.

To reduce space, the quickest way is to disable some unused strobe modes in config-default.h

#define USE_BIKE_FLASHER_MODE
#define USE_PARTY_STROBE_MODE
#define USE_TACTICAL_STROBE_MODE
#define USE_LIGHTNING_MODE
#define USE_CANDLE_MODE
#define USE_FIREWORK_MODE

or in each light's config.

flashquark commented 1 year ago

I’m building for a dual channel DT8 which interestingly from 15 clicks, shows that it uses the same hex as the D4SV2 tint ramp without fet. (That’s interesting as I would have assumed that it would have used the fet version since my DT8 doesn’t have E21 but rather, has Osram W2 and LH351D emitters that should be able to withstand fet.)

In any case, I did manage to get it compiled by disabling unused strobes like you suggested. I am building on Windows, so perhaps there are some slight differences with the libraries and what gets included during compile time. Other than disabling the unused strobes, I also had to change the pseudorand function that you used for start up modes into rand instead.

Thanks for the help!

starryalley commented 1 year ago

It's weird to have different build under Windows. I have no idea about the toolchain in Windows though. Glad that you resolved it.