"memory allocation failed" : possible to delete main.py ?

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
picpic020961
Posts: 15
Joined: Thu Feb 18, 2021 4:24 pm

"memory allocation failed" : possible to delete main.py ?

Post by picpic020961 » Fri Apr 02, 2021 6:41 am

Bonjour ,

with Thonny at boot my M5stack , this message with prompt:
>>> MemoryError: memory allocation failed, allocating 640 bytes

>>> MemoryError: memory allocation failed, allocating 640 bytes

>>> MemoryError: memory allocation failed, allocating 640 bytes

Is it possible to delete the boot.py ( or main.py ) ?
or erase_flash is the only solution ?

maybe binary save , edit/patch and reload ?

thanks for help
Regards

lbayo
Posts: 24
Joined: Tue Mar 16, 2021 2:10 pm

Re: "memory allocation failed" : possible to delete main.py ?

Post by lbayo » Sat Apr 03, 2021 3:34 am

Hi and bonjour

I think it's a Thonny problem. Try exiting and entering Thonny again

marcidy
Posts: 133
Joined: Sat Dec 12, 2020 11:07 pm

Re: "memory allocation failed" : possible to delete main.py ?

Post by marcidy » Sat Apr 03, 2021 5:36 am

if you can import,

Code: Select all

>>> import os
>>> os.remove("main.py")
if you can't import anything, you probably can't use other tools either.

maybe try:

Code: Select all

with open("main.py", 'w') as f:
    f.write("")
to overwrite it in place.

Post Reply