STM32N6570-DK with FSBL and Appl - mapping external PSRAM in FSBL
Hello superhero MCU enthusiasts,
I'm playing with the STM32N6570-DK and have created a simple project with an FSBL that initializes the MCU and boots the Appl. Once booted, the Appl flashes a "Hello World" LED.
Both can be loaded to external flash using the STM32CubeProgrammer.
Now, I'm trying to map external PSRAM (XSPI1 -> 0x90000000) inside the FSBL, but it fails.
To do that, I change a line in a file in the FSBL, stm32_extmem_conf.h, line 35 of (PSRAM disabled):
#define EXTMEM_DRIVER_PSRAM 0Now I try to enable and map the external PSRAM by setting the definition to 1:
#define EXTMEM_DRIVER_PSRAM 1However, it doesn't succeed.
When debugging I see we land into a HardFault.
The FSBL generates a HardFault when executing SAL_XSPI_EnableMapMode, because the function HAL_XSPI_MemoryMapped fails.
I can't find the cause.
Anyone?
I posted a project here with a short Readme.md:
https://github.com/AngryCarrot61/STM32N6570-DK_004
Note: to see FSBL and Appl working one has to set EXTMEM_DRIVER_PSRAM to 0.
However the goal is to get PSRAM mapped (XSPI1 at 0x90000000).
Flashing:
the debug directories for FSBL and Appl contain a batch file: '0_SigningTool.bat'.
After compiling, run the batch files to sign the binaries.
Using STM32CubeProgrammer we select EL 'MX66UW1G45G_STM32N6570-DK'.
FSBL will be loaded at 0x70000000, and Appl at 0x70100000.
Enjoy!
Any help is much apreciated regarding the part to map the PSRAM!
Cheers!
