STM32N657X0 – 4.2 MiB RAM, but challenging to fully utilize

This particular microcontroller caught my interest because of its 4.2MB of SRAM. That said, you should know that it has 0 bytes of internal flash memory, and that's where the problems begin.



Having no internal flash memory is that make it difficult to develop on this board. 

 

4.2MB of internal SRAM can be useful for certain applications, but to utilize it effectively, you need to understand a few things. First is the First Stage Bootloader (FSBL), which likely assumes you'll also need a Second Stage Bootloader (SSBL), and the answer is yes!

Since there’s no internal flash, your code must reside on external flash memory. The microcontroller has a mechanism to copy code into AXISRAM2 and execute it from there.

 However, the initial code is limited to 256 KiB and it starts from address 0x34180400. To understand why this is somewhat problematic, take a look at the address space of AXISRAM2.

In the table, we can see a continuous RAM address range up to 0x34400000. The 0x400000 address space corresponds to 4 MiB, and since VENCRAM extends to 0x34420000, we actually have a total of 4.2 MiB of continuous RAM.

However, the FSBL runs with an offset of around 1.8 MiB, which makes it difficult to use the entire RAM space continuously. This would be completely different if the FSBL started at address 0x34000000.

So, when I said you’ll need an SSBL, that was the idea, you initialize the MCU with the FSBL, and then run the SSBL from address 0x34000000 or from external flash. In that case, you'd be able to mostly or fully utilize the 4.2 MiB of RAM for the application (firmware) alone.


Extra
If you need FSBL and App code for reference (no SSBL), I've ported IMBootloader with the IMLedBlink example to NUCLEO-N657X0-Q. Code is here:

https://github.com/IMProject/IMBootloader/pull/38
https://github.com/IMProject/IMLedBlink/pull/8

Comments

Popular posts from this blog

AUTOSAR and CRC calculation

PX4 development - building, flashing and debugging without debugger (Arduino developers style)

PX4 development - building, flashing and debugging with debugger (like a PRO)