cancel
Showing results for 
Search instead for 
Did you mean: 

Suspending and resuming touchgfx task.

AKG
Associate III

I am trying to use the external QSPI flash to store some contents while touchgfx is running.

I believe the correct procedure to do is:

Suspend touchgfx task.

Disable interrupts(LTDC and DMA2D)

switch QSPI to indirect mode

perform write to QSPI

switch QSPI to memory mapped mode

enable interrupts (LTDC and DMA2D)

Resume touchgfx task

I am following above procedure but the device restarts approximately after 90 seconds of suspending the touchgfx task. Even though there is no write operation to QSPI.

I would like to know if the above mentioned procedure is correct ?

also what would be correct place to suspend and resume the task ?

Note: we are using EMBOS.

@Martin KJELDSEN​ it would be helpful if you could provide some tips here.

12 REPLIES 12

Two Functions are required:

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

void MyEnableInterrupt(void)
{
NVIC_EnableIRQ(DMA2D_IRQn);
NVIC_EnableIRQ(LTDC_IRQn);
}
/* USER CODE END PFP */


I created two functions in the file: app_touchgfx.c and called this function from any other .c file.

The important thing is to publish the prototype of the function where it is called.

Before writing data to QSPI, I turn off the DMA2D and LTDC interrupts.
After this I reconfigure the QSPI to normal access mode,
perform the recording of the data I want to record. After recording,
I reconfigure the QSPI to mapped mode and reconfigure the DMA2D and LTDC interrupts.

Thank you,

My worries is that the application itself is running from the QSPI so I guess that you will need to jump away (execute from bootblock or RAM) while erasing and writing to the QSPI right ? Or do you rely on MCU being able to cache the code from the QSPI area ?

In the case of my application all the code is executed on the MCU flash,
only the touchgfx data and configuration data of my application are saved on the QSPI external flash.
I use image and text data from the lcd on external flash and eventually need to change product configuration data that is also on the external flash.


And from now on, for DMA2D and LTDC ISR, I can record data to the external
flash in normal mode and again go back to mapped mode to get back to touchgfx interrupts.
And from now on, for DMA2D and LTDC ISR, I can record data to the external flash in normal mode and again go back to mapped mode
to get back to touchgfx interrupts. It's already working in no problem.
It's already working in no problem. But this operation writes data on the external flash It is rare to occur.