cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DS3 linker error L6218E - LSM6DS3_IO_Read

daithi62
Associate II

Posted on May 09, 2017 at 11:39

I am getting a linker error L6218E when compiling code for the LSM6DS3 Gyroscope. The error points to the LSM6DS3_IO_Read and LSM6DS3_IO_Write functions. These have been declared and are to be imported but there is no definition for them and I am unable to locate any library for them.

My question is - Are there any library out there for these functions in C or must I create one myself?

Error: L6218E: Undefined symbol LSM6DS3_IO_Read (referred from lsm6ds3.o)

3 REPLIES 3

Posted on May 09, 2017 at 18:14

There's going to be a .C file providing them. Simply including a .H file doesn't suffice. Look of a .C with the same name as the .H you are pulling.

Is this mbed library code?

https://github.com/STclab/stm32nucleo-spirit1-lib/blob/master/drivers/x_nucleo_iks01a1/x_nucleo_iks01a1.c

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on May 16, 2017 at 11:49

Thank you Clive,

I read your reply while on holiday and just tried it out this morning.

I have included the .h file and now it fails linking for the IMU_6AXES_IO_Read / Write / Init functions.

There is also a __GPIOA_CLK_ENABLE() linker error which is defined in the code by MEMS_INT1_GPIO_CLK_ENABLE() and another defined by USER_INT_GPIO_CLK_ENABLE(). 

Again I am unable to locate any defined functions. I'm not using the Nucleo but a custom board built for the Gyro on an F1 micro.

Posted on May 16, 2017 at 17:57

Those would be functions from the HAL, you would need to construct your project to pull in the right include files, with suitable defines. I'd expect these to exist in an stm32f1xx_conf_hal.h or similar file, which is project unique.

You might want to review the HAL libraries and examples, and get familiar with how they build, and the files they pull in. Once you are comfortable with that, apply to your own projects.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..