Giter VIP home page Giter VIP logo

Comments (28)

psy0rz avatar psy0rz commented on July 22, 2024 1

I found a tool that can show some more information:

psy@psypad ~/ESPEasy % ./memanalyzer.py /home/psy/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-objdump .pioenvs/dev_4096/firmware.elf
   Section|                   Description| Start (hex)|   End (hex)|Used space
------------------------------------------------------------------------------
      data|        Initialized Data (RAM)|    3FFE8000|    3FFE8458|    1112
    rodata|           ReadOnly Data (RAM)|    3FFE8460|    3FFEACEC|   10380
       bss|      Uninitialized Data (RAM)|    3FFEACF0|    3FFF49C8|   40152
      text|            Cached Code (IRAM)|    40100000|    40107F00|   32512
irom0_text|           Uncached Code (SPI)|    40201010|    402827E3|  530387
Total Used RAM : 51644
Free RAM : 30276
Free IRam : 274

i found it here: https://raw.githubusercontent.com/SmingHub/Sming/develop/tools/memanalyzer.py

from espeasy.

psy0rz avatar psy0rz commented on July 22, 2024 1

The results are here: https://github.com/letscontrolit/ESPEasy/blob/mega/dist/Plugin_sizes.txt

Especially the IRAM usage is a problem currently. Without any plugins we only have around 2k left. Some plugins with ISR's need to use some IRAM. I'll see what i can do to reduce that first.

from espeasy.

psy0rz avatar psy0rz commented on July 22, 2024

i updated it to v1.0.2 and trying to compile it, suddenly all the versions give this error:

/home/psy/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: .pioenvs/test_1024/firmware.elf section `.text' will not fit in region `iram1_0_seg'            

(currently trying to find out whats going on, or is the library really big??)

from espeasy.

crankyoldgit avatar crankyoldgit commented on July 22, 2024

The library isn't really big, but it has grown since the version you had referenced.

from espeasy.

psy0rz avatar psy0rz commented on July 22, 2024

it adds about 10k. i would have expected we would have way more rom left still.

we probably hit some kind of limt. will have to find out how it works and perhaps write a script that lists the rom usage per plugin and go from there.

from espeasy.

psy0rz avatar psy0rz commented on July 22, 2024

btw thanks for informing us about that outdated repo :)

from espeasy.

crankyoldgit avatar crankyoldgit commented on July 22, 2024

Some quick googling, it appears it isn't the rom that is being exhausted, but the (i)ram.
http://www.esp8266.com/viewtopic.php?f=9&t=12754

Some of the interrupt routines for decoding incoming IR commands have been moved to iram for speed in the library. This hasn't been an issue for us, but given all the other libraries you use/include, you've probably exhausted the iram in the total build.

from espeasy.

crankyoldgit avatar crankyoldgit commented on July 22, 2024

We've got two interrupt procedures that have ICACHE_RAM_ATTR enabled, they are not particularly large. My guess is you've been close to the total iram budget for a while and the minor recent changes in those two have pushed you over.

from espeasy.

crankyoldgit avatar crankyoldgit commented on July 22, 2024

FWIW, it seems it wasn't our library that was causing you issues. You already had iram problems prior to this. e.g. #185

from espeasy.

psy0rz avatar psy0rz commented on July 22, 2024

yep but that was only for that users environment and not reproducable. we also use travis to automaticly build every commit.

perhaps its related.

from espeasy.

crankyoldgit avatar crankyoldgit commented on July 22, 2024

Ack. I'm seeing what I can do to reduce iram usage by our lib. You might want to think of sharding/splitting your travis builds with less modules enabled in each shard to reduce the problem, and let users select what ever modules they want. There is only so much one can squeeze into a ESP8266 after all. :-)

from espeasy.

psy0rz avatar psy0rz commented on July 22, 2024

yes indeed. i'm going to find out how to show the iram and other usage after compiling, and then write a script that automaticly determines usage for every plugin in our system. that we it will be easier to split of 'huge' plugins.

after that i'm going to find out what things we can do to reduce usage in general.

until now we are just guessing about usage, instead of actually measuring it.

from espeasy.

crankyoldgit avatar crankyoldgit commented on July 22, 2024

Please ping me on that commit, I'm interested to see how you implement it.

from espeasy.

psy0rz avatar psy0rz commented on July 22, 2024

this is with the infrared plugins disabled, as you can see we're already very limited.

i'll transform that pythonscript in something that tries to determine usage of all rams and roms per plugin.

from espeasy.

crankyoldgit avatar crankyoldgit commented on July 22, 2024

Yeah, IIUIC the iram limit is 32k, so you were/are right on it. I'm interested to see how much we use.
I think I've done everything we can at our end to reduce iram usage, but if you find something else, let us know.

from espeasy.

crankyoldgit avatar crankyoldgit commented on July 22, 2024

Hmm, we could split the library into a receive and a transmit portion. Only the receiver part needs iram, but that would break a lot of existing usage. Something for another day.

from espeasy.

psy0rz avatar psy0rz commented on July 22, 2024

yeah i'll let you know, there are probably many things we can do on our side first.

from espeasy.

uzi18 avatar uzi18 commented on July 22, 2024

from espeasy.

uzi18 avatar uzi18 commented on July 22, 2024

from espeasy.

psy0rz avatar psy0rz commented on July 22, 2024

yup

from espeasy.

psy0rz avatar psy0rz commented on July 22, 2024

@crankyoldgit using the IR receive functions uses 288 bytes of IRAM it seems. Thats probably because of the interrupt handler routine. Could you check if its easy to save some bytes in that function? Even 10s of bytes will help if its possible, without any compromises.

from espeasy.

crankyoldgit avatar crankyoldgit commented on July 22, 2024

@psy0rz I've been thinking of it ever since I saw your data. I haven't yet come up with an easy/good/safe way to do that yet. Now that I know how tight iram is, it's certainly a desired outcome. I'll try to let you know if I come up with something.

from espeasy.

psy0rz avatar psy0rz commented on July 22, 2024

Ok, if it cant be done, it cant be done. :)

Its too bad that we only have around 2k left to work with of the 32k. Makes you wonder what else can be done in the ESP8266/Arduino core libraries to reduce IRAM memory usage.

from espeasy.

crankyoldgit avatar crankyoldgit commented on July 22, 2024

Per the impending PR on our library, we should be reducing by about 28 bytes of IRAM when it gets updated.

I've got two other ideas to try that might reduce it further, but they are really horrible potential kludges.

from espeasy.

psy0rz avatar psy0rz commented on July 22, 2024

well if its kludgy dont do it:)

from espeasy.

crankyoldgit avatar crankyoldgit commented on July 22, 2024

That may be why I haven't done it. ;-)

from espeasy.

crankyoldgit avatar crankyoldgit commented on July 22, 2024

FYI, v1.2.0 of IRremoteESP8266 has been released with reduced IRAM usage.

from espeasy.

psy0rz avatar psy0rz commented on July 22, 2024

thanks @crankyoldgit , the plugin that uses your lib went from 288 to 260 bytes IRAM. :)

very nice.

Edwin

from espeasy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.