RAM
-
Hi all, I am making a project. I keep on receiving "Memory ERROR: memory error failed". I know why this error is coming. Is there any way we can increase this ram size of LOPY by desoldering or soldering some components or any other way ?
-
Could you share the source code that demonstrates the issue?
-
@seb actually I am using Blynk mobile app library + LORA + wifi + some other libraries in my code and I am using LOPY module.
I am only able to use some widgets provided by Blynk. when I try to add more widgets in code I get memory error specifically stating memory error at the Blynk library (line of code at the very starting) .when I use some widgets of blynk it works fine at this point I do memory checks at various location in my code. I have more than enough memory available shown by memory checks.
problem starts when I add code for only one more widget, I get memory error pointing at the library.thanks for helping.
-
thanks for replying @robert-hh
-
Hi,
Could you share your code along with the full error message that shows where it occurs. It may be possible to prevent this error by adjusting the way you have written your code.
-
@dhruv I assum that you use the 1st model LOPY. No, there is no way to increase the RAM size. Even if you open the RF shield and attach a PSRAM chip, you have to modify the firmware to make it use that chip. In order to overcome the memory problem, you have two choices.
a) Buy a LoPy4 model. This has 4 MB of RAM
b) Put your Python code into flash memory. That requires to build the firmware yourself, starting with downloading the repository at https://github.com/pycom/pycom-micropython-sigfox and seeting up the tool chain as told in the README.md. Once you are able to build the image, you can put your python code into esp32/frozen and re-build.Python code in flash does not need the RAM for compiling and resulting code, so the RAM is used for the dynamic data only. If that us still too much, you have to re-consider your code.