This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Code crashed inside "otMessageRead" in otCoapSendRequest's callback function

Hi, 

I am using "otCoapSendRequest" to send data to my coap server.

Inside the callback, I am using otMessageRead, to read the response.

But my code crashed inside otMessageRead. If I comment this line then my code runs smoothly.

Following is the crash error:

[00:00:10.472,595] <inf> net_l2_openthread: Got 802.15.4 packet, sending to OT
[00:00:11.433,715] <err> os: r0/a1:  0x00000004  r1/a2:  0x000000d1  r2/a3:  0x00000001
[00:00:11.433,715] <err> os: r3/a4:  0x000139f1 r12/ip:  0x00000000 r14/lr:  0x0000740d
[00:00:11.433,715] <err> os:  xpsr:  0x41000000
[00:00:11.433,746] <err> os: s[ 0]:  0x00000000  s[ 1]:  0x00000000  s[ 2]:  0x00000000  s[ 3]:  0x00000000
[00:00:11.433,746] <err> os: s[ 4]:  0x00000000  s[ 5]:  0x00000000  s[ 6]:  0x00000000  s[ 7]:  0x00000000
[00:00:11.433,746] <err> os: s[ 8]:  0x00000000  s[ 9]:  0x00000000  s[10]:  0x00000000  s[11]:  0x00000000
[00:00:11.433,776] <err> os: s[12]:  0x00000000  s[13]:  0x00000000  s[14]:  0x00000000  s[15]:  0x00000000
[00:00:11.433,776] <err> os: fpscr:  0xaaaaaaaa
[00:00:11.433,776] <err> os: Faulting instruction address (r15/pc): 0x00056520
[00:00:11.433,807] <err> os: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
[00:00:11.433,807] <err> os: Current thread: 0x200018a0 (logging)
[00:00:11.967,010] <err> fatal_error: Resetting system

  • Hello,

    Do you know exactly what function that you added that trigger this fatal error?

    If not, you can look into the tool addr2line from GNU Arm Embedded Toolchain (which you probably have installed, but may not be in your PATH.

    The addresses you want to check using this tool is the address from r15/pc (the actual address may change when you recompile, so check your latest log). In this case it was 0x00056520. To check it, use this in your command line:

    arm-none-eabi-addr2line -e zephyr\zephyr.elf 0x00056520

    from inside your build folder. 

    You can also check the address in r14/lr, which is the address of the function calling the function that triggered the error. 

    What line/function is it pointing to?

    Best regards,

    Edvin

Related