QUERY · ISSUE
py: settrace is incompatible with Interrupt Handlers
py-core
When MICROPY_PY_SYS_SETTRACE is enabled, bytecode execution allocates RAM, which is forbidden on interrupt handlers.
https://github.com/micropython/micropython/blob/4d9e657f0ee881f4a41093ab89ec91d03613744d/py/vm.c#L142-L149
https://github.com/micropython/micropython/blob/e9e9c76ddf131f8e50b0ae2d44501d3cd88537ef/py/profile.c#L315-L318
CANDIDATE · ISSUE
py: code_state heap allocation is incompatible with Interrupt Handlers
py-core
When running interrupt handler, memory allocation is forbidden but still happens if state_size is larger than VM_MAX_STATE_ON_STACK:
https://github.com/micropython/micropython/blob/4d9e657f0ee881f4a41093ab89ec91d03613744d/py/objfun.c#L267-L268
It's not clear how to completely avoid memory allocations in interrupt handlers if code_state is allocated on heap sometimes.