Skip to content

16KB cache + 48KB IRAM (IRAM) doesn't seem to make extra RAM available #9033

Open
@TD-er

Description

@TD-er

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: [ESP-12]
  • Core Version: [latest git hash & 3.0.0
  • Development Env: [Platformio]
  • Operating System: [Windows]

Settings in IDE

  • Module: [Generic ESP8266 Module|Wemos D1 mini r2|Nodemcu|other]
  • Flash Size: [4MB]
  • lwip Variant: [v2 Higher Bandwidth]
  • CPU Frequency: [80Mhz]
  • Upload Using: [SERIAL]
  • Upload Speed: [115200] (serial upload only)

Tried with these in PlatformIO:

                            -DPIO_FRAMEWORK_ARDUINO_MMU_CUSTOM
                            -DMMU_IRAM_SIZE=0xC000 
                            -DMMU_ICACHE_SIZE=0x4000

or PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48

Also tried with these in the build section of the board definition:

    "mmu_iram_size": "0xC000",
    "mmu_icache_size": "0x4000"

Problem Description

The latest version of this ESP8266 Arduino (3.1.2) doesn't leave enough RAM to run stable.

I also spent quite a lot of time on implementing 2nd heap.
This does add some relief to the amount of free RAM, but it seems to depend on the board whether it is usable.

On a Wemos D1 mini board (really old one, so might be one of those "true" Wemos boards) it runs quite OK.
But on a Sonoff POW r2 it runs like what we would say in Dutch: "Like a drunk lad on roller skates".

So I assumed it might have something to do with the extra burden on the flash due to the cache misses?
But using the same PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48_SECHEAP_SHARED option without actually allocating anything on the 2nd heap, it runs as stable as you can expect with the limited amount of free memory.

Therefore I tried to see whether switching to 16k cache and 48k iRAM would be useable, but I don't seem to get any extra free memory.

Found this comment where this user showed an incredible amount of free DRAM.
I used the same platform_packages as he did for this post, but I don't seem to get any extra free memory.

So what am I doing wrong here?
Or isn't this made available to the normal allocator as this extra memory can perhaps only be addressed with 32-bit alignment?

It would already be a great help if you can store rather static allocated chunks in there like the buffer for MQTT PubSubClient, or a frame buffer for a display.

MCVE Sketch

See: https://community.platformio.org/t/esp8266-mmu-increase-heap/21488/3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions