More SRAM on STM32N6
Description
The STM32N6 is touted to have "4.2 Mbytes of contiguous embedded RAM", which got me excited to do some image processing without any PSRAM. I was disappointed to see only ~300kB actually available:
MicroPython v1.28.0-preview.940.gee546931fe.dirty on 2026-07-24; NUCLEO-N657X0 with STM32N657X0
Type "help()" for more information.
>>> import gc
>>> gc.mem_free()
315312
I've been poking at the reference manual (4669 pages!) and linker script, and realized this is more involved than simply tweaking the memory areas in the linker.
So I'm starting this thread to discuss increasing the SRAM available in MicroPython. What is feasible, what is reasonable, how to do it. I don't think all 4.2Mbytes is necessarily achievable, but we can certainly do better than only ~300kB!
Code Size
This should only affect STM32N6 boards, where minimizing code size arguably isn't critical (STM32N6 boards tend to have a lot of flash memory), though I expect this to have a fairly small effect on code size.
Implementation
I intend to implement this feature and would submit a Pull Request if desirable
Code of Conduct
Yes, I agree
Source: micropython/micropython