undefined reference to systick_isr - ros-teensy, CMake compile

Status
Not open for further replies.

Spudoom

Member
Hi all,

Running into compilation issues of a test program, using the ros-teensy extension (runs off cmake). In short, I am getting an "undefined reference to systick_isr", and undefined references to EventResponders "firstYield", "runningFromYield" and "lastYield".

Code is as follows:
Code:
#include <Arduino.h>

void setup() {}
void loop() { delay(50); }

Error message:
Code:
make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
lib/libtarget1_TeensyCore.a(mk20dx128.c.obj):(.vectors+0x3c): undefined reference to `systick_isr'
lib/libtarget1_TeensyCore.a(yield.cpp.obj): In function `yield':
yield.cpp:(.text.yield+0x84): undefined reference to `EventResponder::firstYield'
yield.cpp:(.text.yield+0x88): undefined reference to `EventResponder::runningFromYield'
yield.cpp:(.text.yield+0x8c): undefined reference to `EventResponder::lastYield'
collect2: error: ld returned 1 exit status
make[6]: *** [bin/target1.elf] Error 1
make[5]: *** [CMakeFiles/target1.dir/all] Error 2
make[4]: *** [CMakeFiles/target1_Firmware.dir/rule] Error 2
make[3]: *** [target1_Firmware] Error 2
make[2]: *** [CMakeFiles/teensy_test_architecture1_target1_Firmware] Error 2
make[1]: *** [CMakeFiles/teensy_test_architecture1_target1_Firmware.dir/all] Error 2
make: *** [all] Error 2

Arduino version is 1.8.12, Teensyduino version is 1.52, CMake version is 3.5.1

Attached are the two CMakeLists, and detailed output from verbose output of catkin build tool.
View attachment CMakeLists.txt
View attachment CMakeLists.txt
View attachment buildErrorVerbose.txt

Using the Arduino IDE + Teensyduino compiles successfully.
 
Tried rolling back to Arduino IDE 1.6.7, and Teensyduino 1.27, which was listed in the ros-teensy readme. Ended up with the issue mentioned here. Rolled my arm-gcc back to 4.7 which finally worked.
 
It looks like someone needs to do a little chasing here, which is likely with each Teensydino release.

That is if you look at the file: https://github.com/mcgill-robotics/ros-teensy/blob/master/teensy-cmake/teensy-arm.toolchain.cmake

It looks like it is specific for T3.x and has a list of .c and .cpp files to compile. With new releases there are potentially new files that are part of the system.

One such file that is missing is: EventResponder.cpp

Which where the systick_isr is defined...

If it were me setup to try this, I would probably see what version that works and then go to the teensy cores (teensy3) and
do an ls of the .c files and the .cpp files and see if it includes all of them. Probably not as for example probably does not include all of the HardwareSerialX files that were added for T3.5 and T3.6...

But then I would install a new version and do the same thing and get the lists. I would then use an editor to update that list and try it again.
 
Thanks for the help! I went ahead and started comparing the files from different versions and trying to port the ros-teensy toolchain over to teensy 4. I've run into other problems...but I suppose that's for another thread :)
 
Thanks for the help! I went ahead and started comparing the files from different versions and trying to port the ros-teensy toolchain over to teensy 4. I've run into other problems...but I suppose that's for another thread :)

Same thread can work since it is same issue - will show the evolution if desired. Cool either way if you get it updated and working.KurtE might even play along as he loves robots and maybe even the ROS stuff??
 
Cool, link to other thread. I'll link to this thread there if this gets solved.

In summary, I updated the list of files to only those currently in the teensy 4 files. I updated the build flags to those included in boards.txt, and linked the arm math library. I also ran into an issue with the compiler trying to make a test program (issue like this), but couldn't find a way to skip it properly, so I ended up using CMakeForceCompiler as referenced here

I've gotten it to the build step, but it hits an error on startup.c

Code:
[ 22%] Building C object CMakeFiles/target1_TeensyCore.dir/home/defaultUsr/Downloads/arduino-1.8.12/hardware/teensy/avr/cores/teensy4/startup.c.obj
/usr/bin/arm-none-eabi-gcc  -DARDUINO=1812 -DARDUINO_TEENSY40 -DLAYOUT_US_ENGLISH -DTEENSYDUINO=185 -DUSB_PID=null -DUSB_VID=null -D__IMXRT1062__ -I/home/defaultUsr/Downloads/arduino-1.8.12/hardware/teensy/avr/cores/teensy4 -I/home/defaultUsr/catkin_ws/build/teensy_test/ros_lib -I/home/defaultUsr/Downloads/arduino-1.8.12/libraries  -Os -Wall -nostdlib -ffunction-sections -fdata-sections -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 -DTIME_T=1421620748   -MMD -MMD -DUSB_SERIAL -DF_CPU=96000000   -o CMakeFiles/target1_TeensyCore.dir/home/defaultUsr/Downloads/arduino-1.8.12/hardware/teensy/avr/cores/teensy4/startup.c.obj   -c /home/defaultUsr/Downloads/arduino-1.8.12/hardware/teensy/avr/cores/teensy4/startup.c
/tmp/cc6usKMy.s: Assembler messages:
/tmp/cc6usKMy.s:106: Error: unshifted register required -- `orr r1,r1,#21'
/tmp/cc6usKMy.s:111: Error: instruction not supported in Thumb16 mode -- `adds r1,r1,#13'
/tmp/cc6usKMy.s:151: Error: unshifted register required -- `orr r3,r3,#196608'
/tmp/cc6usKMy.s:193: Error: instruction not supported in Thumb16 mode -- `lsls r0,r2,#30'
/tmp/cc6usKMy.s:202: Error: instruction not supported in Thumb16 mode -- `lsls r1,r2,#18'
/tmp/cc6usKMy.s:207: Error: instruction not supported in Thumb16 mode -- `lsls r0,r2,#19'
/tmp/cc6usKMy.s:214: Error: instruction not supported in Thumb16 mode -- `lsls r1,r2,#15'
/tmp/cc6usKMy.s:221: Error: instruction not supported in Thumb16 mode -- `lsls r2,r2,#25'
/tmp/cc6usKMy.s:263: Error: instruction not supported in Thumb16 mode -- `subs r2,r2,#4'
/tmp/cc6usKMy.s:271: Error: instruction not supported in Thumb16 mode -- `subs r2,r2,#4'
/tmp/cc6usKMy.s:277: Error: Thumb does not support this addressing mode -- `ldr r0,[r2,#4]!'
/tmp/cc6usKMy.s:278: Error: Thumb does not support this addressing mode -- `str r0,[r3],#4'
/tmp/cc6usKMy.s:288: Error: Thumb does not support this addressing mode -- `ldr r0,[r2,#4]!'
/tmp/cc6usKMy.s:289: Error: Thumb does not support this addressing mode -- `str r0,[r3],#4'
/tmp/cc6usKMy.s:294: Error: Thumb does not support this addressing mode -- `str r1,[r3],#4'
/tmp/cc6usKMy.s:304: Error: Thumb does not support this addressing mode -- `str r1,[r2,r3,lsl#2]'
/tmp/cc6usKMy.s:305: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#1'
/tmp/cc6usKMy.s:313: Error: Thumb does not support this addressing mode -- `strb r1,[r3],#1'
/tmp/cc6usKMy.s:320: Error: lo register required -- `ldr r9,.L42+128'
/tmp/cc6usKMy.s:321: Error: lo register required -- `ldr r8,.L42+132'
/tmp/cc6usKMy.s:325: Error: lo register required -- `str r9,[r4,#256]'
/tmp/cc6usKMy.s:327: Error: lo register required -- `str r8,[r4,#240]'
/tmp/cc6usKMy.s:329: Error: unshifted register required -- `bic r3,r3,#127'
/tmp/cc6usKMy.s:330: Error: unshifted register required -- `orr r3,r3,#64'
/tmp/cc6usKMy.s:333: Error: unshifted register required -- `bic r3,r3,#127'
/tmp/cc6usKMy.s:334: Error: unshifted register required -- `orr r3,r3,#64'
/tmp/cc6usKMy.s:357: Error: unshifted register required -- `orr r3,r3,#16777216'
/tmp/cc6usKMy.s:361: Error: unshifted register required -- `orr r3,r3,#1'
/tmp/cc6usKMy.s:370: Error: lo register required -- `str r9,[r4,#256]'
/tmp/cc6usKMy.s:372: Error: lo register required -- `str r8,[r4,#240]'
/tmp/cc6usKMy.s:382: Error: unshifted register required -- `orr r3,r3,#12288'
/tmp/cc6usKMy.s:392: Error: instruction not supported in Thumb16 mode -- `lsls r2,r2,#31'
/tmp/cc6usKMy.s:399: Error: unshifted register required -- `orr r2,r2,#1'
/tmp/cc6usKMy.s:403: Error: unshifted register required -- `orr r2,r2,#65537'
/tmp/cc6usKMy.s:480: Error: unshifted register required -- `orr r2,r2,#8'
/tmp/cc6usKMy.s:504: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#1'
/tmp/cc6usKMy.s:517: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#1'
/tmp/cc6usKMy.s:553: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#1'
/tmp/cc6usKMy.s:566: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#1'
/tmp/cc6usKMy.s:580: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#1'
/tmp/cc6usKMy.s:593: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#1'
/tmp/cc6usKMy.s:629: Error: unshifted register required -- `orr r2,r2,#8'
/tmp/cc6usKMy.s:645: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#1'
/tmp/cc6usKMy.s:658: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#1'
/tmp/cc6usKMy.s:818: Error: instruction not supported in Thumb16 mode -- `lsrs r0,r0,#5'
/tmp/cc6usKMy.s:110: Error: immediate value out of range
/tmp/cc6usKMy.s:110: Error: value of 270532608 too large for field of 2 bytes at 60
/tmp/cc6usKMy.s:195: Error: invalid immediate: 49152 is out of range
/tmp/cc6usKMy.s:197: Error: invalid immediate: 65536 is out of range
/tmp/cc6usKMy.s:197: Error: value of 65536 too large for field of 2 bytes at 234
/tmp/cc6usKMy.s:204: Error: invalid immediate: 8192 is out of range
/tmp/cc6usKMy.s:209: Error: invalid immediate: 4096 is out of range
/tmp/cc6usKMy.s:216: Error: invalid immediate: 65536 is out of range
/tmp/cc6usKMy.s:216: Error: value of 65536 too large for field of 2 bytes at 262
/tmp/cc6usKMy.s:249: Error: invalid immediate: 11141120 is out of range
/tmp/cc6usKMy.s:249: Error: value of 11141120 too large for field of 2 bytes at 10
/tmp/cc6usKMy.s:258: Error: invalid offset, value too big (0x00000154)
/tmp/cc6usKMy.s:297: Error: invalid immediate: 15728640 is out of range
/tmp/cc6usKMy.s:297: Error: value of 15728640 too large for field of 2 bytes at 74
/tmp/cc6usKMy.s:317: Error: invalid immediate: -2139062144 is out of range
/tmp/cc6usKMy.s:317: Error: value of -2139062144 too large for field of 2 bytes at 104
/tmp/cc6usKMy.s:319: Error: invalid immediate: -1 is out of range
/tmp/cc6usKMy.s:324: Error: invalid offset, value too big (0x00000104)
/tmp/cc6usKMy.s:326: Error: invalid offset, value too big (0x000000F4)
/tmp/cc6usKMy.s:352: Error: invalid offset, value too big (0xFFFFFFFFFFFFFFFC)
/tmp/cc6usKMy.s:354: Error: invalid offset, value too big (0x00000D0C)
/tmp/cc6usKMy.s:368: Error: invalid offset, value too big (0x00000104)
/tmp/cc6usKMy.s:371: Error: invalid offset, value too big (0x000000F4)
/tmp/cc6usKMy.s:386: Error: invalid offset, value too big (0x00000108)
/tmp/cc6usKMy.s:387: Error: invalid offset, value too big (0x00000118)
/tmp/cc6usKMy.s:388: Error: invalid offset, value too big (0x00000128)
/tmp/cc6usKMy.s:389: Error: invalid offset, value too big (0x00000138)
/tmp/cc6usKMy.s:390: Error: immediate value out of range
/tmp/cc6usKMy.s:390: Error: value of 327680 too large for field of 2 bytes at 224
/tmp/cc6usKMy.s:419: Error: invalid immediate: 300 is out of range
/tmp/cc6usKMy.s:475: Error: invalid offset, value too big (0x00000148)
/tmp/cc6usKMy.s:477: Error: invalid offset, value too big (0x00000338)
/tmp/cc6usKMy.s:478: Error: immediate value out of range
/tmp/cc6usKMy.s:478: Error: value of 245760 too large for field of 2 bytes at 12
/tmp/cc6usKMy.s:483: Error: invalid offset, value too big (0x00000084)
/tmp/cc6usKMy.s:484: Error: invalid offset, value too big (0x00000088)
/tmp/cc6usKMy.s:495: Error: invalid offset, value too big (0x00000084)
/tmp/cc6usKMy.s:508: Error: invalid offset, value too big (0x00000088)
/tmp/cc6usKMy.s:544: Error: invalid offset, value too big (0x00000084)
/tmp/cc6usKMy.s:557: Error: invalid offset, value too big (0x00000088)
/tmp/cc6usKMy.s:571: Error: invalid offset, value too big (0x00000084)
/tmp/cc6usKMy.s:584: Error: invalid offset, value too big (0x00000088)
/tmp/cc6usKMy.s:624: Error: invalid offset, value too big (0x00000148)
/tmp/cc6usKMy.s:626: Error: invalid offset, value too big (0x00000338)
/tmp/cc6usKMy.s:627: Error: immediate value out of range
/tmp/cc6usKMy.s:627: Error: value of 245760 too large for field of 2 bytes at 28
/tmp/cc6usKMy.s:632: Error: invalid offset, value too big (0x00000084)
/tmp/cc6usKMy.s:636: Error: invalid offset, value too big (0x00000084)
/tmp/cc6usKMy.s:649: Error: invalid offset, value too big (0x00000088)
/tmp/cc6usKMy.s:691: Error: invalid immediate: -1 is out of range
/tmp/cc6usKMy.s:727: Error: invalid immediate: -1 is out of range
/tmp/cc6usKMy.s:740: Error: invalid immediate: 8192 is out of range
/tmp/cc6usKMy.s:768: Error: invalid immediate: -1 is out of range
CMakeFiles/target1_TeensyCore.dir/build.make:350: recipe for target 'CMakeFiles/target1_TeensyCore.dir/home/defaultUsr/Downloads/arduino-1.8.12/hardware/teensy/avr/cores/teensy4/startup.c.obj' failed
make[6]: Leaving directory '/home/defaultUsr/catkin_ws/build/teensy_test/architecture1'
make[6]: *** [CMakeFiles/target1_TeensyCore.dir/home/defaultUsr/Downloads/arduino-1.8.12/hardware/teensy/avr/cores/teensy4/startup.c.obj] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/target1_TeensyCore.dir/all' failed
make[5]: Leaving directory '/home/defaultUsr/catkin_ws/build/teensy_test/architecture1'
make[5]: *** [CMakeFiles/target1_TeensyCore.dir/all] Error 2
CMakeFiles/Makefile2:153: recipe for target 'CMakeFiles/target1_Firmware.dir/rule' failed
make[4]: Leaving directory '/home/defaultUsr/catkin_ws/build/teensy_test/architecture1'
make[4]: *** [CMakeFiles/target1_Firmware.dir/rule] Error 2
Makefile:144: recipe for target 'target1_Firmware' failed
make[3]: Leaving directory '/home/defaultUsr/catkin_ws/build/teensy_test/architecture1'
make[3]: *** [target1_Firmware] Error 2
CMakeFiles/teensy_test_architecture1_target1_Firmware.dir/build.make:57: recipe for target 'CMakeFiles/teensy_test_architecture1_target1_Firmware' failed
make[2]: Leaving directory '/home/defaultUsr/catkin_ws/build/teensy_test'
make[2]: *** [CMakeFiles/teensy_test_architecture1_target1_Firmware] Error 2
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/teensy_test_architecture1_target1_Firmware.dir/all' failed
make[1]: Leaving directory '/home/defaultUsr/catkin_ws/build/teensy_test'
make[1]: *** [CMakeFiles/teensy_test_architecture1_target1_Firmware.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

I've attached the toolchain file im using.
View attachment teensy-arm.toolchain.cmake.txt
 
quick guess - check compiler flags used - if the same being presented - the toolchain may be using them differently?
 
I've set the compiler flags using set(CMAKE_C_FLAGS etc) and set(CMAKE_CXX_FLAGS etc) in the toolchain file - am I right in assuming that this then becomes the default for projects compiled using this toolchain?
 
Yes as Tim mentioned, if it were me, I would build same sketch using Arduino IDE and fully compare the compiler options. Also see what versions of the GCC compilers are being used.
 
I enabled verbose compile on Arduino and noticed the frequency was different, which I updated in my toolchain but did not fix it. I noticed that Arduino compiles with -O2, whereas the toolchain had -Os. I changed it to O2 and got a different error message, but in the same file, and still related to assembly:
Code:
/tmp/cc3OdWHr.s: Assembler messages:
/tmp/cc3OdWHr.s:79: Error: invalid register list to push/pop instruction -- `push {r4,r5,r6,r7,r8,r9,r10,fp,lr}'
/tmp/cc3OdWHr.s:83: Error: only lo regs allowed with immediate -- `mov fp,#16'
/tmp/cc3OdWHr.s:85: Error: only lo regs allowed with immediate -- `mov r9,#17'
/tmp/cc3OdWHr.s:86: Error: lo register required -- `ldr r10,.L6+48'
/tmp/cc3OdWHr.s:87: Error: only lo regs allowed with immediate -- `mov ip,#18'
/tmp/cc3OdWHr.s:88: Error: lo register required -- `ldr r8,.L6+52'
/tmp/cc3OdWHr.s:91: Error: unshifted register required -- `orr r1,r1,#21'
/tmp/cc3OdWHr.s:92: Error: lo register required -- `str fp,[r2]'
/tmp/cc3OdWHr.s:93: Error: lo register required -- `ldr lr,.L6+56'
/tmp/cc3OdWHr.s:94: Error: lo register required -- `str r10,[r3]'
/tmp/cc3OdWHr.s:96: Error: lo register required -- `str r9,[r2]'
/tmp/cc3OdWHr.s:98: Error: lo register required -- `str r8,[r3]'
/tmp/cc3OdWHr.s:100: Error: lo register required -- `ldr r10,.L6+60'
/tmp/cc3OdWHr.s:101: Error: lo register required -- `ldr r9,.L6+64'
/tmp/cc3OdWHr.s:102: Error: lo register required -- `ldr r8,.L6+68'
/tmp/cc3OdWHr.s:103: Error: lo register required -- `str ip,[r2]'
/tmp/cc3OdWHr.s:104: Error: lo register required -- `str lr,[r3]'
/tmp/cc3OdWHr.s:105: Error: lo register required -- `ldr ip,.L6+72'
/tmp/cc3OdWHr.s:107: Error: lo register required -- `ldr lr,.L6+76'
/tmp/cc3OdWHr.s:112: Error: lo register required -- `str r10,[r3]'
/tmp/cc3OdWHr.s:115: Error: lo register required -- `ldr r10,.L6+80'
/tmp/cc3OdWHr.s:116: Error: lo register required -- `str r9,[r3]'
/tmp/cc3OdWHr.s:118: Error: lo register required -- `str r8,[r2]'
/tmp/cc3OdWHr.s:119: Error: lo register required -- `ldr r9,.L6+84'
/tmp/cc3OdWHr.s:120: Error: lo register required -- `ldr r8,.L6+88'
/tmp/cc3OdWHr.s:121: Error: lo register required -- `str ip,[r3]'
/tmp/cc3OdWHr.s:122: Error: lo register required -- `str lr,[r2]'
/tmp/cc3OdWHr.s:126: Error: lo register required -- `str r10,[r2]'
/tmp/cc3OdWHr.s:128: Error: lo register required -- `str r9,[r2]'
/tmp/cc3OdWHr.s:129: Error: lo register required -- `str r8,[r3]'
/tmp/cc3OdWHr.s:149: Error: unshifted register required -- `orr r3,r3,#196608'
/tmp/cc3OdWHr.s:151: Error: invalid register list to push/pop instruction -- `pop {r4,r5,r6,r7,r8,r9,r10,fp,pc}'
/tmp/cc3OdWHr.s:198: Error: unshifted register required -- `tst r3,#2'
/tmp/cc3OdWHr.s:205: Error: unshifted register required -- `tst r3,#2'
/tmp/cc3OdWHr.s:208: Error: unshifted register required -- `tst r3,#8192'
/tmp/cc3OdWHr.s:213: Error: unshifted register required -- `tst r3,#4096'
/tmp/cc3OdWHr.s:220: Error: unshifted register required -- `tst r3,#65536'
/tmp/cc3OdWHr.s:225: Error: instruction not supported in Thumb16 mode -- `lsls r3,r3,#25'
/tmp/cc3OdWHr.s:269: Error: instruction not supported in Thumb16 mode -- `mvns r4,r2'
/tmp/cc3OdWHr.s:272: Error: unshifted register required -- `bic r3,r3,#3'
/tmp/cc3OdWHr.s:273: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#4'
/tmp/cc3OdWHr.s:276: Error: Thumb does not support this addressing mode -- `ldr r1,[r0],#4'
/tmp/cc3OdWHr.s:278: Error: Thumb does not support this addressing mode -- `str r1,[r2],#4'
/tmp/cc3OdWHr.s:288: Error: instruction not supported in Thumb16 mode -- `mvns r4,r2'
/tmp/cc3OdWHr.s:291: Error: unshifted register required -- `bic r3,r3,#3'
/tmp/cc3OdWHr.s:292: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#4'
/tmp/cc3OdWHr.s:295: Error: Thumb does not support this addressing mode -- `ldr r1,[r0],#4'
/tmp/cc3OdWHr.s:297: Error: Thumb does not support this addressing mode -- `str r1,[r2],#4'
/tmp/cc3OdWHr.s:304: Error: instruction not supported in Thumb16 mode -- `mvns r0,r2'
/tmp/cc3OdWHr.s:308: Error: unshifted register required -- `bic r3,r3,#3'
/tmp/cc3OdWHr.s:309: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#4'
/tmp/cc3OdWHr.s:312: Error: Thumb does not support this addressing mode -- `str r4,[r1],#4'
/tmp/cc3OdWHr.s:323: Error: Thumb does not support this addressing mode -- `str r2,[r3,#4]!'
/tmp/cc3OdWHr.s:330: Error: Thumb does not support this addressing mode -- `strb r1,[r3],#1'
/tmp/cc3OdWHr.s:337: Error: lo register required -- `ldr r10,.L45+124'
/tmp/cc3OdWHr.s:339: Error: lo register required -- `ldr r9,.L45+128'
/tmp/cc3OdWHr.s:340: Error: only lo regs allowed with immediate -- `mov fp,#99'
/tmp/cc3OdWHr.s:341: Error: lo register required -- `ldr r8,.L45+132'
/tmp/cc3OdWHr.s:344: Error: lo register required -- `str r10,[r3]'
/tmp/cc3OdWHr.s:346: Error: lo register required -- `str r9,[r4,#256]'
/tmp/cc3OdWHr.s:348: Error: lo register required -- `str r8,[r4,#240]'
/tmp/cc3OdWHr.s:350: Error: unshifted register required -- `bic r3,r3,#127'
/tmp/cc3OdWHr.s:351: Error: unshifted register required -- `orr r3,r3,#64'
/tmp/cc3OdWHr.s:354: Error: unshifted register required -- `bic r3,r3,#127'
/tmp/cc3OdWHr.s:355: Error: unshifted register required -- `orr r3,r3,#64'
/tmp/cc3OdWHr.s:363: Error: lo register required -- `ldr ip,.L45+136'
/tmp/cc3OdWHr.s:364: Error: only lo regs allowed with immediate -- `mov lr,#3'
/tmp/cc3OdWHr.s:368: Error: lo register required -- `str fp,[r1]'
/tmp/cc3OdWHr.s:369: Error: lo register required -- `str r5,[ip]'
/tmp/cc3OdWHr.s:370: Error: lo register required -- `str lr,[r0]'
/tmp/cc3OdWHr.s:374: Error: instruction not supported in Thumb16 mode -- `subs r0,r0,#12'
/tmp/cc3OdWHr.s:376: Error: unshifted register required -- `orr r3,r3,#16777216'
/tmp/cc3OdWHr.s:377: Error: lo register required -- `ldr lr,.L45+140'
/tmp/cc3OdWHr.s:378: Error: lo register required -- `ldr ip,.L45+144'
/tmp/cc3OdWHr.s:382: Error: unshifted register required -- `orr r3,r3,#1'
/tmp/cc3OdWHr.s:383: Error: lo register required -- `str lr,[r10,#56]'
/tmp/cc3OdWHr.s:386: Error: lo register required -- `str ip,[r10,#60]'
/tmp/cc3OdWHr.s:391: Error: lo register required -- `str r9,[r4,#256]'
/tmp/cc3OdWHr.s:393: Error: lo register required -- `str r8,[r4,#240]'
/tmp/cc3OdWHr.s:404: Error: unshifted register required -- `orr r1,r1,#12288'
/tmp/cc3OdWHr.s:413: Error: instruction not supported in Thumb16 mode -- `lsls r2,r2,#31'
/tmp/cc3OdWHr.s:420: Error: unshifted register required -- `orr r2,r2,#1'
/tmp/cc3OdWHr.s:426: Error: unshifted register required -- `orr r3,r3,#65537'
/tmp/cc3OdWHr.s:507: Error: instruction not supported in Thumb16 mode -- `orrs r2,r2,r1'
/tmp/cc3OdWHr.s:531: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#1'
/tmp/cc3OdWHr.s:544: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#1'
/tmp/cc3OdWHr.s:588: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#1'
/tmp/cc3OdWHr.s:602: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#1'
/tmp/cc3OdWHr.s:616: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#1'
/tmp/cc3OdWHr.s:630: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#1'
/tmp/cc3OdWHr.s:676: Error: instruction not supported in Thumb16 mode -- `orrs r6,r6,r7'
/tmp/cc3OdWHr.s:688: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#1'
/tmp/cc3OdWHr.s:701: Error: instruction not supported in Thumb16 mode -- `adds r3,r3,#1'
/tmp/cc3OdWHr.s:866: Error: instruction not supported in Thumb16 mode -- `lsrs r0,r0,#5'
/tmp/cc3OdWHr.s:148: Error: invalid offset, value too big (0xFFFFFFFFFFFFFF78)
/tmp/cc3OdWHr.s:150: Error: invalid offset, value too big (0xFFFFFFFFFFFFFF78)
/tmp/cc3OdWHr.s:191: Error: invalid immediate: 65536 is out of range
/tmp/cc3OdWHr.s:191: Error: value of 65536 too large for field of 2 bytes at 170
/tmp/cc3OdWHr.s:192: Error: invalid immediate: 4096 is out of range
/tmp/cc3OdWHr.s:193: Error: invalid immediate: 8192 is out of range
/tmp/cc3OdWHr.s:194: Error: invalid immediate: 49152 is out of range
/tmp/cc3OdWHr.s:248: Error: invalid immediate: 11141120 is out of range
/tmp/cc3OdWHr.s:248: Error: value of 11141120 too large for field of 2 bytes at 2
/tmp/cc3OdWHr.s:260: Error: immediate value out of range
/tmp/cc3OdWHr.s:260: Error: value of 180224 too large for field of 2 bytes at 20
/tmp/cc3OdWHr.s:264: Error: invalid offset, value too big (0x00000154)
/tmp/cc3OdWHr.s:317: Error: invalid immediate: 15728640 is out of range
/tmp/cc3OdWHr.s:317: Error: value of 15728640 too large for field of 2 bytes at 94
/tmp/cc3OdWHr.s:320: Error: immediate value out of range
/tmp/cc3OdWHr.s:334: Error: invalid immediate: -2139062144 is out of range
/tmp/cc3OdWHr.s:334: Error: value of -2139062144 too large for field of 2 bytes at 120
/tmp/cc3OdWHr.s:336: Error: invalid immediate: -1 is out of range
/tmp/cc3OdWHr.s:345: Error: invalid offset, value too big (0x00000104)
/tmp/cc3OdWHr.s:347: Error: invalid offset, value too big (0x000000F4)
/tmp/cc3OdWHr.s:371: Error: immediate value out of range
/tmp/cc3OdWHr.s:373: Error: invalid offset, value too big (0x00000DE8)
/tmp/cc3OdWHr.s:379: Error: invalid offset, value too big (0x00000DE8)
/tmp/cc3OdWHr.s:389: Error: invalid offset, value too big (0x00000104)
/tmp/cc3OdWHr.s:392: Error: invalid offset, value too big (0x000000F4)
/tmp/cc3OdWHr.s:408: Error: invalid offset, value too big (0x00000108)
/tmp/cc3OdWHr.s:409: Error: invalid offset, value too big (0x00000118)
/tmp/cc3OdWHr.s:410: Error: invalid offset, value too big (0x00000128)
/tmp/cc3OdWHr.s:411: Error: invalid offset, value too big (0x00000138)
/tmp/cc3OdWHr.s:440: Error: invalid immediate: 300 is out of range
/tmp/cc3OdWHr.s:501: Error: invalid offset, value too big (0x00000148)
/tmp/cc3OdWHr.s:503: Error: invalid offset, value too big (0x00000338)
/tmp/cc3OdWHr.s:510: Error: invalid offset, value too big (0x00000084)
/tmp/cc3OdWHr.s:511: Error: invalid offset, value too big (0x00000088)
/tmp/cc3OdWHr.s:524: Error: invalid offset, value too big (0x00000084)
/tmp/cc3OdWHr.s:537: Error: invalid offset, value too big (0x00000088)
/tmp/cc3OdWHr.s:581: Error: invalid offset, value too big (0x00000084)
/tmp/cc3OdWHr.s:595: Error: invalid offset, value too big (0x00000088)
/tmp/cc3OdWHr.s:609: Error: invalid offset, value too big (0x00000084)
/tmp/cc3OdWHr.s:623: Error: invalid offset, value too big (0x00000088)
/tmp/cc3OdWHr.s:670: Error: invalid offset, value too big (0x00000148)
/tmp/cc3OdWHr.s:672: Error: invalid offset, value too big (0x00000338)
/tmp/cc3OdWHr.s:679: Error: invalid offset, value too big (0x00000084)
/tmp/cc3OdWHr.s:681: Error: invalid offset, value too big (0x00000084)
/tmp/cc3OdWHr.s:694: Error: invalid offset, value too big (0x00000088)
/tmp/cc3OdWHr.s:742: Error: invalid immediate: -1 is out of range
/tmp/cc3OdWHr.s:775: Error: invalid immediate: -1 is out of range
/tmp/cc3OdWHr.s:788: Error: invalid immediate: 8192 is out of range
/tmp/cc3OdWHr.s:816: Error: invalid immediate: -1 is out of range
CMakeFiles/target1_TeensyCore.dir/build.make:350: recipe for target 'CMakeFiles/target1_TeensyCore.dir/home/nxtgen/Downloads/arduino-1.8.12/hardware/teensy/avr/cores/teensy4/startup.c.obj' failed

All the other flags appear to be the same
 
Managed to fix the build error: I was using an old version of the compiler compared to the Teensyduino (4.9.3 vs 5.4.1). Getting linking errors now, will get back with results.
 
Linker is failing to find the teensy core library after building:

Code:
[ 88%] Linking CXX static library lib/libtarget1_TeensyCore.a
/usr/bin/cmake -P CMakeFiles/target1_TeensyCore.dir/cmake_clean_target.cmake
/usr/bin/cmake -E cmake_link_script CMakeFiles/target1_TeensyCore.dir/link.txt --verbose=1
/home/defaultUsr/Downloads/arduino-1.8.12/hardware/tools/arm/bin/arm-none-eabi-gcc-ar qc lib/libtarget1_TeensyCore.a  CMakeFiles/target1_TeensyCore.dir/home/defaultUsr/Downloads/arduino-1.8.12/hardware/teensy/avr/cores/teensy4/analog.c.obj ... [rest of files]

/home/defaultUsr/Downloads/arduino-1.8.12/hardware/tools/arm/bin/arm-none-eabi-ranlib lib/libtarget1_TeensyCore.a
Error running link command: No such file or directory
CMakeFiles/target1_TeensyCore.dir/build.make:1394: recipe for target 'lib/libtarget1_TeensyCore.a' failed
make[6]: *** [lib/libtarget1_TeensyCore.a] Error 2
make[6]: *** Deleting file 'lib/libtarget1_TeensyCore.a'
make[6]: Leaving directory '/home/defaultUsr/catkin_ws/build/teensy_test/architecture1'
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/target1_TeensyCore.dir/all' failed
make[5]: Leaving directory '/home/defaultUsr/catkin_ws/build/teensy_test/architecture1'
make[5]: *** [CMakeFiles/target1_TeensyCore.dir/all] Error 2
CMakeFiles/Makefile2:153: recipe for target 'CMakeFiles/target1_Firmware.dir/rule' failed
make[4]: Leaving directory '/home/defaultUsr/catkin_ws/build/teensy_test/architecture1'
make[4]: *** [CMakeFiles/target1_Firmware.dir/rule] Error 2
make[3]: *** [target1_Firmware] Error 2
Makefile:144: recipe for target 'target1_Firmware' failed
make[3]: Leaving directory '/home/defaultUsr/catkin_ws/build/teensy_test/architecture1'
CMakeFiles/teensy_test_architecture1_target1_Firmware.dir/build.make:57: recipe for target 'CMakeFiles/teensy_test_architecture1_target1_Firmware' failed
make[2]: Leaving directory '/home/defaultUsr/catkin_ws/build/teensy_test'
make[2]: *** [CMakeFiles/teensy_test_architecture1_target1_Firmware] Error 2
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/teensy_test_architecture1_target1_Firmware.dir/all' failed
make[1]: Leaving directory '/home/defaultUsr/catkin_ws/build/teensy_test'
make[1]: *** [CMakeFiles/teensy_test_architecture1_target1_Firmware.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Library is set to build and linked as dependancy for final executable. The directory seems to be correct too.
 
Status
Not open for further replies.
Back
Top