2024-06-12 07:41 AM - last edited on 2024-06-24 02:49 AM by Amel NASRI
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.....
Solved! Go to Solution.
2024-06-25 07:55 AM
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.
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.
2024-06-12 08:44 AM
You can't Write, or send commands (ie WRITE ENABLE, WRITE PAGE, READ STATUS) whilst in Memory Mapped mode
2024-06-13 12:37 AM
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
2024-06-17 12:50 AM
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
2024-06-24 03:37 AM - edited 2024-06-24 03:37 AM
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
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
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.
2024-06-25 07:20 AM - edited 2024-06-25 07:25 AM
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!!!!!
2024-06-25 07:55 AM
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.
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.
2024-06-27 01:23 AM
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!!!!!!