2024-09-28 08:29 PM
Previous post here didn't seem to get answered, so I thought I'd ask again.
Is there a way to execute code with the XIP framework, but not using the external SDRAM for instruction execution?
I'd like to use internal AHB or AXI Ram sections for code execution, and use the external ram for other purposes.
There doesn't seem to be any MX options or #defines in the XIP template to indicate this as an option.
I'm still digging through the code to have a better understanding of the system, but I'm not sure if this will be a fools errand if this configuration is not possible.
If there is a way to do this, if anyone can direct me to any documentation on the setup, that would be wonderful.
Thanks,
-Hal
Solved! Go to Solution.
2024-09-29 08:31 AM - edited 2024-09-29 08:54 AM
It looks like Cube does not support this configuration directly. Tweak the project manually, borrow a RAM .ld file for internal RAM from project for older STM32H7 MCU.
> I would still like my instructions to be stored in external flash
Of course, but split the task to two smaller steps: 1. application (loaded by debugger) 2. storage in external memory and loader. Without debugger execution always starts in internal flash
If possible, play with a Nucleo board with older "classic" STM32H750, H743/754, H72x and port the result to H7S.
2024-09-29 02:32 AM - edited 2024-09-29 02:35 AM
Yes, you can run code in the AXI RAM of STM32H7. When CubeMX generates a project it usually creates two .ld files, one for flash and another for RAM. Just use the latter .ld file, build and debug. Without the debugger, you'll need some kind of bootloader in internal flash to copy the program to the RAM.
2024-09-29 07:37 AM
Thanks for the reply,
Cool to see that this is possible.
So is this what the "EXTMEM_USER" Option is for in cubeMX?
From my understanding, you need to set 2 memory sections, one for code storage (external NOR flash, in our case), and one for code execution, that the instructions in NOR get written to. But there doesn't seem to be an option in Cube MX, or in the code generated. #defines only seem to exist for the memory options on the list.
I do see that two .ld files are generated in the XIP template project, Is there one here that only executes from internal Ram, instead of external?
Because I would still like my instructions to be stored in external flash, since the internal flash on the STM32H7S7 is very small. I didn't think there was a way to execute instructions directly from external flash, as this option in Cube MX of marking memory 2 to "none" does not allow you to generate output code. So it seems strange that one of these would be targeting just the External flash for execution.
Would you be able to go into more detail on these two files? Maybe my understanding of this whole system is just incorrect.
Thanks again!
-Hal
2024-09-29 08:31 AM - edited 2024-09-29 08:54 AM
It looks like Cube does not support this configuration directly. Tweak the project manually, borrow a RAM .ld file for internal RAM from project for older STM32H7 MCU.
> I would still like my instructions to be stored in external flash
Of course, but split the task to two smaller steps: 1. application (loaded by debugger) 2. storage in external memory and loader. Without debugger execution always starts in internal flash
If possible, play with a Nucleo board with older "classic" STM32H750, H743/754, H72x and port the result to H7S.