Delayed Devicetree initialization for connected Sensors

3704.hello_world.zip

Hello, 

I have connected a LSM6DSO sensor to my nRF52805 which is powered via GPIO. At startup zephyr RTOS wants to init the sensor and failed. After a reboot it detects the sensor and it works fine.

 

[00:00:00.000,213] *** Booting Zephyr OS build v3.0.99-ncs1-1  ***
<inf> LSM6DSO: Initialize device LSM6DSO
[00:00:00.002,960] <inf> LSM6DSO: chip id 0x0
[00:00:00.030,303] <inf> BATTERY: Setup AIN9 got 0
[00:00:00.030,303] <inf> BATTERY: Battery setup: 0 1
Hier wird 5 sec gewartet
waiting 2 seconds for pins to get up gpio initialisiert 



===============================================================
Could not find IMU sensor, aborting test.
IMU sensor Ed is not ready, aborting test.
[00:00:14.051,666] <err> os: ***** MPU FAULT *****
[00:00:14.051,696] <err> os:   Instruction Access Violation
[00:00:14.051,727] <err> os: r0/a1:  0x00000000  r1/a2:  0x00000003  r2/a3:  0x00000000
[00:00:14.051,727] <err> os: r3/a4:  0x200036c0 r12/ip:  0x20003614 r14/lr:  0x0000bba9
[00:00:14.051,757] <err> os:  xpsr:  0x21000000
[00:00:14.051,757] <err> os: Faulting instruction address (r15/pc): 0x45f7f4b4
[00:00:14.051,788] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
[00:00:14.051,788] <err> os: Current thread: 0x200019f8 (main)
�[00:00:00.000,213] *** Booting Zephyr OS build v3.0.99-ncs1-1  ***
<inf> LSM6DSO: Initialize device LSM6DSO
[00:00:00.002,868] <inf> LSM6DSO: chip id 0x6c
[00:00:00.112,884] <inf> BATTERY: Setup AIN9 got 0
[00:00:00.112,884] <inf> BATTERY: Battery setup: 0 1
Hier wird 5 sec gewartet
waiting 2 seconds for pins to get up gpio initialisiert 



===============================================================
Bluetooth initialized
Beacon started, advertising as EF:F0:9B:1E:C2:0B (random)
[0:00:11.177]: 2957 mV; 8280 pptt
[0:00:11.221]:-21742.4 hPa
[0:00:11.223]:20 Cel
[0:00:11.225]:-0.008603 rpm
gyro x:-0.033750 dps y:-0.063835 dps z:0.045967 dps
[0:00:11.258]:0 minutes
----------------------------------

My question is: can I somehow control the device tree via an API in order to activate devices after startup process manually? 

Related