Question
How to disable TouchGFX reading from external Flash while writting to external flash. Model::tick() stops being executed.
Model::tick() I am using external Flash (16 MB) for storing pictures, texts and fonts for TouchGFX. External flash is also used for storing some parameters using simulated EEprom.
External flash is normaly used in memory mapped mode. Only when storing parameters is memory mapped mode disabled.
If writing to external flash is frequent Model::tick() stops being executed.
This is the task handling writing to in external flash. It gets paramters from a queue.
void UserEEpromTask(void *params)
{
BaseType_t baseType = pdFALSE;
EE_Status ee_status;
while(1)
{
uint8_t EEpromQueueFillLevel = uxQueueMessagesWaiting(Queue_EEpromHandle);
if(EEpromQueueFillLevel > 0){
baseType = xQueueReceive(Queue_EEpromHandle, &eepromQueueMsg, 1);
if ((baseType == pdPASS) && (eepromQueueMsg.id > 0))
{
NVIC_DisableIRQ(DMA2D_IRQn);
NVIC_DisableIRQ(LTDC_IRQn);
taskENTER_CRITICAL();
ExternalFlash_StatusTypeDef stat;
stat = ExtFlash_Abort(&hqspi);
if(stat == EXT_FLASH_OK){
if((ee_status = EE_WriteVariable32bits(eepromQueueMsg.id, eepromQueueMsg.data)) != EE_OK){
if (ee_status == EE_CLEANUP_REQUIRED){
if(EE_CleanUp() != EE_OK)
;//Error_Handler();
}
}
}
stat = ExtFlash_MemoryMap (&hqspi);
taskEXIT_CRITICAL();
NVIC_EnableIRQ(DMA2D_IRQn);
NVIC_EnableIRQ(LTDC_IRQn);
}
}
osDelay(100);
}
}