2020-06-30 07:30 AM
Hello!
I'am playing with the STM32H7B3-DK and I have successfully bring up the board and run a custom gui:
The GUI assets are loaded in the external OSPI and the dual framebuffer is placed in the the external SDRAM.
Now I'am interested in loading also the application code in the external OSPI. This should be quite easy I hope, if I'm not wrong, it is just a matter of editing the STM32H7B3LIHXQ_FLASH.ld file.
However I'am confused on how to do with bootloader:
My intention is to boot the code from the OSPI, load it all in the internal RAM and execute it in the internal RAM:
By googling I found this very interesting appnote: AN5188 which talks about external memory code execution, but it covers the cases in which the code is executed in place in the external memory.
Are there any appnotes about booting from external memory?
Thank you!!
Paul
Can
2020-06-30 10:09 AM
The loader in this context should
Set up all the clocks,
Set up the external memory interface in memory mapped mode, QSPI via say example BSP and XIP code,
Check the integrity of the QSPI based image, at least if Vector Table is present,
Transfer control by jumping into code via the SP/PC values given in the Vector Table
On the QSPI application side DO NOT mess with the clocks, so leave out call to SystemClock_Confg(), thus avoiding calls to HAL_RCC_OscoConfig() and HAL_RCC_ClockConfig(), rather using the already running system
Calling HAL_RCC_GetHCLKFreq() should refresh SystemCoreClock;
2020-07-02 11:16 PM
Hi @Community member , thank you for your replay.
But I'am still confused on how to start working on my bootloader:
Thank you,
Paul
2020-07-03 05:45 AM
I don't use CubeMX, but there should be enough examples in the CubeH7 HAL trees to MacGyver something together in short order
STM32Cube_FW_H7_V1.7.0\Drivers\BSP\STM32H750B-DK\stm32h750b_discovery_qspi.c
STM32Cube_FW_H7_V1.7.0\Projects\STM32H750B-DK\Examples\QSPI\QSPI_MemoryMappedDual
STM32Cube_FW_H7_V1.7.0\Projects\STM32H743I-EVAL\Examples\QSPI\QSPI_ExecuteInPlace
STM32Cube_FW_H7_V1.7.0\Projects\STM32H743I-EVAL\Applications\IAP
STM32Cube_FW_H7_V1.7.0\Projects\STM32H750B-DK\Demonstrations\MenuLauncher\Core\Src\bsp.c
Start with a simple shell/template project that brings up clock and QSPI
The concepts of boot loaders is not specific to STM32 nor the H7, you're bring up the hardware, determining the specific responsibilities contracted on each side, and using the inherent functionality of the micro-controller to map vector tables and transfer control to other routines.
The H7 has more flash memory than specified.