zephyr: MPU fault with STM32L452

I have a customized application modified based on webusb (loopback) app. I am seeing this MPU fault quite a lot.

[00:00:00.007,000] <err> os: ***** MPU FAULT *****
[00:00:00.007,000] <err> os:   Instruction Access Violation
[00:00:00.007,000] <err> os: r0/a1:  0x00000000  r1/a2:  0x00000002  r2/a3:  0x1fff3f3b
[00:00:00.007,000] <err> os: r3/a4:  0xedf7ff20 r12/ip:  0x200041c0 r14/lr:  0x0800ab23
[00:00:00.007,000] <err> os:  xpsr:  0x60000053
[00:00:00.007,000] <err> os: r4/v1:  0x1fff3ef1  r5/v2:  0x00000000  r6/v3:  0x00000002
[00:00:00.007,000] <err> os: r7/v4:  0x20000a4c  r8/v5:  0x20004280  r9/v6:  0x20004c00
[00:00:00.007,000] <err> os: r10/v7: 0x08006a71  r11/v8: 0x00000001    psp:  0x20004180
[00:00:00.007,000] <err> os: Faulting instruction address (r15/pc): 0xedf7ff20
[00:00:00.007,000] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
[00:00:00.007,000] <err> os: Fault during interrupt handling

[00:00:00.007,000] <err> os: Current thread: 0x200005b8 (unknown)
[00:00:00.199,000] <err> os: Halting system

Not sure what address 0xedf7ff20 is.

Here is the decode for the LR register:

$ /cb/toolchains/gnu-arm-embedded/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-addr2line -f -e uc/stm32_mcu_app/build/zephyr/zephyr.elf 0x0800ab23
signal_poll_event
/net/qin-dev/srv/nfs/qin-data/ws/platform.latest/uc/zephyr-os/zephyr/kernel/poll.c:390

380 static int signal_poll_event(struct k_poll_event *event, uint32_t state)
381 {
382         struct _poller *poller = event->poller;
383         int retcode = 0;
384
385         if (poller) {
386                 if (poller->cb != NULL) {
387                         retcode = poller->cb(event, state);
388                 }
389
390                 poller->is_polling = false;
391
392                 if (retcode < 0) {
393                         return retcode;
394                 }
395         }
396
397         set_event_ready(event, state);
398         return retcode;
399 }

Sometime, adding an extra log message could cause this fault to occur. And adding a delay may also change the behavior. Do you have any idea what could be causing this issue?

Thanks, Qin

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

@erwango Sure I’ll close it. Will open when I can reproduce the issue again.

@erwango I’ll try it out in the next day or two and get back to you.