superbrew 0 Posted January 26, 2014 Share Posted January 26, 2014 Hello, I am trying to write a simple project using an MPU6050. I have built a couple of working projects using this with Energia, but I don't like that IDE. I would like to learn more about how the system actually operates. I am now tring to use CCS and I can't get a simple program to complile. I am getting errors that state that various functions are unresolved symbols. For example, undefined first referenced symbol in file --------- ---------------- MPU6050Init ./project0.obj I have been to build an I2C scanner in CCS that is able to correctly identify the address of the MPU. I have also tried rebuilding sensorlib, which is where the MPU6050 driver is located. Is there something that I am missing? Thanks Quote Link to post Share on other sites
Lyon 3 Posted January 26, 2014 Share Posted January 26, 2014 Hi, You must take two steps: 1) add this line at the beginning of the file where you call MPU6050Init(): #include "sensorlib/mpu6050.h" 2) add the file sensorlib/mpu6050.c to your project. You can add it by just importing to your project or by adding as a symbolic link (when you import this file, observe the "Options" region at the lower part of the importing window. Click "Advanced" and then click on "Create links in the workspace"). This is needed to add also the code for the called functions. L Quote Link to post Share on other sites
superbrew 0 Posted January 26, 2014 Author Share Posted January 26, 2014 Thanks, It worked when I added the MPU6050.c file to my project. Why do I have to do this? I do not have to add any of the driverlib files that I use. Quote Link to post Share on other sites
Lyon 3 Posted January 26, 2014 Share Posted January 26, 2014 Hi, As I said, you need to add the code body of the functions used. In a *.h file, these functions are only declared, i.e. the shape and parameters are shown. As for driverlib, you add the library itself. Here it is not the case, you have only a transducer and not a library. The same thing is the case of UARTPrintf functions, located in uartstdio files. L Quote Link to post Share on other sites
Lyon 3 Posted January 26, 2014 Share Posted January 26, 2014 Hi, One reson more: on Tiva micros, the driverlib is included on-chip, so no need to add it as a lib. L Quote Link to post Share on other sites
spirilis 1,265 Posted January 26, 2014 Share Posted January 26, 2014 Likewise for the driverlib be sure to prepend ROM_ in front of all driverlib calls to ensure it looks for the ROM symbol instead of expecting it in flash. Quote Link to post Share on other sites
superbrew 0 Posted January 26, 2014 Author Share Posted January 26, 2014 Ahh, thanks, I assumed sensorlib was like driverlib. Thanks for the clarification. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.