FORCED Hard Fault when sending the "ls" command repeatedly to LittleFS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FORCED Hard Fault when sending the "ls" command repeatedly to LittleFS

499 Views
patriciocohen
Contributor IV

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. RT1020 Flash Operation on FreeRTOS in XIP Mode which I had to translate because it was in chinese. I have attached it in english.
  2. evkmimxrt1060_freertos_hello_flash_operation example
  3. evkmimxrt1060_littlefs_shell example

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

hardfault.png

 

0 Kudos
4 Replies

467 Views
DanielRuvalcaba
NXP TechSupport
NXP TechSupport

Hi,

 

Could you please help me with the following information?

  • What SDK version are you using?
  • Are you trying this in a custom board?

 

Regards,

Daniel.

0 Kudos

465 Views
patriciocohen
Contributor IV

Hi Daniel,

SDK 2.14.1 and a custom board.

Thank you,

Patricio

0 Kudos

400 Views
DanielRuvalcaba
NXP TechSupport
NXP TechSupport

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.

0 Kudos

437 Views
DanielRuvalcaba
NXP TechSupport
NXP TechSupport

Thanks for the input.

Please give me some time to try to replicate this.

 

Regards,

Daniel.