Hi, Im using a nRF52DK to read LIS3DH accelerometer readings in putty. Im new to this platform, I tried couple of example programs like blinkey, uart, and button in BLE. Now Im trying to establish I2C connection between DK and LIS3DH. I found some programs and libraries in github, but they are compatible only with nRF51 series. Then I found this approach in nordic devzone When I try to build this program, I get the following errors. For your reference, I'm using visual studio coder.
c:/program files (x86)/gnu arm embedded toolchain/9 2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\Karthi\Documents\nRF5_SDK\nRF5SDK1702d674dde\nRF5_SDK_17.0.2_d674dde\project\ble_peri\lisnew\pca10040\blank\armgcc/../../../main.c:111: undefined reference to `nrf_twi_sensor_init'
c:/program files (x86)/gnu arm embedded toolchain/9 2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\Karthi\Documents\nRF5_SDK\nRF5SDK1702d674dde\nRF5_SDK_17.0.2_d674dde\project\ble_peri\lisnew\pca10040\blank\armgcc/../../../main.c:114: undefined reference to `lis2dh12_init'
c:/program files (x86)/gnu arm embedded toolchain/9 2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52832_xxaa/main.c.o: in function `lis2dh12_who_am_i_read':
C:\Users\Karthi\Documents\nRF5_SDK\nRF5SDK1702d674dde\nRF5_SDK_17.0.2_d674dde\project\ble_peri\lisnew\pca10040\blank\armgcc/../../../lis2dh12_internal.h:744: undefined reference to `nrf_twi_sensor_reg_read'
collect2.exe: error: ld returned 1 exit status
make: *** [_build/nrf52832_xxaa.out] Error 1
The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command make flash" terminated with exit code: 1.
Let me explain what are the steps I have done.
I used the twi_sensor example and included the lis2dh 12 driver flies in this work space. In the reference able, it is told, both lis2dh and lis3dh have the same spec sheet. So, the code should works with lis3dh sensor.
From what I understand, the sdk_config has to be configured to use this library. I don't know how to configure and what are the drivers and functions I have to enable to do that.
Please help me to fix this. Also, If you think any other approach is simple and efficient, please let me know. Im open to suggestions.