- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Greetings! I've not been on the forum for several years having done a fair amount with psoc1, but very little if anything with creator. I found a cool application I want to try with this kit that has been in my closet for much too long. I want to use the I2C MPU-6050 3 axis gyro and 3 axis accelerometer on my kid's rc toys. I found a psoc4 project that used the same sensor and had this great header and library code from the 100 project competition for the pioneer kit and had to make some changes to the code to get this far, but I'm getting a duplicate declaration error and I have reached my patience limit. After changing every _t declaration for all int8, uint8, int16, uint16 and uint32 in the project, I changed all the bool types to CYBIT and it still won't compile. I've cleaned and archived the project if anyone has a second to find the super obvious thing that I can't seem to find, I would really appreciate the help. THANKS!!
Solved! Go to Solution.
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your error was to define variavles
uint8 devAddr;
uint8 bufferM[22];
within a .h file. Declare them as external and define them in mpu6050.c Compiles without any errors.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think your project is not complete
not enough describe the multiple functions (IICwriteBit(...)..IICwriteBits(..))
and main.h file, etc. ..
Perhaps you are interested in this information:
Sam's Blog
http://samselectronicsprojects.blogspot.co.uk/
http://samselectronicsprojects.blogspot.ru/2014/07/processing-data-from-mpu-6050.html
https://github.com/EmbeddedSam/MPU-6050/tree/master/Examples
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the links and for taking time to respond. I really appreciate it. The github is where I got the code, but it is/was for psoc4. If the project was complete I would not need help with this. It all compiles, but this is the error during the linking/build:
c51.exe .\mpu6050.c NOIV LARGE MODDP2 OMF2 VB(1) NOIP "INCDIR(., Generated_Source\PSoC3)" FF(3) DB DF(DEBUG) WL(2) PR(.\DP8051\DP8051_Keil_951\Debug/mpu6050.lst) CD OT(2 ,Size) OJ(.\DP8051\DP8051_Keil_951\Debug\mpu6050.obj)
LIBX51.exe TRANSFER '.\DP8051\DP8051_Keil_951\Debug\cyfitter_cfg.obj', '.\DP8051\DP8051_Keil_951\Debug\I2C_MPU6050.obj', '.\DP8051\DP8051_Keil_951\Debug\I2C_MPU6050_BOOT.obj', '.\DP8051\DP8051_Keil_951\Debug\I2C_MPU6050_INT.obj', '.\DP8051\DP8051_Keil_951\Debug\I2C_MPU6050_PM.obj', '.\DP8051\DP8051_Keil_951\Debug\I2C_MPU6050_SLAVE.obj', '.\DP8051\DP8051_Keil_951\Debug\I2C_MPU6050_MASTER.obj', '.\DP8051\DP8051_Keil_951\Debug\SERIAL.obj', '.\DP8051\DP8051_Keil_951\Debug\SERIAL_PM.obj', '.\DP8051\DP8051_Keil_951\Debug\SERIAL_INT.obj', '.\DP8051\DP8051_Keil_951\Debug\SERIAL_BOOT.obj', '.\DP8051\DP8051_Keil_951\Debug\I2C_SDA.obj', '.\DP8051\DP8051_Keil_951\Debug\I2C_SCL.obj', '.\DP8051\DP8051_Keil_951\Debug\LCD.obj', '.\DP8051\DP8051_Keil_951\Debug\LCD_PM.obj', '.\DP8051\DP8051_Keil_951\Debug\SERIAL_IntClock.obj', '.\DP8051\DP8051_Keil_951\Debug\LCD_LCDPort.obj', '.\DP8051\DP8051_Keil_951\Debug\CyScBoostClk.obj', '.\DP8051\DP8051_Keil_951\Debug\CyBootAsmKeil.obj', '.\DP8051\DP8051_Keil_951\Debug\CyDmac.obj', '.\DP8051\DP8051_Keil_951\Debug\CyFlash.obj', '.\DP8051\DP8051_Keil_951\Debug\CyLib.obj', '.\DP8051\DP8051_Keil_951\Debug\cymem.obj', '.\DP8051\DP8051_Keil_951\Debug\cyPm.obj', '.\DP8051\DP8051_Keil_951\Debug\CySpc.obj', '.\DP8051\DP8051_Keil_951\Debug\cyutils.obj', '.\DP8051\DP8051_Keil_951\Debug\KeilStart.obj' TO '.\DP8051\DP8051_Keil_951\Debug\I2C_test.lib'
LX51.exe '.\DP8051\DP8051_Keil_951\Debug\main.obj', '.\DP8051\DP8051_Keil_951\Debug\mpu6050.obj', '.\DP8051\DP8051_Keil_951\Debug\I2C_test.lib', 'C:\Program Files (x86)\Cypress\PSoC Creator\3.3\PSoC Creator\psoc\content\cycomponentlibrary\CyComponentLibrary.cylib\DP8051\DP8051_Keil_951\Debug\CyComponentLibrary.lib' TO '.\DP8051\DP8051_Keil_951\Debug\I2C_test.omf' CODE RU RC(10) DW(16) WL(2) PR(.\DP8051\DP8051_Keil_951\Debug/I2C_test.map) IX CL(XDATA(X:0x0000-X:0x1FFF)) CL(CODE(C:0x0000-C:0xFFFF)) CL(CONST(C:0x0000-C:0xFFFF))
*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS
SYMBOL: bufferM
MODULE: .\DP8051\DP8051_Keil_951\Debug\mpu6050.obj (MPU6050)
DEFINED: .\DP8051\DP8051_Keil_951\Debug\main.obj (MAIN)
*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS
SYMBOL: devAddr
MODULE: .\DP8051\DP8051_Keil_951\Debug\mpu6050.obj (MPU6050)
DEFINED: .\DP8051\DP8051_Keil_951\Debug\main.obj (MAIN)
Program Size: data=17.1 xdata=1299 const=50 code=7219
The command 'LX51.exe' failed with exit code '2'.
It is complaining about multiple declarations, but I can't find the second declaration... I just need basic functionality, so this is overkill anyway, but I was trying to not reinvent the wheel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your project for CY8C4245AXI-483
I thought at first that you want to debug your project with PSoC4.
PSoC3 does not involve the use of SCB.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Pavloven for looking at the code. I opened your response and it is for the psoc 4, similar to the original project I started with. I'd really like to use psoc 3 for this since the CY8C3866AXI-040 chip is attached to the 030 psoc 3 kit I have. I don't know what SCB is.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks again for your responses. For clarity, I don't have psoc4. I started with a project originally written for the psoc4 but I don't intend to use psoc4. The goal here is to get code from the psoc4 ported to work on the psoc3. Any suggestions on how best to accomplish a working psoc3 device would be appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Orob, the first thing you have to do is to change the device to your PSoC3 you use. under the Project menu you'll fing that choice. Changing the _t to something different is not needed, there is a library for these types, <cytypes.h> will do.
I only saw your PSoC4 project so far. when you've got a PSoC3 one, attach it to your next post.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wow. I archived the project and uploaded what I thought was what I was working on, but it was the backup version before I began to make changes. Sorry for all the confusion.
So far, I changed the device in the device selector (updated posted project in first posting - again apologize for the confusion). The uploaded version that @pavloven posted has the right device and gives the same error I am seeing. I changed the original upload to the current version I'm noodling on, but none of them work yet and both give the error I'm seeing: duplicate declaration somewhere. clicking on the errors does not point to any code specifically though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your error was to define variavles
uint8 devAddr;
uint8 bufferM[22];
within a .h file. Declare them as external and define them in mpu6050.c Compiles without any errors.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Bob!! I changed them to extern in the .h file and it worked. So the key to porting is the cytypes.h file to save from changing all the variable types. Now I'm going to wire it up and see if it actually works. Thanks to bobgoar and pavloven also for taking time to look into the project. Guys, I really appreciate you helping me get past this to move forward.