Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Troubles in teensy3 code #1

Closed
Konan33 opened this issue Sep 5, 2020 · 6 comments
Closed

Troubles in teensy3 code #1

Konan33 opened this issue Sep 5, 2020 · 6 comments

Comments

@Konan33
Copy link

Konan33 commented Sep 5, 2020

Hi @danjulio ,

I have some troubles in your teensy3 code. I tried to verify lep_test5 and had errors
lep_test5:265: error: 'IRQ_PORTA' was not declared in this scope SPI.notUsingInterrupt(IRQ_PORTA);
controls:85: error: 'INTERNAL' was not declared in this scope analogReference(INTERNAL);
I couldn't find IRQ_PORTA and INTERNAL variables was declared or have instruction about them. Could you solve it pls. Thank you!

@Konan33 Konan33 changed the title Troubles in teensy3 code Troubles in teensy3 code -label:bug Sep 5, 2020
@Konan33 Konan33 changed the title Troubles in teensy3 code -label:bug Troubles in teensy3 code Sep 5, 2020
@danjulio
Copy link
Owner

danjulio commented Sep 5, 2020

Hello @konan23 ,

INTERNAL and IRQ_PORTA are part of the PJRC Teensy addition to the Arduino environment. Have you included support for the Teensy in your Arduino application? And have you selected "Teensy 3.2/3.1" as your board type?

@Konan33
Copy link
Author

Konan33 commented Sep 9, 2020

Thanks for your reply and after trying to fix something, I still have error about multiple definition. I searched that error come from the overlap between 2 library i2c_t3 and Wire. I tried to deactivate Wire library in source code and header file but it doesn't work. Here is my error message

Arduino: 1.8.13 (Windows 10), TD: 1.53, Board: "Teensy 3.2 / 3.1, Serial, 96 MHz (overclock), Faster, US English"
C:\Users\alta\AppData\Local\Temp\arduino_build_572620\libraries\Wire\WireKinetis.cpp.o: In function 'i2c0_isr':

C:\Program Files (x86)\arduino-1.8.13\hardware\teensy\avr\libraries\Wire/WireKinetis.cpp:912: multiple definition of 'i2c0_isr'

C:\Users\alta\AppData\Local\Temp\arduino_build_572620\libraries\i2c_t3\i2c_t3.cpp.o:C:\Program Files (x86)\arduino-1.8.13\hardware\teensy\avr\libraries\i2c_t3/i2c_t3.cpp:1134: first defined here

c:/program files (x86)/arduino-1.8.13/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: Disabling relaxation: it will not work with multiple definitions

C:\Users\alta\AppData\Local\Temp\arduino_build_572620\libraries\Wire\WireKinetis.cpp.o: In function 'Print::availableForWrite()':

C:\Program` Files (x86)\arduino-1.8.13\hardware\teensy\avr\libraries\Wire/WireKinetis.h:136: multiple definition of 'i2c1_isr'

C:\Users\alta\AppData\Local\Temp\arduino_build_572620\libraries\i2c_t3\i2c_t3.cpp.o:C:\Program Files (x86)\arduino-1.8.13\hardware\teensy\avr\libraries\i2c_t3/i2c_t3.h:883: first defined here

C:\Users\alta\AppData\Local\Temp\arduino_build_572620\libraries\Wire\WireKinetis.cpp.o: In function 'Print::availableForWrite()':

C:\Program Files (x86)\arduino-1.8.13\hardware\teensy\avr\libraries\Wire/WireKinetis.h:136: multiple definition of 'Wire1'

C:\Users\alta\AppData\Local\Temp\arduino_build_572620\libraries\i2c_t3\i2c_t3.cpp.o:C:\Program Files (x86)\arduino-1.8.13\hardware\teensy\avr\libraries\i2c_t3/i2c_t3.h:883: first defined here

c:/program files (x86)/arduino-1.8.13/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: Warning: size of symbol 'Wire1' changed from 20 in

C:\Users\alta\AppData\Local\Temp\arduino_build_572620\libraries\i2c_t3\i2c_t3.cpp.o to 108 in C:\Users\alta\AppData\Local\Temp\arduino_build_572620\libraries\Wire\WireKinetis.cpp.o

C:\Users\alta\AppData\Local\Temp\arduino_build_572620\libraries\Wire\WireKinetis.cpp.o: In function 'Print::availableForWrite()':

C:\Program Files (x86)\arduino-1.8.13\hardware\teensy\avr\libraries\Wire/WireKinetis.h:136: multiple definition of 'Wire'

C:\Users\alta\AppData\Local\Temp\arduino_build_572620\libraries\i2c_t3\i2c_t3.cpp.o:C:\Program Files (x86)\arduino-1.8.13\hardware\teensy\avr\libraries\i2c_t3/i2c_t3.h:883: first defined here

c:/program files (x86)/arduino-1.8.13/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: Warning: size of symbol 'Wire' changed from 20 in

C:\Users\alta\AppData\Local\Temp\arduino_build_572620\libraries\i2c_t3\i2c_t3.cpp.o to 108 in

C:\Users\alta\AppData\Local\Temp\arduino_build_572620\libraries\Wire\WireKinetis.cpp.o

collect2.exe: error: ld returned 1 exit status

Error compiling for board Teensy 3.2 / 3.1.

Could you give me some advice to fix them. Thank you so much!

@danjulio
Copy link
Owner

I'm sorry, I'm not sure I have much to offer you. My LeptonSDKEmb32OEM.cpp file includes i2c_t3. Maybe something else is including either i2c_t3 or wire and there is a collision. All I can suggest is to look at every file and see if you can find a way multiple files are being included.

@Konan33
Copy link
Author

Konan33 commented Sep 12, 2020

Thank you for your help. I will try some cases and hope that it will work. I will give you feedback when I completed it.

@Konan33
Copy link
Author

Konan33 commented Sep 17, 2020

Finally, I debugged it successfully. The new version of Adafruit_GFX_Library contains Adafruit_GrayOLED file and it uses Wire.h to communication so when I compile the code, the program will call it too. Just delete the header and source files of Adafruit_GrayOLED, the program will run.

@danjulio you can close this issue :)))

@danjulio
Copy link
Owner

Glad to hear you fixed it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants