Page 1 of 1

Is there a way to increase RAM?

Posted: Mon Dec 03, 2018 6:34 am
by Meekdai
Hello everyone.
I have a lot of chips controlled by my system (pybv10). I have packaged them into modules for each chip driver and frozen them.
I read the instructions for memory usage.http://docs.micropython.org/en/latest/r ... ained.html
After optimizing the code, the memory is still insufficient. Is there a solution for software or hardware?

Re: Is there a way to increase RAM?

Posted: Mon Dec 03, 2018 9:30 am
by pythoncoder
There is no way to do this in hardware. You may need to consider an alternative platform or wait for the Pyboard D series to emerge.

Re: Is there a way to increase RAM?

Posted: Mon Dec 03, 2018 10:30 am
by Meekdai
Why is the available gc memory only about 72KB?

Code: Select all

MicroPython v1.9.4-479-g828f771e3-dirty on 2018-11-30; PYBv1.0 with STM32F405RG
Type "help()" for more information.
>>> import micropython
>>> micropython.mem_info(1)
stack: 508 out of 15360
GC: total: 74368, used: 69968, free: 4400
I want to know how the 192KB+4KB RAM is allocated.
By the way, when will pyboard D be available? I am looking forward to it for a long time.

Re: Is there a way to increase RAM?

Posted: Mon Dec 03, 2018 11:55 am
by chuckbook
There are 192kB of SRAM on the F405. A PYBV11 shows:

Code: Select all

>>> micropython.mem_info(1)
stack: 484 out of 15360
GC: total: 102656, used: 1440, free: 101216
64 kB SRAM is used for filesystem cache and ~30kB SRAM for static variables and stack (depending on build options).
Using 64k as file system cache is a pity but unfortunately unavoidable if you want to have a FAT file system in the internal flash.
The upcoming PYBD will use SRAM in a much more efficient way.

Re: Is there a way to increase RAM?

Posted: Tue Dec 04, 2018 2:52 am
by Meekdai
Is there a way to use the 64K that was originally used as a file system cache ? I can use the SD card to do file system storage.

Re: Is there a way to increase RAM?

Posted: Tue Dec 04, 2018 6:25 am
by Roberthh
Why does mem_info() on your device show only ~73k. The mem_info() on the device of @dhylands shows about 100k, the same as mine.

Re: Is there a way to increase RAM?

Posted: Tue Dec 04, 2018 6:53 am
by Meekdai
Because I used websocket on pyboard.

Code: Select all

#define MICROPY_PY_LWIP (1)
#define MICROPY_PY_WEBSOCKET (1)
Lwip maybe used part of the memory.

It seems to be a bit difficult to use CCM data RAM.
viewtopic.php?f=2&t=427&hilit=CCM+data+RAM

Re: Is there a way to increase RAM?

Posted: Tue Dec 04, 2018 5:14 pm
by dhylands
CCM memory on the pyboard is used/reserved by the filesystem for writing Flash blocks.