i.MX RT1052 + MPU + FreeRTOS v10 hard fault

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

i.MX RT1052 + MPU + FreeRTOS v10 hard fault

892 Views
cup-a-coffee
Contributor I

I was trying out the Memory Protection Unit (MPU) feature for RT1052 and found it hard faulting with FreeRTOS. We have an in-house, functional MPU + FreeRTOS v10.2.1 solution for Microchip SAME70, so porting to RT1052 was easy.

Some information about the crash:

  • Code runs in XIP on the stock NOR flash on the dev board
  • Code crashing upon creating a privileged FreeRTOS task with statically allocated task stack (from DTCM)
  • Code doesn’t crash when the MPU is not used

 

Fault registers (SCB) dump:
SCB->HFSR  = 0x40000000 (Hard fault)
SCB->CFSR  = 0x01000000 (Configurable fault) -> Usage fault: Illegal unaligned load or store
SCB->DFSR  = 0x00000000 (Debug fault)
SCB->AFSR  = 0x00000000 (Auxiliary fault)
SCB->BFAR  = 0x00000000 (Bus fault address)
SCB->MMFAR = 0x00000000 (MemManage fault address)
SCB->ABFSR = 0x00000000 (Auxiliary bus fault)

 

Questions

  1. Is there an example project with RT105X + MPU + FreeRTOS v10 support? The closest I saw is a BOARD_ConfigMPU() generated from the MCUXpresso project.
  2. Do you have any suggestions regarding the crash?
Labels (1)
Tags (2)
0 Kudos
3 Replies

744 Views
cup-a-coffee
Contributor I

I reviewed all the NXP MPU demo code, but I don't see any that uses a privileged task.

Is there a sample project in the SDK the uses a privileged task in FreeRTOS?

0 Kudos

728 Views
jeremyzhou
NXP Employee
NXP Employee

Hi @cup-a-coffee ,
Sorry for replying late.
As I mentioned before, the SDK library doesn't provide the MPU-enable FreeRTOS demos, and the developers need to port FreeRTOS-MPU demos to RT1052 by themselves.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------

0 Kudos

769 Views
jeremyzhou
NXP Employee
NXP Employee

Hi @cup-a-coffee ,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
1)Is there an example project with RT105X + MPU + FreeRTOS v10 support?
-- Regarding the FreeRTOS, the MPU feature is optional, in the SDK library, it doesn't provide the MPU-enable FreeRTOS demos.
2) Do you have any suggestions regarding the crash?
-- According to the information you provided, I'd like to suggest you refer to FreeRTOS-MPU demos in the library first.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
------------------------------------------------------------------------------

0 Kudos