How to know if I am allocating memory?
Posted: Wed May 06, 2020 2:34 pm
Hello,
I have a very simple sleep function which is giving me a memory error, memory allocation failed heap if locked. I have the emergency allocation buffer enabled to get the error information.
function here:
I've tested using micropython.heap_lock() and manually doing these and it works. Is there a better way to figure out if you are allocating memory? It's complaining about the stm.mem32 line in particular.
I have a very simple sleep function which is giving me a memory error, memory allocation failed heap if locked. I have the emergency allocation buffer enabled to get the error information.
function here:
Code: Select all
def _sleep(t):
stm.mem32[stm.PWR + stm.PWR_CSR] |= 1 << 8 # setup wake on rising edge PA0 (PushButton)
machine.deepsleep()