Skip to main content
Visitor II
October 3, 2025
Solved

QSPI is not working on STM32H747 in FreeRTOS thread

  • October 3, 2025
  • 2 replies
  • 501 views

Title edited by a ST moderator to reflect the content.

Hello,

STM32CubeMX Version:6.15.0

STM32CubeH7 Firmware Package V1.12.0 / 30-October-2024

This Is My QSPI Configure in STM32CubeMX

lianyan_0-1759476512732.png

1、When I Start QSPI Work in main function,The QSPI Will always work。QSPI work on CM4-Core。

source:

lianyan_1-1759476655729.png

 

The QSPI CS signal wave,which Delta Time is 13us,not big than 1s according code:

lianyan_2-1759476709674.png

2、When I Start QSPI Work in FreeRTOS Thread,The QSPI-CS signal Always High,and clock is always out 。QSPI work on CM4-Core。

source:

lianyan_3-1759476920078.png

 

The CS Signal is always High, And clock signal is always output.The next is qspi-clock signal:

lianyan_4-1759477080929.png

 

My Question is:

1、When I Start QSPI transmit-receive in main() function, It will always work, no stop. It's CS-signal always output low and high. Why?

2、When I Start QSPI transmit-receive in FreeRTOS thread, It does not work, CS-signal is always High, and clock is always output.

I Have No Idea to solve it after many trial, Could You Have Some Idea?

    This topic has been closed for replies.
    Best answer by Saket_Om

    Hello @lianyan 

    What is the error you are getting? 

    Using polling mode in an RTOS environment is not ideal, as it blocks the thread and can be preempted by higher-priority tasks. For QSPI operations, consider using interrupt or DMA modes, which are more suitable and efficient for RTOS-based applications.

    2 replies

    ST Employee
    October 3, 2025

    Hello @lianyan 

    You can check the example for QSPI on the STM32H747I-EVAL board available on GitHub (STM32CubeH7/Projects/STM32H747I-EVAL/Examples/QSPI/QSPI_MemoryMappedDual at master · STMicroelectronics/STM32CubeH7 · GitHub ) . It’s a simple and well-structured example that can help you verify and validate your QSPI configuration effectively. Reviewing this example could give you a reference point for your implementation.

     

    Br

    lianyanAuthor
    Visitor II
    October 3, 2025

    After My Test,I Can Confirm:QSPI will work OK when before osKernelInitialize() and osThreadNew() function; Not Ok when QSPI work after osKernelInitialize() and osThreadNew() function, also not ok when work in thread.

    lianyan_0-1759498378683.png

    The below figure, is CSn signal, period is 1s, matched The code function

    lianyan_1-1759498395099.png

     

    Technical Moderator
    October 7, 2025

    Hello @lianyan 

    Could you please provide your current interrupt priority settings? The QSPI interrupt priorities should be configured with a lower priority (that is, a higher numerical value) than those assigned to the OS kernel.

    lianyanAuthor
    Visitor II
    October 7, 2025

    Hello,

    As you can see in source code, I do not use interrupt for QSPI.