k_sleep on mimxrt1050_evk board


marco.hoefle@...
 

Hello,
I got the job to evaluate zephyr on a mimxrt1050_evk board.
I followed the instructions and could successfully download the hello world sample project.
Next step was to enhance the project with a thread:

void thread_0(void *dummy1, void *dummy2, void *dummy3)
{
    int loops = 1;
    while(1) {
        printk("Loops: %d\n", loops++);
        k_sleep(1000);
    }

}

void start_thread(void)
{
    bool failed = false;

    /* create stack_guard_thread */
    k_thread_create(&thread, stack,
            K_THREAD_STACK_SIZEOF(stack),
            thread_0, (void *)0,
            (void *)failed, NULL, PRIORITY, 0, K_NO_WAIT);
}

The first kprintf is printed out:
SHELL>> ***** Booting Zephyr OS 1.12.0 *****
built: Jun 13 2018 13:30:16
Loops: 1

k_sleep() is never returned.
It seems the CPU is stuck here:
Program received signal SIGTRAP, Trace/breakpoint trap.
isr_tables_syms () at /home/marco/projects/misc/zephyr/arch/common/isr_tables.c:63
63    GEN_ABSOLUTE_SYM(__ISR_LIST_SIZEOF, sizeof(struct _isr_list));

Any hints for me?
Thanks
Marco



marco.hoefle@...
 

I did some further tests,
threads and scheduler are basically working, i used these two functions:

void thread_1(void *dummy1, void *dummy2, void *dummy3)
{
    int loops = 1;
    while(1) {
        for(volatile int i=0; i<100000000; i++);
        printk("1: Loops: %d\n", loops++);
        k_yield();
    }
}


void thread_2(void *dummy1, void *dummy2, void *dummy3)
{
    int loops = 1;
    while(1) {
        for(volatile int i=0; i<100000000; i++);
        printk("2: Loops: %d\n", loops++);
        printk("clk count: %d\n", k_uptime_get());
        k_yield();
    }
}

However,
k_uptime_get returns always 0. Using the the qemu port works.
***** Booting Zephyr OS 1.12.0 *****                                                                                                                                                                                                                                   
built: Jun 13 2018 17:18:51                                                                                                                     
1: Loops: 1                                                                                                                                     
2: Loops: 1                                                                                                                                     
clk count: 0                                                                                                                                    
1: Loops: 2                                                                                                                                     
2: Loops: 2                                                                                                                                     
clk count: 0                                                                                                                                    
1: Loops: 3                                                                                                                                     
2: Loops: 3                                                                                                                                     
clk count: 0                                                                                                                                    
1: Loops: 4

on qemu:
***** Booting Zephyr OS 1.12.0 *****
built: Jun 13 2018 17:14:50
1: Loops: 1
2: Loops: 1
clk count: 1050
1: Loops: 2
2: Loops: 2
clk count: 2120
1: Loops: 3
2: Loops: 3
clk count: 3170
1: Loops: 4

I compared the two zephyr configs but I didn't see the option for the different behavior.



Andy Ross
 

Are you building a tickless kernel?  Note that k_uptime_get_32() requires you to explicitly enable the clock (c.f. k_enable_sys_clock_always_on()) if you want to count ticks.

Andy

From: Marco Hoefle <marco.hoefle@...>
Sent: Wednesday, June 13, 2018 8:30AM
To: Users
Subject: Re: [Zephyr-users] k_sleep on mimxrt1050_evk board
I did some further tests,
threads and scheduler are basically working, i used these two functions:

void thread_1(void *dummy1, void *dummy2, void *dummy3)
{
    int loops = 1;
    while(1) {
        for(volatile int i=0; i<100000000; i++);
        printk("1: Loops: %d\n", loops++);
        k_yield();
    }
}


void thread_2(void *dummy1, void *dummy2, void *dummy3)
{
    int loops = 1;
    while(1) {
        for(volatile int i=0; i<100000000; i++);
        printk("2: Loops: %d\n", loops++);
        printk("clk count: %d\n", k_uptime_get());
        k_yield();
    }
}

However,
k_uptime_get returns always 0. Using the the qemu port works.
***** Booting Zephyr OS 1.12.0 *****                                                                                                                                                                                                                                   
built: Jun 13 2018 17:18:51                                                                                                                     
1: Loops: 1                                                                                                                                     
2: Loops: 1                                                                                                                                     
clk count: 0                                                                                                                                    
1: Loops: 2                                                                                                                                     
2: Loops: 2                                                                                                                                     
clk count: 0                                                                                                                                    
1: Loops: 3                                                                                                                                     
2: Loops: 3                                                                                                                                     
clk count: 0                                                                                                                                    
1: Loops: 4

on qemu:
***** Booting Zephyr OS 1.12.0 *****
built: Jun 13 2018 17:14:50
1: Loops: 1
2: Loops: 1
clk count: 1050
1: Loops: 2
2: Loops: 2
clk count: 2120
1: Loops: 3
2: Loops: 3
clk count: 3170
1: Loops: 4

I compared the two zephyr configs but I didn't see the option for the different behavior.




marco.hoefle@...
 

Hello Andy,
on both ports (qemu and mimxrt1050_evk)
CONFIG_SYS_CLOCK_TICKS_PER_SEC=100 is used.
k_uptime_get_32() is working on both ports, k_uptime_get only on the qemu port.
k_sleep is not working on the mimxrt1050_evk. The behavior is really weird.
when using this thread function:

void thread_1(void *dummy1, void *dummy2, void *dummy3)
{
    int loops = 1;
    while(1) {
//        for(volatile int i=0; i<100000000; i++);
        printk("Thread 1: Loops: %d, uptime: %d\n", loops++, k_uptime_get_32());
        k_sleep(100);
    }
}

The thread is stuck in k_sleep and the shell uptime command is wrong:

***** Booting Zephyr OS 1.12.0 *****
Zephyr Shell, Zephyr version: 1.12.0
Type 'help' for a list of available commands
shell> built: Jun 14 2018 09:41:37
Thread 1: Loops: 1, uptime: 10

shell> select kernel
kernel> uptime
uptime: 10 ms
kernel> uptime
uptime: 10 ms
kernel> uptime


using this thread function everything works as expected:
void thread_1(void *dummy1, void *dummy2, void *dummy3)
{
    int loops = 1;
    while(1) {
        for(volatile int i=0; i<100000000; i++);
        printk("Thread 1: Loops: %d, uptime: %d\n", loops++, k_uptime_get_32());
//        k_sleep(100);
    }
}

***** Booting Zephyr OS 1.12.0 *****
Zephyr Shell, Zephyr version: 1.12.0
Type 'help' for a list of available commands
shell> built: Jun 14 2018 09:44:03
Thread 1: Loops: 1, uptime: 1510
Thread 1: Loops: 2, uptime: 3010
Thread 1: Loops: 3, uptime: 4510
selecThread 1: Loops: 4, uptime: 6020
t kerneThread 1: Loops: 5, uptime: 7520
l
kernel> Thread 1: Loops: 6, uptime: 9020
uptime
uptime: 10250 ms
kernel> Thread 1: Loops: 7, uptime: 10530
uptimeThread 1: Loops: 8, uptime: 12030

uptime: 12170 ms
kernel> upThread 1: Loops: 9, uptime: 13540
time
uptime: 14210 ms
kernel> Thread 1: Loops: 10, uptime: 15040
Thread 1: Loops: 11, uptime: 16540
Thread 1: Loops: 12, uptime: 18050

Marco


marco.hoefle@...
 

I tried now to implement a sleep using the timer api, I think this is broken too.
Again, works on qemu port, doesn't on the mimxrt1050_evk

static void timer_expiry(struct k_timer *work)
{
    printk("timer expired!\n");
}


static void test_timer(void)
{
    k_timer_init(&timer_1, timer_expiry, NULL);
    k_timer_start(&timer_1, K_SECONDS(1), 0);
}


GDB:
(gdb) load /home/marco/projects/avnet/zephyr_demo/sw/build/mimxrt1050_evk/zephyr/zephyr.elf
Loading section text, size 0x4d2a lma 0x0
Loading section .ARM.exidx, size 0x8 lma 0x4d2c
Loading section devconfig, size 0x84 lma 0x4d34
Loading section rodata, size 0xa04 lma 0x4db8
Loading section datas, size 0x6c lma 0x57bc
Loading section initlevel, size 0x84 lma 0x5828
Loading section initshell, size 0x1c lma 0x58ac
Start address 0x32b4, load size 22726
Transfer rate: 88 KB/sec, 2066 bytes/write.
(gdb) break test_timer
Note: breakpoint 3 also set at pc 0xc3c.
Breakpoint 4 at 0xc3c: file /home/marco/projects/avnet/zephyr_demo/sw/src/main.c, line 84.
(gdb) del
Delete all breakpoints? (y or n) y
(gdb) break test_timer
Breakpoint 5 at 0xc3c: file /home/marco/projects/avnet/zephyr_demo/sw/src/main.c, line 84.
(gdb) c
Continuing.

Breakpoint 5, test_timer () at /home/marco/projects/avnet/zephyr_demo/sw/src/main.c:84
84    {
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0xa05f0000 in ?? ()
(gdb)


Nashif, Anas
 

Marco,

Can you please open a bug with the information below?

 

https://github.com/zephyrproject-rtos/zephyr/issues/new

 

Thanks,

Anas

 

From: users@... [mailto:users@...] On Behalf Of marco.hoefle@...
Sent: Thursday, June 14, 2018 4:20 AM
To: users@...
Subject: Re: [Zephyr-users] k_sleep on mimxrt1050_evk board

 

I tried now to implement a sleep using the timer api, I think this is broken too.
Again, works on qemu port, doesn't on the mimxrt1050_evk

static void timer_expiry(struct k_timer *work)
{
    printk("timer expired!\n");
}


static void test_timer(void)
{
    k_timer_init(&timer_1, timer_expiry, NULL);
    k_timer_start(&timer_1, K_SECONDS(1), 0);
}


GDB:
(gdb) load /home/marco/projects/avnet/zephyr_demo/sw/build/mimxrt1050_evk/zephyr/zephyr.elf
Loading section text, size 0x4d2a lma 0x0
Loading section .ARM.exidx, size 0x8 lma 0x4d2c
Loading section devconfig, size 0x84 lma 0x4d34
Loading section rodata, size 0xa04 lma 0x4db8
Loading section datas, size 0x6c lma 0x57bc
Loading section initlevel, size 0x84 lma 0x5828
Loading section initshell, size 0x1c lma 0x58ac
Start address 0x32b4, load size 22726
Transfer rate: 88 KB/sec, 2066 bytes/write.
(gdb) break test_timer
Note: breakpoint 3 also set at pc 0xc3c.
Breakpoint 4 at 0xc3c: file /home/marco/projects/avnet/zephyr_demo/sw/src/main.c, line 84.
(gdb) del
Delete all breakpoints? (y or n) y
(gdb) break test_timer
Breakpoint 5 at 0xc3c: file /home/marco/projects/avnet/zephyr_demo/sw/src/main.c, line 84.
(gdb) c
Continuing.

Breakpoint 5, test_timer () at /home/marco/projects/avnet/zephyr_demo/sw/src/main.c:84
84    {
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0xa05f0000 in ?? ()
(gdb)


Maureen Helm
 

Hi Marco,

Can you please try samples/basic/blinky or samples/synchronization? These samples should work on this board, but I’m currently traveling and don’t have hardware with me to check if they recently got broken.

 

Maureen

 

From: users@... [mailto:users@...] On Behalf Of Nashif, Anas
Sent: Thursday, June 14, 2018 4:29 AM
To: marco.hoefle@...; users@...
Subject: Re: [Zephyr-users] k_sleep on mimxrt1050_evk board

 

Marco,

Can you please open a bug with the information below?

 

https://github.com/zephyrproject-rtos/zephyr/issues/new

 

Thanks,

Anas

 

From: users@... [mailto:users@...] On Behalf Of marco.hoefle@...
Sent: Thursday, June 14, 2018 4:20 AM
To: users@...
Subject: Re: [Zephyr-users] k_sleep on mimxrt1050_evk board

 

I tried now to implement a sleep using the timer api, I think this is broken too.
Again, works on qemu port, doesn't on the mimxrt1050_evk

static void timer_expiry(struct k_timer *work)
{
    printk("timer expired!\n");
}


static void test_timer(void)
{
    k_timer_init(&timer_1, timer_expiry, NULL);
    k_timer_start(&timer_1, K_SECONDS(1), 0);
}


GDB:
(gdb) load /home/marco/projects/avnet/zephyr_demo/sw/build/mimxrt1050_evk/zephyr/zephyr.elf
Loading section text, size 0x4d2a lma 0x0
Loading section .ARM.exidx, size 0x8 lma 0x4d2c
Loading section devconfig, size 0x84 lma 0x4d34
Loading section rodata, size 0xa04 lma 0x4db8
Loading section datas, size 0x6c lma 0x57bc
Loading section initlevel, size 0x84 lma 0x5828
Loading section initshell, size 0x1c lma 0x58ac
Start address 0x32b4, load size 22726
Transfer rate: 88 KB/sec, 2066 bytes/write.
(gdb) break test_timer
Note: breakpoint 3 also set at pc 0xc3c.
Breakpoint 4 at 0xc3c: file /home/marco/projects/avnet/zephyr_demo/sw/src/main.c, line 84.
(gdb) del
Delete all breakpoints? (y or n) y
(gdb) break test_timer
Breakpoint 5 at 0xc3c: file /home/marco/projects/avnet/zephyr_demo/sw/src/main.c, line 84.
(gdb) c
Continuing.

Breakpoint 5, test_timer () at /home/marco/projects/avnet/zephyr_demo/sw/src/main.c:84
84    {
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0xa05f0000 in ?? ()
(gdb)


marco.hoefle@...
 

Hello Maureen,
Sure, I tried blinky and synchronisation.
Both didn't work.

Here the detailed steps:

marco@L-xx:~/projects/misc/zephyr/samples/basic/blinky/build$ export ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk/
marco@L-xx:~/projects/misc/zephyr/samples/basic/blinky/build$ export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
marco@L-xx:~/projects/misc/zephyr/samples/basic/blinky/build$ source ~/projects/misc/zephyr/zephyr-env.sh
marco@L-xx:~/projects/misc/zephyr/samples/basic/blinky/build$ cmake -DBOARD=mimxrt1050_evk ..
CMake Deprecation Warning at /home/marco/projects/misc/zephyr/cmake/app/boilerplate.cmake:38 (cmake_policy):
  The OLD behavior for policy CMP0000 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  CMakeLists.txt:1 (include)


-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.6.5", minimum required is "3.4")
-- Selected BOARD mimxrt1050_evk
Zephyr version: 1.12.0
Parsing Kconfig tree in /home/marco/projects/misc/zephyr/Kconfig
Using /home/marco/projects/misc/zephyr/boards/arm/mimxrt1050_evk/mimxrt1050_evk_defconfig as base
Merging /home/marco/projects/misc/zephyr/samples/basic/blinky/prj.conf
/home/marco/projects/misc/zephyr/samples/basic/blinky/prj.conf:1: warning: GPIO (defined at drivers/gpio/Kconfig:9, /home/marco/projects/misc/zephyr/arch/arm/soc/nordic_nrf/Kconfig.defconfig:15, arch/arm/soc/nxp_imx/mcimx7_m4/Kconfig.defconfig.mcimx7_m4:29, /home/marco/projects/misc/zephyr/arch/arm/soc/nxp_imx/rt/Kconfig.defconfig.mimxrt1052:30, /home/marco/projects/misc/zephyr/arch/arm/soc/nxp_kinetis/k6x/Kconfig.defconfig.mk64f12:36, /home/marco/projects/misc/zephyr/arch/arm/soc/nxp_lpc/lpc54xxx/Kconfig.defconfig.lpc54114_m0:22, /home/marco/projects/misc/zephyr/arch/arm/soc/silabs_exx32/efm32wg/Kconfig.defconfig.efm32wg:15) set more than once. Old value: "y", new value: "y".
/home/marco/projects/misc/zephyr/samples/basic/blinky/prj.conf:2: warning: SERIAL (defined at drivers/serial/Kconfig:9) set more than once. Old value: "y", new value: "n".
warning: OSC_EXTERNAL (defined at /home/marco/projects/misc/zephyr/arch/arm/soc/nxp_kinetis/Kconfig:57) was assigned the value "y" but got the value "n" -- check dependencies
warning: UART_CONSOLE (defined at drivers/console/Kconfig:40) was assigned the value "y" but got the value "n" -- check dependencies
-- Generating zephyr/include/generated/generated_dts_board.h
mimxrt1050_evk.dts_compiled: Warning (unit_address_vs_reg): Node /leds/led@0 has a unit name, but no reg property
mimxrt1050_evk.dts_compiled: Warning (unit_address_vs_reg): Node /gpio_keys/button@0 has a unit name, but no reg property
-- Cache files will be written to: /home/marco/.cache/zephyr
-- The C compiler identification is GNU 6.2.0
-- The CXX compiler identification is GNU 6.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-gcc
-- Performing Test toolchain_is_ok
-- Performing Test toolchain_is_ok - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/marco/projects/misc/zephyr/samples/basic/blinky/build
marco@L-xx:~/projects/misc/zephyr/samples/basic/blinky/build$ make
Scanning dependencies of target kobj_types_h_target
[  1%] Generating include/generated/kobj-types-enum.h, include/generated/otype-to-str.h
[  1%] Built target kobj_types_h_target
Scanning dependencies of target syscall_macros_h_target
[  2%] Generating include/generated/syscall_macros.h
[  2%] Built target syscall_macros_h_target
Scanning dependencies of target syscall_list_h_target
[  3%] Generating always_rebuild
Building for board mimxrt1050_evk
[  4%] Generating misc/generated/syscalls.json
[  5%] Generating include/generated/syscall_dispatch.c, include/generated/syscall_list.h
[  5%] Built target syscall_list_h_target
Scanning dependencies of target driver_validation_h_target
[  6%] Generating include/generated/driver-validation.h
[  6%] Built target driver_validation_h_target
Scanning dependencies of target offsets
[  7%] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
[  8%] Linking C static library liboffsets.a
[  8%] Built target offsets
Scanning dependencies of target offsets_h
[  9%] Generating include/generated/offsets.h
[  9%] Built target offsets_h
Scanning dependencies of target app
[ 10%] Building C object CMakeFiles/app.dir/home/marco/projects/misc/zephyr/lib/libc/minimal/source/stdlib/atoi.c.obj
[ 11%] Building C object CMakeFiles/app.dir/home/marco/projects/misc/zephyr/lib/libc/minimal/source/stdlib/strtol.c.obj
[ 12%] Building C object CMakeFiles/app.dir/home/marco/projects/misc/zephyr/lib/libc/minimal/source/stdlib/strtoul.c.obj
[ 13%] Building C object CMakeFiles/app.dir/home/marco/projects/misc/zephyr/lib/libc/minimal/source/string/strncasecmp.c.obj
[ 14%] Building C object CMakeFiles/app.dir/home/marco/projects/misc/zephyr/lib/libc/minimal/source/string/strstr.c.obj
[ 15%] Building C object CMakeFiles/app.dir/home/marco/projects/misc/zephyr/lib/libc/minimal/source/string/string.c.obj
[ 16%] Building C object CMakeFiles/app.dir/home/marco/projects/misc/zephyr/lib/libc/minimal/source/stdout/prf.c.obj
[ 17%] Building C object CMakeFiles/app.dir/home/marco/projects/misc/zephyr/lib/libc/minimal/source/stdout/stdout_console.c.obj
[ 18%] Building C object CMakeFiles/app.dir/home/marco/projects/misc/zephyr/lib/libc/minimal/source/stdout/sprintf.c.obj
[ 19%] Building C object CMakeFiles/app.dir/home/marco/projects/misc/zephyr/lib/libc/minimal/source/stdout/fprintf.c.obj
[ 20%] Building C object CMakeFiles/app.dir/src/main.c.obj
[ 21%] Linking C static library libapp.a
[ 21%] Built target app
Scanning dependencies of target kernel
[ 22%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/alert.c.obj
[ 23%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/device.c.obj
[ 24%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/errno.c.obj
[ 25%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/idle.c.obj
[ 26%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/init.c.obj
[ 27%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mailbox.c.obj
[ 28%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mem_slab.c.obj
[ 29%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mempool.c.obj
[ 30%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/msg_q.c.obj
[ 31%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mutex.c.obj
[ 32%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/pipes.c.obj
[ 34%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/queue.c.obj
[ 35%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/sched.c.obj
[ 36%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/sem.c.obj
[ 37%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/stack.c.obj
[ 38%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/sys_clock.c.obj
[ 39%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/system_work_q.c.obj
[ 40%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/thread.c.obj
[ 41%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/thread_abort.c.obj
[ 42%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/version.c.obj
[ 43%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/work_q.c.obj
[ 44%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/smp.c.obj
[ 45%] Building C object zephyr/kernel/CMakeFiles/kernel.dir/timer.c.obj
[ 46%] Linking C static library libkernel.a
[ 46%] Built target kernel
Scanning dependencies of target linker_script
[ 47%] Generating linker.cmd
[ 47%] Built target linker_script
Scanning dependencies of target zephyr
[ 48%] Building C object zephyr/CMakeFiles/zephyr.dir/arch/common/isr_tables.c.obj
[ 49%] Building C object zephyr/CMakeFiles/zephyr.dir/arch/arm/soc/nxp_imx/rt/soc.c.obj
[ 50%] Building C object zephyr/CMakeFiles/zephyr.dir/arch/arm/soc/nxp_imx/rt/arm_mpu_regions.c.obj
[ 51%] Building C object zephyr/CMakeFiles/zephyr.dir/lib/thread_entry.c.obj
[ 52%] Building C object zephyr/CMakeFiles/zephyr.dir/lib/crc/crc16_sw.c.obj
[ 53%] Building C object zephyr/CMakeFiles/zephyr.dir/lib/crc/crc8_sw.c.obj
[ 54%] Building C object zephyr/CMakeFiles/zephyr.dir/lib/mempool/mempool.c.obj
[ 55%] Building C object zephyr/CMakeFiles/zephyr.dir/lib/rbtree/rb.c.obj
[ 56%] Building C object zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj
[ 57%] Building C object zephyr/CMakeFiles/zephyr.dir/ext/hal/nxp/mcux/devices/MIMXRT1052/fsl_clock.c.obj
[ 58%] Building C object zephyr/CMakeFiles/zephyr.dir/ext/hal/nxp/mcux/drivers/imx/fsl_gpio.c.obj
[ 59%] Building C object zephyr/CMakeFiles/zephyr.dir/drivers/clock_control/clock_control_mcux_ccm.c.obj
[ 60%] Building C object zephyr/CMakeFiles/zephyr.dir/drivers/timer/sys_clock_init.c.obj
[ 61%] Building C object zephyr/CMakeFiles/zephyr.dir/drivers/timer/cortex_m_systick.c.obj
[ 62%] Linking C static library libzephyr.a
[ 62%] Built target zephyr
Scanning dependencies of target arch__arm__core
[ 63%] Building ASM object zephyr/arch/arm/core/CMakeFiles/arch__arm__core.dir/exc_exit.S.obj
[ 64%] Building C object zephyr/arch/arm/core/CMakeFiles/arch__arm__core.dir/irq_init.c.obj
[ 65%] Building C object zephyr/arch/arm/core/CMakeFiles/arch__arm__core.dir/swap.c.obj
[ 67%] Building ASM object zephyr/arch/arm/core/CMakeFiles/arch__arm__core.dir/swap_helper.S.obj
[ 68%] Building C object zephyr/arch/arm/core/CMakeFiles/arch__arm__core.dir/fault.c.obj
[ 69%] Building C object zephyr/arch/arm/core/CMakeFiles/arch__arm__core.dir/irq_manage.c.obj
[ 70%] Building C object zephyr/arch/arm/core/CMakeFiles/arch__arm__core.dir/thread.c.obj
[ 71%] Building ASM object zephyr/arch/arm/core/CMakeFiles/arch__arm__core.dir/cpu_idle.S.obj
[ 72%] Building ASM object zephyr/arch/arm/core/CMakeFiles/arch__arm__core.dir/fault_s.S.obj
[ 73%] Building C object zephyr/arch/arm/core/CMakeFiles/arch__arm__core.dir/fatal.c.obj
[ 74%] Building C object zephyr/arch/arm/core/CMakeFiles/arch__arm__core.dir/sys_fatal_error_handler.c.obj
[ 75%] Building C object zephyr/arch/arm/core/CMakeFiles/arch__arm__core.dir/thread_abort.c.obj
[ 76%] Building ASM object zephyr/arch/arm/core/CMakeFiles/arch__arm__core.dir/isr_wrapper.S.obj
[ 77%] Linking C static library libarch__arm__core.a
[ 77%] Built target arch__arm__core
Scanning dependencies of target arch__arm__core__cortex_m
[ 78%] Building ASM object zephyr/arch/arm/core/cortex_m/CMakeFiles/arch__arm__core__cortex_m.dir/vector_table.S.obj
[ 79%] Building ASM object zephyr/arch/arm/core/cortex_m/CMakeFiles/arch__arm__core__cortex_m.dir/reset.S.obj
[ 80%] Building ASM object zephyr/arch/arm/core/cortex_m/CMakeFiles/arch__arm__core__cortex_m.dir/nmi_on_reset.S.obj
[ 81%] Building C object zephyr/arch/arm/core/cortex_m/CMakeFiles/arch__arm__core__cortex_m.dir/prep_c.c.obj
[ 82%] Building C object zephyr/arch/arm/core/cortex_m/CMakeFiles/arch__arm__core__cortex_m.dir/scb.c.obj
[ 83%] Building C object zephyr/arch/arm/core/cortex_m/CMakeFiles/arch__arm__core__cortex_m.dir/nmi.c.obj
[ 84%] Building C object zephyr/arch/arm/core/cortex_m/CMakeFiles/arch__arm__core__cortex_m.dir/exc_manage.c.obj
[ 85%] Linking C static library libarch__arm__core__cortex_m.a
[ 85%] Built target arch__arm__core__cortex_m
Scanning dependencies of target arch__arm__core__cortex_m__mpu
[ 86%] Building C object zephyr/arch/arm/core/cortex_m/mpu/CMakeFiles/arch__arm__core__cortex_m__mpu.dir/arm_core_mpu.c.obj
[ 87%] Building C object zephyr/arch/arm/core/cortex_m/mpu/CMakeFiles/arch__arm__core__cortex_m__mpu.dir/arm_mpu.c.obj
[ 88%] Linking C static library libarch__arm__core__cortex_m__mpu.a
[ 88%] Built target arch__arm__core__cortex_m__mpu
Scanning dependencies of target boards__arm__mimxrt1050_evk
[ 89%] Building C object zephyr/boards/boards/arm/mimxrt1050_evk/CMakeFiles/boards__arm__mimxrt1050_evk.dir/pinmux.c.obj
[ 90%] Linking C static library libboards__arm__mimxrt1050_evk.a
[ 90%] Built target boards__arm__mimxrt1050_evk
Scanning dependencies of target drivers__gpio
[ 91%] Building C object zephyr/drivers/gpio/CMakeFiles/drivers__gpio.dir/gpio_mcux_igpio.c.obj
[ 92%] Linking C static library libdrivers__gpio.a
[ 92%] Built target drivers__gpio
Scanning dependencies of target zephyr_prebuilt
[ 93%] Building C object zephyr/CMakeFiles/zephyr_prebuilt.dir/misc/empty_file.c.obj
[ 94%] Linking C executable zephyr_prebuilt.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:        8976 B       128 KB      6.85%
            SRAM:        3844 B       128 KB      2.93%
        IDT_LIST:          84 B         2 KB      4.10%
[ 94%] Built target zephyr_prebuilt
Scanning dependencies of target linker_pass_final_script
[ 95%] Generating linker_pass_final.cmd
[ 95%] Built target linker_pass_final_script
[ 96%] Generating isr_tables.c
Scanning dependencies of target kernel_elf
[ 97%] Building C object zephyr/CMakeFiles/kernel_elf.dir/misc/empty_file.c.obj
[ 98%] Building C object zephyr/CMakeFiles/kernel_elf.dir/isr_tables.c.obj
[100%] Linking C executable zephyr.elf
Generating files from zephyr.elf for board: mimxrt1050_evk

marco@L-xx:~/projects/misc/zephyr/samples/basic/blinky/build$ make debug
[  1%] Built target kobj_types_h_target
[  2%] Built target syscall_macros_h_target
[  3%] Generating always_rebuild
Building for board mimxrt1050_evk
[  4%] Generating misc/generated/syscalls.json
[  5%] Built target syscall_list_h_target
[  6%] Built target driver_validation_h_target
[  8%] Built target offsets
[  9%] Built target offsets_h
[ 33%] Built target kernel
[ 45%] Built target app
[ 46%] Built target linker_script
[ 62%] Built target zephyr
[ 76%] Built target arch__arm__core
[ 84%] Built target arch__arm__core__cortex_m
[ 87%] Built target arch__arm__core__cortex_m__mpu
[ 89%] Built target boards__arm__mimxrt1050_evk
[ 91%] Built target drivers__gpio
[ 93%] Built target zephyr_prebuilt
[ 94%] Built target linker_pass_final_script
[ 98%] Built target kernel_elf
[100%] Debugging mimxrt1050_evk
Using runner: jlink
J-Link GDB server running on port 2331
SEGGER J-Link GDB Server V6.32b Command Line Version

JLinkARM.dll V6.32b (DLL compiled May  8 2018 18:28:22)

-----GDB Server start settings-----
GDBInit file:                  none
GDB Server Listening port:     2331
SWO raw output listening port: 2332
Terminal I/O port:             2333
Accept remote connection:      yes
Generate logfile:              off
Verify download:               off
Init regs on start:            off
Silent mode:                   on
Single run mode:               on
Target connection timeout:     0 ms
------J-Link related settings------
J-Link Host interface:         USB
J-Link script:                 none
J-Link settings file:          none
------Target related settings------
Target device:                 Cortex-M7
Target interface:              SWD
Target interface speed:        auto
Target endian:                 little

GNU gdb (GDB) 7.11.0.20160511-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-pokysdk-linux --target=arm-zephyr-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/marco/projects/misc/zephyr/samples/basic/blinky/build/zephyr/zephyr.elf...done.
Remote debugging using :2331
0xa05f0000 in ?? ()
Resetting target
Loading section text, size 0x2176 lma 0x0
Loading section .ARM.exidx, size 0x8 lma 0x2178
Loading section devconfig, size 0x54 lma 0x2180
Loading section rodata, size 0xc0 lma 0x21d4
Loading section datas, size 0x28 lma 0x2294
Loading section initlevel, size 0x54 lma 0x22bc
Start address 0x14e4, load size 8974
Transfer rate: 83 KB/sec, 1121 bytes/write.
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0xa05f0000 in ?? ()
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0xa05f0000 in ?? ()
(gdb)

(gdb) mon reset 0
Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
(gdb) load ~/projects/misc/zephyr/samples/basic/blinky/build/zephyr/zephyr.elf
Loading section text, size 0x2176 lma 0x0
Loading section .ARM.exidx, size 0x8 lma 0x2178
Loading section devconfig, size 0x54 lma 0x2180
Loading section rodata, size 0xc0 lma 0x21d4
Loading section datas, size 0x28 lma 0x2294
Loading section initlevel, size 0x54 lma 0x22bc
Start address 0x14e4, load size 8974
Transfer rate: 85 KB/sec, 1121 bytes/write.
(gdb) break main.c:37
Note: breakpoint 4 also set at pc 0xbbc.
Breakpoint 5 at 0xbbc: file /home/marco/projects/misc/zephyr/samples/basic/blinky/src/main.c, line 37.
(gdb) c
Continuing.

Breakpoint 3, main () at /home/marco/projects/misc/zephyr/samples/basic/blinky/src/main.c:26
26    {
(gdb) c
Continuing.

Breakpoint 4, main () at /home/marco/projects/misc/zephyr/samples/basic/blinky/src/main.c:37
37            cnt++;
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0xa05f0000 in ?? ()

Marco


marco.hoefle@...
 

Hello Anas,
I will, I just let Maureen have a look first just in case I need to add something to the kernel config or I am doing something wrong.
Marco


Maureen Helm
 

Hi Marco,

This board has two versions, EVK and EVKB, which correspond to different revisions of silicon (A0 and A1, respectively). The EVK board works just fine, but I was able to reproduce the issue on the EVKB board. There does appear to be a problem with the timer, but I’m still investigating.

 

Please go ahead and file a bug so we can track it.

 

Maureen

 

From: users@... [mailto:users@...] On Behalf Of marco.hoefle@...
Sent: Friday, June 15, 2018 12:48 AM
To: users@...
Subject: Re: [Zephyr-users] k_sleep on mimxrt1050_evk board

 

Hello Anas,
I will, I just let Maureen have a look first just in case I need to add something to the kernel config or I am doing something wrong.
Marco


Maureen Helm
 

Hi Marco,

We traced the issue down to a difference in low-power mode behavior between A0 and A1 silicon (EVK and EVKB boards respectively). Please give the following PR a try:

https://github.com/zephyrproject-rtos/zephyr/pull/8535

 

Thanks,

Maureen

 

From: users@... [mailto:users@...] On Behalf Of Maureen Helm
Sent: Monday, June 18, 2018 4:15 PM
To: marco.hoefle@...; users@...
Subject: Re: [Zephyr-users] k_sleep on mimxrt1050_evk board

 

Hi Marco,

This board has two versions, EVK and EVKB, which correspond to different revisions of silicon (A0 and A1, respectively). The EVK board works just fine, but I was able to reproduce the issue on the EVKB board. There does appear to be a problem with the timer, but I’m still investigating.

 

Please go ahead and file a bug so we can track it.

 

Maureen

 

From: users@... [mailto:users@...] On Behalf Of marco.hoefle@...
Sent: Friday, June 15, 2018 12:48 AM
To: users@...
Subject: Re: [Zephyr-users] k_sleep on mimxrt1050_evk board

 

Hello Anas,
I will, I just let Maureen have a look first just in case I need to add something to the kernel config or I am doing something wrong.
Marco


marco.hoefle@...
 

Hello Maureen,
thanks for the fix, now ksleep and timer API work as expected.
Ragreds,
Marco



Von: Maureen Helm [maureen.helm@...]
Gesendet: Freitag, 22. Juni 2018 16:55
An: Hoefle, Marco (Avnet Silica); users@...
Betreff: RE: [Zephyr-users] k_sleep on mimxrt1050_evk board

Hi Marco,

We traced the issue down to a difference in low-power mode behavior between A0 and A1 silicon (EVK and EVKB boards respectively). Please give the following PR a try:

https://github.com/zephyrproject-rtos/zephyr/pull/8535

 

Thanks,

Maureen

 

From: users@... [mailto:users@...] On Behalf Of Maureen Helm
Sent: Monday, June 18, 2018 4:15 PM
To: marco.hoefle@...; users@...
Subject: Re: [Zephyr-users] k_sleep on mimxrt1050_evk board

 

Hi Marco,

This board has two versions, EVK and EVKB, which correspond to different revisions of silicon (A0 and A1, respectively). The EVK board works just fine, but I was able to reproduce the issue on the EVKB board. There does appear to be a problem with the timer, but I’m still investigating.

 

Please go ahead and file a bug so we can track it.

 

Maureen

 

From: users@... [mailto:users@...] On Behalf Of marco.hoefle@...
Sent: Friday, June 15, 2018 12:48 AM
To: users@...
Subject: Re: [Zephyr-users] k_sleep on mimxrt1050_evk board

 

Hello Anas,
I will, I just let Maureen have a look first just in case I need to add something to the kernel config or I am doing something wrong.
Marco