Skip to main content
Graduate II
November 7, 2024
Solved

STM32H7 execute code in parallel FLASH

  • November 7, 2024
  • 2 replies
  • 3199 views

Hello,

I want to execute code located in external 16bit NOR FLASH e.g. on a STM32H7x3 evaluation board.

I can run the NOR FLASH demo (erase, write, read flash) successfully but have no clue how to create and flash code.

After googling 2 days I found plenty of examples for xSPI but none seems to suit this kind of flash type.

Can somebody point me into the right direction e.g. how to configure the linker script and flash the code using the debugger or Cube Programmer. Any example code or ANs?

Thank you

    This topic has been closed for replies.
    Best answer by mƎALLEm

    Hello,

    There is no direct example that provides an execution from External paralel NOR Flash.

    As said in the previous thread, the AN4891 "STM32H72x, STM32H73x, and single-core STM32H74x/75x
    system architecture and performance" with the package X-CUBE-PERF-H7 could help you to do what you are looking for and inspire from the execution from QSPI Flash.

    What important is to configure the NOR flash in the system_stm32h7xx.c as done for QSPI memory in X-CUBE-PERF-H7. You need to find the Flash loader of that Flash memory and add it in the IDE. Otherwise you will use STM32CubeProgrammer and add that flash from External Flash loader and upload the .hex file generated from the IDE.

    For the linker file you need to refer to the QSPI example scatter file: 8-M7-QSPI-Single_rwDTCM.sct for KEIL under Projects\STM32H743I_EVAL\stm32h7x3_cpu_perf\MDK-ARM\scatter_files

    For IAR: C:\Users\sofiene\Downloads\en.x-cube-perf-h7\STM32CubeExpansion_Performance_H7_V1.0.0\Projects\STM32H743I_EVAL\stm32h7x3_cpu_perf\EWARM\icf_files

    And for system workbench Projects\STM32H743I_EVAL\stm32h7x3_cpu_perf\SW4STM32\ where .ld file are located in the different project folders.

    Hope it helps.

     

     

    2 replies

    mƎALLEmAnswer
    Technical Moderator
    November 7, 2024

    Hello,

    There is no direct example that provides an execution from External paralel NOR Flash.

    As said in the previous thread, the AN4891 "STM32H72x, STM32H73x, and single-core STM32H74x/75x
    system architecture and performance" with the package X-CUBE-PERF-H7 could help you to do what you are looking for and inspire from the execution from QSPI Flash.

    What important is to configure the NOR flash in the system_stm32h7xx.c as done for QSPI memory in X-CUBE-PERF-H7. You need to find the Flash loader of that Flash memory and add it in the IDE. Otherwise you will use STM32CubeProgrammer and add that flash from External Flash loader and upload the .hex file generated from the IDE.

    For the linker file you need to refer to the QSPI example scatter file: 8-M7-QSPI-Single_rwDTCM.sct for KEIL under Projects\STM32H743I_EVAL\stm32h7x3_cpu_perf\MDK-ARM\scatter_files

    For IAR: C:\Users\sofiene\Downloads\en.x-cube-perf-h7\STM32CubeExpansion_Performance_H7_V1.0.0\Projects\STM32H743I_EVAL\stm32h7x3_cpu_perf\EWARM\icf_files

    And for system workbench Projects\STM32H743I_EVAL\stm32h7x3_cpu_perf\SW4STM32\ where .ld file are located in the different project folders.

    Hope it helps.

     

     

    regjoeAuthor
    Graduate II
    November 8, 2024

    Hello SofLit,

    in the eval board schematics of the STM32H7x3 Eval board in rev B and E are PC28F123M29EWLA and MT28EW128ABA1LPC-0SIT NOR FLASH, but the Cube Programmer seems to support M29W128GL only.

    The M29W128GL seems to be out of production. I found a AN regarding writing external flash loaders and sources of the M29W128GL can be found on GITHUB, so it should be possible to use recent chips. Hope this task is not too complicated and time consuming. I will run into the same problem for QSPI FLASH later.

    BTW: Beside ST there is another interesting project on GITHUB with lots of ports to the latest Q/OSPI flashes, but most of them seem to be in pending status.

    I'll dive into the code you mentioned. I probably need additional information how to flash external memory using Cube IDE and where to find suitable flash loaders.

    Best regards

     

     

    Technical Moderator
    November 8, 2024

    Hello,

    If possible to give a try by uploading the binary demo of that board using CubeProgrammer with the M29Wxxx flash loader:  https://www.st.com/resource/en/compiled_demos/stm32h743i-eval_demo.zip

    If it doesn't work, I will ask internally if there is a Flash loader for MT28EW128 available.

    Technical Moderator
    December 3, 2024

    Forget about FFT for the moment as it's a bit tricky and many files (many dependencies) to relocate in the correct region.

    Try to run a simple algorithm where you know how it works and ho to map.

    Check also the FMC timings, are they optimal for the memory?..