LSM6DS0, with zephyr shell command, receiving "z_arm_hard_fault"

I'm working on an nrf52840 dk. I need to print the sensor data on the command line. I've added the sensor config to the prj.conf file as well as the sensor and sensor_shell. In the command line, when I type the command, "sensor get LSM6DS0" , I receive a "z_arm_hard_fault". What could be the issue? Anyone?

I'll attach the fault I got.   

Parents Reply Children
  • CONFIG_MPU6050 is commented out in the prj.conf you posted, but I assume you mean that MPU6050 does not work if you include CONFIG_MPU6050=y ?

    Does the LSM6DS0 command work if you remove the mpu6050 node from the overlay and remove CONFIG_MPU6050?

    Remember that you need to run Project->Run CMake in SES after any changes to overlay or prj.conf

  • Yes, it does not work when I include it in the prj file. 

    No, the LSM6DS0 does not. The BME280 works though. I always run cmake when I make changes to these files.

    The label is always detected but then hard fault occurs while fetching data. Should the sensor device be always connected to the board for it work?

  • Also, in some scenarios, the device binding also doesn't work i.e it returns NULL. For the MPU6050, it just shows "Failed to find sensor MPU6050", when I try to run the sample with the sensor connected to the board. Can it be an address issue? 

  • Maybe. It may fix the LSM6DS0 issue if you connect it, but you should be getting an error message, not a hard fault.

    By "fetching data", do you mean that the hard faults occurs when cmd_get_sensor() calls sensor_sample_fetch()? Knowing exactly where the fault occurs would help a lot.

    How are the sensors wired to the board? Make sure you are using the correct pins and that you are using VDD and not nrf_VDD. You can also check that the power source switch on the board is set to VDD.

    Does device_get_binding() work for the LSM6DS0 sensor?

Related