Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12.7kB more code with 5.12.0j #2400

Closed
2 of 4 tasks
0n3-70uch opened this issue Apr 9, 2018 · 11 comments
Closed
2 of 4 tasks

12.7kB more code with 5.12.0j #2400

0n3-70uch opened this issue Apr 9, 2018 · 11 comments

Comments

@0n3-70uch
Copy link

0n3-70uch commented Apr 9, 2018

Hello, I compiled the version 5.12.0i and 5.12.0j. But the version 5.12.0j use 12.7kB more of flash. I excluded the timer option with this user_config_override.h:

#ifdef USE_TIMERS
#undef USE_TIMERS
#endif

	#ifdef USE_TIMERS_WEB
	#undef USE_TIMERS_WEB
	#endif

	#ifdef USE_SUNRISE
	#undef USE_SUNRISE
	#endif
@0n3-70uch 0n3-70uch changed the title 12kB more code with 5.12.0j 12.7kB more code with 5.12.0j Apr 9, 2018
@Jason2866
Copy link
Collaborator

Is user_config_override really used? You have to enable this option in your IDE!
In ATOM.io you have to see a yellow warning.

@0n3-70uch
Copy link
Author

Yes it's enabled. With active USE_TIMERS I get round about +30kB of code.

@arendst
Copy link
Owner

arendst commented Apr 10, 2018

That's what the user_config_override.h file is for.

I enable most new features in the development branch to get people testing the new functionality. What you do not need/want just disable it as you perfectly did in the first entry. Although disabling define USE_TIMERS only is enough to get all Timer code vanished from the distribution.

The master branch will have an ever bigger exclusion config but I probably won't be able to keep it below the magic OTA high water mark...

@0n3-70uch
Copy link
Author

Hi Theo,

thanks for your help. At the moment it's necessary to exclude the USE_TIMERS_WEB and USE_SUNRISE . Here you can check the file size (with my user config):

Timers active = 530.0kB

#undef USE_TIMERS = Compiler error

.pioenvs/sonoff/src/sonoff.ino.cpp.o:(.text._Z13PublishStatush+0x68): undefined reference to GetSun(unsigned char)' .pioenvs/sonoff/src/sonoff.ino.cpp.o: In function PublishStatus(unsigned char)':
sonoff.ino.cpp:(.text._Z13PublishStatush+0x4d6): undefined reference to GetSun(unsigned char)' sonoff.ino.cpp:(.text._Z13PublishStatush+0x4e9): undefined reference to GetSun(unsigned char)'
collect2: error: ld returned 1 exit status
*** [.pioenvs/sonoff/firmware.elf] Error 1

#undef USE_TIMERS and USE_TIMERS_WEB = same compiler error

#undef USE_TIMERS and USE_TIMERS_WEB and USE_SUNRISE = 512.5kB

Version 5.12.0i without USE_SUNRISE = 499.7kB

So something is wrong :-).

@arendst
Copy link
Owner

arendst commented Apr 10, 2018

Ah verified. Will investigate.

@arendst
Copy link
Owner

arendst commented Apr 10, 2018

Found it. In file sonoff.ino change line 1309 from

#ifdef USE_SUNRISE

in to

#if defined(USE_TIMERS) && defined(USE_SUNRISE)

@0n3-70uch
Copy link
Author

Haha great. Compiler error fixed... thank you.

Do you have an idea with the flash consumption between the versions? I disabled every timer but the file is 12.7kB larger with version 5.12.0j (compared with 5.12.0i).

Another point... Safe flash space by disabling a subtopic:
#1592

@arendst
Copy link
Owner

arendst commented Apr 10, 2018

#1592 will be solved soon.

When timers are disabled all code should be disabled. Pls provide user_config info for deciding where the 12.9 kB could come from.

arendst added a commit that referenced this issue Apr 10, 2018
5.12.0k
 * Prepare for simple rules by enlarging Settings area to now
2048 bytes
 * Fix freeing more code space when emulation is disabled
(#1592)
 * Fix compile error when not defined USE_TIMERS (#2400)
@arendst
Copy link
Owner

arendst commented Apr 10, 2018

Are you sure you used the same esp/arduino library while comparing 5.12.0i with 5.12.0j?

@0n3-70uch
Copy link
Author

0n3-70uch commented Apr 10, 2018

Yes now I'm 100% sure. I downloaded version 5.12.0k (thanks for the quick fix) and the old 5.12.0i:
d564615

The size difference is still the same. Crazy.

@0n3-70uch
Copy link
Author

I tested many different compiler options. I'm not sure but I think the difference comes from different ESP libraries (2.3.0 / 2.4.0 / 2.4.1).

Greetings Fabi

curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
5.12.0k
 * Prepare for simple rules by enlarging Settings area to now
2048 bytes
 * Fix freeing more code space when emulation is disabled
(arendst#1592)
 * Fix compile error when not defined USE_TIMERS (arendst#2400)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants