Skip to main content
Associate II
June 12, 2024
Solved

Touchgfx riverdi RTV70HSSFWCA0 QSPI write operation problem

  • June 12, 2024
  • 4 replies
  • 2225 views

Hi all,

I'm trying to write to the QSPI memory but I'm getting two different results... in the first case, if I write all the functions before the call to the osKernelStart() function, I am able to write and read from the QSPI memory. However, in the case where I want to write a value using the CSP_QSPI_Write function, I get a value of 2, which means I can't enable the write function... how to solve all this?

 

In attachment there is a sample where I can show what I do with code.....

 

I hope it is clear.....

Best answer by KDJEM.1

Hello @Sasa1234 ,

 

Which STM32 MCU are you using?

Could you please start with a simple example without TouchGFx. Try to switch from memory mapped mode to other mode. Please make attention for switching operation because there is an errata that must be respected if switching from memory mapped to any other mode using STM32H743 MCU for example.

KDJEM1_0-1719327038716.png

For that please take a look at the MCU errata sheet  section QUADSPI.

Thank you.

Kaouthar

 

4 replies

Tesla DeLorean
Guru
June 12, 2024

You can't Write, or send commands (ie WRITE ENABLE, WRITE PAGE, READ STATUS) whilst in Memory Mapped mode

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Sasa1234Author
Associate II
June 13, 2024

Dear @Tesla DeLorean Thank you for your kind answer...But I am curios...there is a way to exit to memory mapped mode in a task in order to do a write operation?

Thanks again

Sasa1234Author
Associate II
June 17, 2024

Hi guys,

 

I found a solution that can help me and other that can solve this issue.

As I read in similar posts in ST Forum, steps to do are:

 

1) Disable DMA2D and LTDC interrupts.

   /* USER CODE BEGIN PFP */
void MyDisableInterrupt(void)
{
NVIC_DisableIRQ(DMA2D_IRQn);
NVIC_DisableIRQ(LTDC_IRQn);
}

2) Exit to memory mapped mode 

  HAL_QSPI_Abort(&hqspi);

  MX_QSPI_Init()

3) Write a data....

4) Reboot or  reconfigure the QSPI to mapped mode and reconfigure the DMA2D and LTDC interrupts.

 

This idea come from https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/suspending-and-resuming-touchgfx-task/td-p/187744/page/2 but I want to know if this approach will work or not...

Any suggestions will be really appreciated....

Thank you all

 

KDJEM.1
Technical Moderator
June 24, 2024

Hello @Sasa1234 ,

For the QUADSPI interface, in memory-mapped mode, the external flash memory is seen as an internal memory but with some latency during accesses. Only read operations are allowed to the external flash memory in this mode.

For more information I advise you to take a look at Quad-SPI interface on STM32 microcontrollers and microprocessors - Application note 

KDJEM1_0-1719225225701.png

KDJEM1_1-1719225254575.png

For the QUADSPI interface, the write operation is not supported in memory mapped mode.

For the OCTOSPI interface the write operation is supported in memory mapped mode as mentioned in Getting started with Octo-SPI, Hexadeca-SPI, and XSPI Interface on STM32 MCUs - Application note

KDJEM1_2-1719225326245.png

 

Thank you.

Kaouthar

 

 

 

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.
Sasa1234Author
Associate II
June 25, 2024

Hi,

 

Thank you for your clarification...but There is no way to exit from memory mapped mode, and set indirect mode while Touchgfx tasks are stopped? I saw this post and I hope I can use something like this https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/quot-touchgfx-qspi-quot-switching-between-quot-memory-mapped/td-p/298283

 

Any suggestion will be appriciated!!!!!

 

KDJEM.1
KDJEM.1Best answer
Technical Moderator
June 25, 2024

Hello @Sasa1234 ,

 

Which STM32 MCU are you using?

Could you please start with a simple example without TouchGFx. Try to switch from memory mapped mode to other mode. Please make attention for switching operation because there is an errata that must be respected if switching from memory mapped to any other mode using STM32H743 MCU for example.

KDJEM1_0-1719327038716.png

For that please take a look at the MCU errata sheet  section QUADSPI.

Thank you.

Kaouthar

 

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.
Sasa1234Author
Associate II
June 27, 2024

Hi @KDJEM.1,

thank you for your document.... Infact I use STM32H743 for this solution provided by Riverdi.

In order to share my ideas with other users, I want to implement here a sample code. So:

1)  

1) Disable DMA2D and LTDC interrupts.

   /* USER CODE BEGIN PFP */
void MyDisableInterrupt(void)
{
NVIC_DisableIRQ(DMA2D_IRQn);
NVIC_DisableIRQ(LTDC_IRQn);
}

 

2) Exit from memory mapped mode

 

QUADSPI-> CCR & =(~(QUADSPI_CCR_FMODE);

4) Using suggested workaround

5)  Reinitializzation 

 HAL_QSPI_Abort(&hqspi);

  MX_QSPI_Init()

6) Write a data....

I hope it will be clear and correct!!!!

Thank you again!!!!!!