2017-05-09 02:39 AM
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)
2017-05-09 09:14 AM
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?
2017-05-16 04:49 AM
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.
2017-05-16 10:57 AM
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.