cancel
Showing results for 
Search instead for 
Did you mean: 

QSPI is not working on STM32H747 in FreeRTOS thread

lianyan
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om

View solution in original post

6 REPLIES 6
MOBEJ
ST Employee

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

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
lianyan
Associate II

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

 

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.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om

Hello,

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

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.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om

hello,

In blocking transmit function,It always timeout when waiting for TC and another flags.

I do not use QSPI anymore, and use SPI now.