Hi,
In my application I'm using an IMXRT1062 running Freertos and LittleFS. I know about the problems of writing to flash when in XIP mode and I have read the following docs and tried the following examples:
1 and 2 show the use of flash when in XIP mode under FreeRTOS. And 3, shows the use of LittleFS in XIP mode under a baremetal application.
Number 3 disables interrupts using __asm("cpsid i") and __asm("cpsie i"), while 1 and 2 use only FreeRTOS critical sections with taskENTER_CRITICAL() and taskEXIT_CRITICAL()
The document RT1020 Flash Operation on FreeRTOS in XIP Mode recommends to use critical sections only in a FreeRTOS application and not to disable interrupts.
That is why I'm using critical sections in my application, however when I send the "ls" command repeteadly via Teraterm to my board, a hardfault appears (attached screenshot below). It is important to note that this doesn't happen when the commands are sent slowly one after another. The hardfault shown is:
FORCED (30) Indicates a forced hard fault, generated by escalation of a fault with configurable priority that cannot be handled, either because of priority or because it is disabled.
Now if I change the FreeRTOS critical sections with __asm("cpsid i") and __asm("cpsie i"), I can send rapidly "ls" commands without problem, but I read that this method should not be used with FreeRTOS.
In my application, the flexspi driver, the norflash driver and LittleFS are placed in ITCM.
Can someone help me understand what is happening?
The screenshot of the hardfault is below.
Thanks
Patricio
Hi,
Could you please help me with the following information?
Regards,
Daniel.
Hi Daniel,
SDK 2.14.1 and a custom board.
Thank you,
Patricio
Hi @patriciocohen,
Could you please show me a way to try to replicate this in littlefs_shell example? I wan't able to replicate it.
I understand you see this under a debug session. Could you please try without the debug session and tell me if this keeps happening?
Regards,
Daniel.