2022-09-19 03:23 AM
Here is my approach:
1) I think I have to adjust the pin configuration in the "memory_msp.h" of the ExtMem_Boot project first
2) Then I would have to include the correct QSPI driver in the "qspi.c" file.
3) Provide the correct ".stldr" external loader file
What else do I need to consider?
Thank you
2022-09-19 06:23 AM
Does the Linker script describe internal or external memory?
TIM shouldn't care.
Can you run from internal?
If a bootloader has already run you shouldn't need to touch QSPI setup or clocks again.
2022-09-19 07:31 AM
>>Can you run from internal?
No, I specifically want to load the code onto an external flash. And I want to learn how to configure all this.
I currently have two STM32 examples running via external flash on the DISCO. Now I want to get it running on another board that uses a different QSPI flash.
2022-09-19 09:25 AM
Your loader running in Internal FLASH, needs to bring up the MCU, clocks, pins and QSPI to manifest the External Memory within the MCU's memory space (ie Memory Mapped Mode), and then transfer control.
The Linker Script for the application needs to describe size of the memory at 0x90000000, where you want the image to reside.
You need an External Loader familiar with your chosen memory device, pin usage, etc. Might want to test this code out first via your boot loader app.
The main app you want running in External Flash should not touch the clocks, or interfaces, as they should already be working, and you'll break them. The app should set the vector table (SCB->VTOR) to point to the 0x90000000 address you've established for the QSPI memory.
2022-09-22 07:10 AM
Difficult. I simply have not the same QSPI - IC (Winbond) than the DISCO and should know how to change the Code of a DISCO example...
Is the ExtMem_Boot project, see path below, an external loader or it is something else?
If it is a loader:
Can I adjust the pin mapping etc. of this ExtMem_Boot project?
And how can I create an stldr-file based on this ExtMem_Boot project?
..\STM32Cube\Repository\STM32Cube_FW_H7_V1.10.0\Projects\STM32H750B-DK\Templates\ExtMem_Boot\
2022-09-22 07:30 AM
or is it possible to convert a FLM-File (Keil) to STLDR?
2022-09-22 09:52 AM
>>or is it possible to convert a FLM-File (Keil) to STLDR?
They are somewhat transmutable..
Difficult is subjective, within the scope of role for an Embedded SW Engineer.
You'll need to port the BSP to your pin and part selection.
If you build the write and erase functionality into the application level BSP you can test that, and then migrate into an FLM or STLDR framework. Debugging in the latter is more difficult, but you can use LEDs, GPIO and UART on the target board to provide instrumentation and telemetry.
>>Is the ExtMem_Boot project..
It's an application level code example to bring up the QSPI interface (or SDRAM / NOR), and transfer control. Runs in Internal FLASH, acts as a "Loader" stage.
>>Can I adjust the pin mapping etc. of this ExtMem_Boot project?
You create a BSP for Your Board
>>And how can I create an stldr-file based on this ExtMem_Boot project?
No, an External Loader is a bit of a different beast.
I've built prepackaged External Loaders for a wide mix of part and pin configurations
https://github.com/cturvey/stm32extldr/tree/main/h7_w25q256
2022-09-22 11:18 PM
>>No, an External Loader is a bit of a different beast.
Many thanks already once for this support.
So my next approach, due to my very limited understanding/support and time, would be as follows:
a) Find out the source code or the STM32CubeIDE project of the "MT25TL01G_STM32H750B-DISCO.stldr" file and adapt it for my Winbond W25Q64 QSPI chip.
b) Then compile with the STM32CubeIDE and rename the ELF file to STLDR.
c) Adjust qspi.c and related files of "ExtMem_Boot" project to W25Q64 configuration
d) Then I should be able to run Disco examples as "TIM_TimeBase" on a board with different QSPI-Chip than the DISCO-board, right?
=> Is this a correct procedure? Is the project code for the mentioned STLDR file available at all?
>>I've built prepackaged External Loaders for a wide mix of part and pin configurations
>>https://github.com/cturvey/stm32extldr/tree/main/h7_w25q256
WOW, will check it. Do you also have a w25q64 stldr loader (PB2,PB6,PF8,PF9,PF7,PF6)?
2022-09-23 04:53 AM
I tried to adjust following external loader:
https://github.com/manoloaterol/MCUDEV_DevEBox_H743-W25Q64-EL
I adjusted the pin assignment to PB2,PB6,PF8,PF9,PF7,PF6, build project and rename the Elf-file to STLDR
Unfortunately I have now following error:
Address : 0x90000000
Erasing memory corresponding to segment 0:
Erasing external memory sectors [0 1]
Download in Progress:
Error: failed to download Segment[0]
Error: failed to download the File
Shutting down...
Exit.
2022-09-23 05:24 AM
If I build an external loader project, do I need to set up a special build configuration to get a correct STLDR compatible ELF file?