← index #4518Issue #4399
Related · high · value 3.678
QUERY · ISSUE

memory allocation error from time to time after machine.reset()

openby nedoskivopened 2019-02-18updated 2024-09-19
needs-info

Hello,
I'm using ESP32 with MicroPython v1.9.4-684-g51482ba92 without PSRAM

I got lot of stuff some _threads, while writing and changing I often restart the board, using machine.reset()

from time to time i got memory allocation error when my scripts start to load. So question is why, board reboot if some of them are too big it should fail every time. Not from time to time. Is there something that I'm missing?

CANDIDATE · ISSUE

esp32: Some processes lock at timer single shot executed after machine.reset()

closedby nedoskivopened 2019-01-06updated 2019-02-05
port-esp32

Hello, it is kind a complicated to explain how this bug works, but I will try :)

i'm using micropython 1.9.4 on esp32 (lolin32 lite)

in my startup script I got script that initialize wireless connection and shot single timer to show connection status after 10 seconds:

def ws(timer):
	if station.isconnected() == False:
		print ("Wifi still not connected")
	else:
		print(station.ifconfig())
	timer.deinit()
	exec(open('/alarmprocessor.py').read(),globals())
timer.init(period=10000, mode=machine.Timer.ONE_SHOT, callback=ws)

after that I got few scripts that go into different threads and main is in a loop and display some data in console.
So far so good, all work, but when I interrupt main script with CTRL-C and execute machine.reset()
then start my startup script again it loads, main script start but in the moment when timer should display his message about wireless connection, main script hands and some of _thread scrips also stop working.
If I restart device using reset button it is ok and my start scripts load normally (just first time)
Now I was removed that timer.single.shot and all works fine after machine.reset()

Hope managed to explain bug that I have found.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied