[Ovmsdev] RAM

Stephen Casner casner at acm.org
Mon Oct 23 12:27:29 HKT 2017

On Mon, 23 Oct 2017, Mark Webb-Johnson wrote:

> 72KB RAM seems a bit ridiculous for a bluetooth stack. I really hope
> this is not Espressif loading those binary blobs from libbtdm_app.a
> into RAM.

I've been investigating the memory map to try to understand better
what is available to us.  From the OS code and the technical reference
manual I constructed the following map:

0x3ff00000 - 0x3ff80000  Peripheral
0x3ff80000 - 0x3ff82000  RTC fast memory
0x3ff82000 - 0x3ff90000  ---
0x3ff90000 - 0x3ffa0000  Internal ROM
0x3ffae000 - 0x3ffaff10  DRAM, reserved for ROM data region, inc region needed for BT ROM routines
0x3ffaff10 - 0x3ffb0000  Heap: DRAM little piece
0x3ffb0000 - 0x3ffc0000  DRAM, reserved for BT hardware shared memory & BT data region
0x3ffc0000 - 0x3ffd0578  DRAM used by bss/data static variables (VARIES)
0x3ffd0578 - 0x3ffe0000  Heap: DRAM 8-bit accessible
0x3ffe0000 - 0x3ffe0440  D/IRAM, reserved for ROM PRO data region
0x3ffe0440 - 0x3ff34000  Heap: D/IRAM DMA capable, 8-bit accessible
0x3ffe4000 - 0x3ffe4350  D/IRAM, reserved for ROM APP data region
0x3ffe4350 - 0x40000000  Heap: D/IRAM DMA capable, 8-bit accessible
0x40000000 - 0x40060000  Internal ROM
0x40060000 - 0x40070000  ---
0x40070000 - 0x40078000  IRAM CPU0 cache region
0x40078000 - 0x40080000  IRAM CPU1 cache region
0x40080000 - 0x400955c0  IRAM used by code? (VARIES)
0x400955c0 - 0x400a0000  Heap: IRAM EXEC capable, 32-bit only
0x400a0000 - 0x400c0000  Internal SRAM used for something else

See there are two chunks of memory for Bluetooth, 7952 bytes at
0x3ffae000 and 65536 bytes at 0x3ffb0000.

I have reduced the increased bss/data size that resulted from
configuring in the memory debugging code by replacing the static
arrays with memory allocated from the IRAM heap that is only 32-bit
accessible.  There might be other memory uses that could go there.
Right now I'm using 24972 out of that 49560 space leaving only 18588,
but I'm thinking about how to reduce that by moving some of the data
reduction into the OS.

                                                        -- Steve

More information about the OvmsDev mailing list