Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. In order to program the application part of the freertos_stm32h7_som project to the QSPI Flash, use the external loader. The following procedure builds the mt25ql512abb_stm32h7_som external loader from the STM32CubeIDE in the same workspace, where the main demo project resides:

    1. Click File->Open Projects from File System:

      image-20241002-131512.png
    2. Select <STM32CubeH7 path>/mt25ql512abb_stm32h7_som path and click Finish.

    3. In Project Explorer double click to the mt25ql512abb_stm32h7_som.ioc file to activate the Device Configuration Tool:

      image-20241002-131750.png
    4. Click Project->Generate Code or press Alt-K to generate C-files from the .ioc file

    5. Click Project->Build Project or press Ctrl-B to start building.

  2. In Project Explorer select the freertos_stm32h7_som project. Then click Run->Run Configurations...:

    image-20241002-131903.png
  3. Select STM32 C/C++ Application -> freertos_stm32h7_som Debug. Select the Debugger tab, scroll down and click Add... in the External loaders group:

    image-20241002-131956.png
  4. Click Workspace... and select MT25QL512A_STM32H7-SOM.stldr file:

    image-20241002-132019.png
  5. Apply changes and clone the Run Configurations... window.

  6. Click the Run button at the top panel to install the application to the target board and run it:

    image-20241002-132106.pngImage Modified
  7. The following prompt shall appear on the serial console:

    Code Block
    STM32H7 SOM FreeRTOS CLI, www.emcraft.com
    Type help to view a list of available commands.
    CLI>
    

7. Debugging the Project

Its is assumed that the MT25QL512A_STM32H7-SOM.stldr external loader is already added to the project's Run Configurations as per items 7.1 .. 7.5.

...

  1. The dedicated option SKIP_WDT_TASK is defined in main.h in order to quickly enable/disable WDT in the project. To disable WDT set this option to 1 and rebuild the project:

    image-20241002-132222.png
  2. Click the Debug button at the top panel to start debugging:

    image-20241002-132244.png
  3. Select Remember my decision and switch to the Debug Perspective if prompted:

    image-20241002-132304.png
  4. Wait for the STM32CubeIDE to write the firmware image to the target via ST-Link and stop at the main() function

...

  1. .

    At this point SDRAM is not initialized yet. Only the code that is located in the internal Flash or internal RAM is available for setting breakpoints. If there were breakpoints set by a previous debug session which refer to SDRAM, they need to be deactivated. The breakpoints in SDRAM can be re-activated later, when the initialization code has been performed.

    image-20241002-132349.pngImage Added
  2. Set a breakpoint after the MX_QUADSPI_Init() function is done:

    image-20241002-132421.pngImage Modified
  3. Proceed to execute the program.

  4. When the program stops at the breakpoint set in the 2 steps above, the QUADSPI interface is initialized and the application code is copied to SDRAM, so you can use breakpoints in the application code. Let's set a breakpoint at the prvHelpCommand() function in the CLI driver:

    image-20241002-132443.pngImage Modified
  5. Proceed to execute the program.

  6. Switch to the terminal with the serial console and type the help command:

    Code Block
    STM32H7 SOM FreeRTOS CLI, www.emcraft.com
    Type help to view a list of available commands.
    CLI> help
    
  7. Switch back to the debug session in the STM32CubeIDE. Make sure the execution is stopped at the breakpoint in the prvHelpCommand() function. Use the Step Over button to proceed the execution in a step-wise fashion:

    image-20241002-132501.pngImage Modified
  8. Proceed to execute the program in a step-wise fashion, set up breakpoints, examine variables and so on.

8. Known Problems and Limitations

...