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

datetime lib: Page fault error

I observe issues when trying to use the datetime lib on the board qemu_x86.

I get the following page fault:

[00:00:27.920,000] <err> os: Page fault at address 0x393a24 (error code 0x11)
[00:00:27.920,000] <err> os: Access violation: supervisor thread not allowed to execute
[00:00:27.920,000] <err> os: PTE: 0x393000 -> 0x0000000000393000: RW A D XD 
[00:00:27.920,000] <err> os: EAX: 0x00000000, EBX: 0x003a6b0c, ECX: 0x000f4240, EDX: 0x00392220
[00:00:27.920,000] <err> os: ESI: 0x00000000, EDI: 0x00000202, EBP: 0x0015d179, ESP: 0x0039af3c
[00:00:27.920,000] <err> os: EFLAGS: 0x00000002 CS: 0x0008 CR3: 0x003ac000
[00:00:27.920,000] <err> os: call trace:
[00:00:27.920,000] <err> os: EIP: 0x00393a24
[00:00:27.920,000] <err> os: unaligned frame ptr
[00:00:27.920,000] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
[00:00:27.920,000] <err> os: Current thread: 0x383840 (time_thread)
[00:00:27.920,000] <err> os: Halting system

This is reproducible and happens shorty after successfully calling date_time_update_async.

Can you help me to narrow down the root-cause of this issue?

Setup:

- NRF SDK v1.6.0

- Compiler: zephyr-sdk-0.12.4

I also tested NRF SDK v1.7.0 RC1 and I also tested with a newer version of the compiler suite (which also comes with newer QEMU). The results were the same.

Kind regards,

Michael

Parents Reply Children
  • Have you tried building for nrf9160dk_nrf9160ns?

    On nrf9160dk_nrf9160ns the exception does not occur.

    However, date_time should work on QEMU. Modem-related code is only compiled in if lib is enabled(e.i for nrf91-devices). For QEMU, it should use NTP instead to obtain time. QEMU needs to have internet access:

    We configured QEMU in a way that it has internet access. Connectivity to the internet works (e.g. with http_client library).

    With the addr2lien tool I resolved the address that was reported from the fault. it points to

    /opt/zephyrproject/zephyr/drivers/ethernet/eth_e1000.c:325
    

    Best regards,

    Michael

  • Hi Michael,

    For reference, here is what I found in v1.6.0/zephyr/drivers/ethernet/eth_e1000.c:325:

    ETH_NET_DEVICE_DT_INST_DEFINE(0,
    		    e1000_probe,
    		    NULL,
    		    &e1000_dev,
    		    NULL,
    		    CONFIG_ETH_INIT_PRIORITY,
    		    &e1000_api,
    		    NET_ETH_MTU);

    Also for referece: 'ETH_NET_DEVICE_DT_INST_DEFINE' in the API Reference.

    Could you please check your project's build folder and look for a file named something like qemu_x86.dts.pre.tmp? Do you see anything in this file related to 'Ethernet', 'e1000_probe' or 'e1000'?

    Best regards,

    Håkon

Related