2021-09-10 02:40 AM
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.
Solved! Go to Solution.
2021-09-21 12:50 AM
You actually don't have to suspend the TouchGFX task completely. You can simply disable the interrupt that drives TouchGFX forward (perhaps in endFrame() to be sure that TouchGFX is done), set qspi in non-mapped mode, write, etc.
2021-09-10 08:05 AM
void TouchGFXHAL::taskEntry() will NEVER return:
for (;;)
{
OSWrappers::waitForVSync();
backPorchExited();
}
Use a flag to control the loop run or skip ?
I want to know the right answer either.
2021-09-13 12:42 AM
@Xzhiy.1 : thanks for your hint.
I tried to override taskEntry() function and the device doesn't run anymore. Looks like there is something more taskEntry() function is doing.
Are you sure the taskEntry() function does only this much ?
@Martin KJELDSEN or @Romain DIELEMAN :
do you think its a good idea to override taskEntry() and control the touchgfx task ?
2021-09-13 07:22 AM
void TouchGFXHAL::taskEntry() //found in TouchGFXHAL.cpp
{
enableLCDControllerInterrupt();
enableInterrupts();
OSWrappers::waitForVSync();
backPorchExited();
// Turning on display after first frame is rendered
HAL_GPIO_WritePin(GPIOK, GPIO_PIN_7, GPIO_PIN_RESET);
/* Assert display enable LCD_DISP_CTRL pin */
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_2, GPIO_PIN_SET);
/* Assert back light LCD_BL_CTRL pin */
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, GPIO_PIN_SET);
for (;;)
{
OSWrappers::waitForVSync();
backPorchExited();
}
}
I guess the function backPorchExited() render the FrameBuffer after each Vsync received, if you bypass this function, then LCD maybe freezed for the reason of no new picture data rendered to the FrameBuffer, So may modify like some sort of following.
for (;;)
{
OSWrappers::waitForVSync();
if(bypasss_flag) //global, first should be false to make GFX render correctly
{
backPorchExited();
}
}
it has very rare chance to work, I'm a begginer.
2021-09-21 12:50 AM
You actually don't have to suspend the TouchGFX task completely. You can simply disable the interrupt that drives TouchGFX forward (perhaps in endFrame() to be sure that TouchGFX is done), set qspi in non-mapped mode, write, etc.
2022-07-06 01:16 AM
How do I find out what interupt drives TouchGFX so I can disable it?
2022-07-06 01:30 AM
I don't know your concrete project, but in the case of LTDC - look for the LTDC interrupt configuration and implementation in one of the TouchGFX HAL cpp files. The synchronization with the display transfer is usually what drives TouchGFX forward (sometimes it might be a timer).
2023-09-05 12:06 PM
My case is similar to the one described above. And just call: void TouchGFXHAL::disableInterrupts(), then change qspi to normal mode. After writing the data, go back qspi to mapped mode and then call: void TouchGFXHAL::enableInterrupts() and everything went well.
2023-10-17 05:50 AM
Where should this functions be called? within main.c or in application code?
Thanks
2023-10-19 06:20 AM
But what about code execution, I would assume that this code need to reside in bootloader or ram in case where application exitst in QSPI ?