This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

what happened when I create a kernel timer (based on the 32k RTC) by nrf connect sdk on nrf 52840 dk?

what happened when I create a kernel timer (based on the 32k RTC) by nrf connect sdk on nrf 52840 dk?

static const struct k_timer my_timer;
static const struct k_work my_work;

void my_work_handler(struct k_work *work)
{
printk("timer is clock! /n");
}

void my_timer_handler(struct k_timer *dummy)
{
//k_work_submit(&my_work);
//printk("timer is clock! /n");
return;
}

void main(void)
{
int err = 0;
// K_WORK_DEFINE(my_work, my_work_handler);
k_timer_init(&my_timer, my_timer_handler, NULL);
/* start periodic timer that expires once every second */
k_timer_start(&my_timer, K_SECONDS(1), K_SECONDS(1));
...
}

when run the system, the fault information is:

*** Booting Zephyr OS build v2.6.0-rc1-ncs1 ***
[00:00:09.937,286] [1;31m<err> os: ***** USAGE FAULT *****[0m
[00:00:09.937,316] [1;31m<err> os: Illegal use of the EPSR[0m
[00:00:09.937,316] [1;31m<err> os: r0/a1: 0x0002c2a8 r1/a2: 0x200021d0 r2/a3: 0x200021d0[0m
[00:00:09.937,316] [1;31m<err> os: r3/a4: 0x00000000 r12/ip: 0x00033bf7 r14/lr: 0x00023983[0m
[00:00:09.937,316] [1;31m<err> os: xpsr: 0x60000021[0m
[00:00:09.937,347] [1;31m<err> os: Faulting instruction address (r15/pc): 0x00000000[0m
[00:00:09.937,347] [1;31m<err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0[0m
[00:00:09.937,347] [1;31m<err> os: Fault during interrupt handling
[0m
[00:00:09.937,347] [1;31m<err> os: Current thread: 0x200021d0 (unknown)[0m
[00:00:10.211,669] [1;31m<err> fatal_error: Resetting system[0m


thank you very much!

  • Hi,

     

    [00:00:09.937,286] [1;31m<err> os: ***** USAGE FAULT *****[0m
    [00:00:09.937,316] [1;31m<err> os: Illegal use of the EPSR[0m
    [00:00:09.937,316] [1;31m<err> os: r0/a1: 0x0002c2a8 r1/a2: 0x200021d0 r2/a3: 0x200021d0[0m
    [00:00:09.937,316] [1;31m<err> os: r3/a4: 0x00000000 r12/ip: 0x00033bf7 r14/lr: 0x00023983[0m
    [00:00:09.937,316] [1;31m<err> os: xpsr: 0x60000021[0m
    [00:00:09.937,347] [1;31m<err> os: Faulting instruction address (r15/pc): 0x00000000[0m
    [00:00:09.937,347] [1;31m<err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0[0m

     The registers here give you an indication on what the state was when the fault occurred.

    Could you try to resolve the flash mapped addresses using "arm-none-eabi-addr2line"?

    arm-none-eabi-addr2line -e my_build_folder/zephyr/zephyr.elf 0x23983

    arm-none-eabi-addr2line -e my_build_folder/zephyr/zephyr.elf 0x2c2a8

    arm-none-eabi-addr2line -e my_build_folder/zephyr/zephyr.elf 0x33bf7

     

    Kind regards,

    Håkon

Related