Assert on locking mutex in ISR

Hello,
I'm facing the assertion error because some part of the code tries to lock the mutex from the ISR context.
I would like to hunt this ISR down, the xpsr from the assertion log is 0x41000025 but I'm not able to map this 0x25 to the ISR. Where can I find some kind of mapping of ISRs to IDs?


ASSERTION FAIL [!arch_is_in_isr()] @ WEST_TOPDIR/zephyr/kernel/mutex.c:101
mutexes cannot be used inside ISRs
[00:02:04.075,195] <err> os: r0/a1: 0x00000004 r1/a2: 0x00000065 r2/a3: 0x00000003
[00:02:04.075,225] <err> os: r3/a4: 0x20007028 r12/ip: 0x00000014 r14/lr: 0x000389ab
[00:02:04.075,225] <err> os: xpsr: 0x41000025
[00:02:04.075,256] <err> os: Faulting instruction address (r15/pc): 0x0004e11c
[00:02:04.075,286] <err> os: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
[00:02:04.075,286] <err> os: Fault during interrupt handling

  • Enable these in your prj.conf to get more details on the assert.

    # Debugging configuration
    CONFIG_THREAD_NAME=y
    CONFIG_THREAD_ANALYZER=y
    CONFIG_THREAD_ANALYZER_AUTO=y
    CONFIG_THREAD_ANALYZER_RUN_UNLOCKED=y
    CONFIG_THREAD_ANALYZER_USE_PRINTK=y
    
    # Add asserts
    CONFIG_ASSERT=y
    CONFIG_ASSERT_VERBOSE=y
    CONFIG_ASSERT_NO_COND_INFO=n
    CONFIG_ASSERT_NO_MSG_INFO=n
    CONFIG_RESET_ON_FATAL_ERROR=n
    CONFIG_THREAD_NAME=y

    I think might have just implemented some callback function that is being called in the isr context from the driver. You are the best to know which callback function you just implemented/enhanced before getting this error. 

Related