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

Teensy 4.0 compile errors #24

Open
EnderDragonEP opened this issue Sep 28, 2022 · 5 comments
Open

Teensy 4.0 compile errors #24

EnderDragonEP opened this issue Sep 28, 2022 · 5 comments

Comments

@EnderDragonEP
Copy link

EnderDragonEP commented Sep 28, 2022

I keeps getting this errors while compile the firmware for teensy 4.0.
And topics /odom/unfiltered and /imu/data are missing after running the micro-ROS agent.

image

Terminal logs:

Building micro-ROS library
Found 99 compatible libraries
Scanning dependencies...
Dependency Graph
|-- micro_ros_platformio @ 0.0.1+sha.22cf9b6
|-- encoder
|-- imu
|   |-- Wire @ 1.0
|   |-- micro_ros_platformio @ 0.0.1+sha.22cf9b6
|-- kinematics
|-- motor
|   |-- Servo @ 1.1.2
|-- odometry
|   |-- micro_ros_platformio @ 0.0.1+sha.22cf9b6
|-- pid
Building in release mode
Compiling .pio/build/teensy40/src/firmware.ino.cpp.o
Compiling .pio/build/teensy40/lib640/micro_ros_platformio/platform_code/arduino/clock_gettime.cpp.o
Compiling .pio/build/teensy40/lib640/micro_ros_platformio/platform_code/arduino/serial/micro_ros_transport.cpp.o
Compiling .pio/build/teensy40/lib81a/encoder/encoder.cpp.o
Compiling .pio/build/teensy40/lib0e1/Wire/Wire.cpp.o
Archiving .pio/build/teensy40/lib640/libmicro_ros_platformio.a
Archiving .pio/build/teensy40/lib81a/libencoder.a
Indexing .pio/build/teensy40/lib640/libmicro_ros_platformio.a
/home/jetson/linorobot2_hardware/firmware/src/firmware.ino: In function 'bool destroyEntities()':
/home/jetson/linorobot2_hardware/firmware/src/firmware.ino:222:47: warning: ignoring return value of 'rcl_ret_t rcl_publisher_fini(rcl_publisher_t*, rcl_node_t*)', declared with attribute warn_unused_result [-Wunused-result]
     rcl_publisher_fini(&odom_publisher, &node);
                                               ^
/home/jetson/linorobot2_hardware/firmware/src/firmware.ino:223:46: warning: ignoring return value of 'rcl_ret_t rcl_publisher_fini(rcl_publisher_t*, rcl_node_t*)', declared with attribute warn_unused_result [-Wunused-result]
     rcl_publisher_fini(&imu_publisher, &node);
                                              ^
/home/jetson/linorobot2_hardware/firmware/src/firmware.ino:224:52: warning: ignoring return value of 'rcl_ret_t rcl_subscription_fini(rcl_subscription_t*, rcl_node_t*)', declared with attribute warn_unused_result [-Wunused-result]
     rcl_subscription_fini(&twist_subscriber, &node);
                                                    ^
/home/jetson/linorobot2_hardware/firmware/src/firmware.ino:225:25: warning: ignoring return value of 'rcl_ret_t rcl_node_fini(rcl_node_t*)', declared with attribute warn_unused_result [-Wunused-result]
     rcl_node_fini(&node);
                         ^
/home/jetson/linorobot2_hardware/firmware/src/firmware.ino:226:35: warning: ignoring return value of 'rcl_ret_t rcl_timer_fini(rcl_timer_t*)', declared with attribute warn_unused_result [-Wunused-result]
     rcl_timer_fini(&control_timer);
                                   ^
Indexing .pio/build/teensy40/lib81a/libencoder.a
Compiling .pio/build/teensy40/lib0e1/Wire/WireIMXRT.cpp.o
Compiling .pio/build/teensy40/lib0e1/Wire/WireKinetis.cpp.o
Compiling .pio/build/teensy40/lib0e1/Wire/utility/twi.c.o
Compiling .pio/build/teensy40/lib443/imu/ADXL345.cpp.o
Compiling .pio/build/teensy40/lib443/imu/HMC5883L.cpp.o
Archiving .pio/build/teensy40/lib0e1/libWire.a
Indexing .pio/build/teensy40/lib0e1/libWire.a
Compiling .pio/build/teensy40/lib443/imu/I2Cdev.cpp.o
Compiling .pio/build/teensy40/lib443/imu/ITG3200.cpp.o
Compiling .pio/build/teensy40/lib443/imu/MPU6050.cpp.o
Compiling .pio/build/teensy40/lib443/imu/MPU9150.cpp.o
Compiling .pio/build/teensy40/lib443/imu/MPU9250.cpp.o
Compiling .pio/build/teensy40/libe32/kinematics/kinematics.cpp.o
Archiving .pio/build/teensy40/libe32/libkinematics.a
Indexing .pio/build/teensy40/libe32/libkinematics.a
Compiling .pio/build/teensy40/lib813/Servo/Servo.cpp.o
Archiving .pio/build/teensy40/lib813/libServo.a
Indexing .pio/build/teensy40/lib813/libServo.a
Compiling .pio/build/teensy40/libf69/odometry/odometry.cpp.o
lib/imu/MPU9150.cpp: In member function 'bool MPU9150::writeMemoryBlock(const uint8_t*, uint16_t, uint8_t, uint8_t, bool, bool)':
lib/imu/MPU9150.cpp:2992:14: warning: 'verifyBuffer' may be used uninitialized in this function [-Wmaybe-uninitialized]
     uint8_t *verifyBuffer;
              ^
Compiling .pio/build/teensy40/lib7aa/pid/pid.cpp.o
lib/imu/MPU9250.cpp: In member function 'bool MPU9250::writeMemoryBlock(const uint8_t*, uint16_t, uint8_t, uint8_t, bool, bool)':
lib/imu/MPU9250.cpp:2999:14: warning: 'progBuffer' may be used uninitialized in this function [-Wmaybe-uninitialized]
     uint8_t *progBuffer;
              ^
lib/imu/MPU9250.cpp:2998:14: warning: 'verifyBuffer' may be used uninitialized in this function [-Wmaybe-uninitialized]
     uint8_t *verifyBuffer;
              ^
Compiling .pio/build/teensy40/FrameworkArduino/AudioStream.cpp.o
lib/imu/MPU9250.cpp: In member function 'bool MPU9250::writeDMPConfigurationSet(const uint8_t*, uint16_t, bool)':
lib/imu/MPU9250.cpp:3104:101: warning: 'progBuffer' may be used uninitialized in this function [-Wmaybe-uninitialized]
                 if (sizeof(progBuffer) < length) progBuffer = (uint8_t *)realloc(progBuffer, length);
                                                                                                     ^
Archiving .pio/build/teensy40/lib443/libimu.a
Indexing .pio/build/teensy40/lib443/libimu.a
Archiving .pio/build/teensy40/libf69/libodometry.a
Indexing .pio/build/teensy40/libf69/libodometry.a
Compiling .pio/build/teensy40/FrameworkArduino/CrashReport.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/DMAChannel.cpp.o
Archiving .pio/build/teensy40/lib7aa/libpid.a
Indexing .pio/build/teensy40/lib7aa/libpid.a
Compiling .pio/build/teensy40/FrameworkArduino/EventResponder.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial1.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial2.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial3.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial4.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial5.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial6.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial7.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial8.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/IPAddress.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/IntervalTimer.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/Print.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/Stream.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/Time.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/Tone.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/WMath.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/WString.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/analog.c.o
Compiling .pio/build/teensy40/FrameworkArduino/bootdata.c.o
Compiling .pio/build/teensy40/FrameworkArduino/clockspeed.c.o
Compiling .pio/build/teensy40/FrameworkArduino/debugprintf.c.o
Compiling .pio/build/teensy40/FrameworkArduino/delay.c.o
Compiling .pio/build/teensy40/FrameworkArduino/digital.c.o
Compiling .pio/build/teensy40/FrameworkArduino/eeprom.c.o
Compiling .pio/build/teensy40/FrameworkArduino/extmem.c.o
Compiling .pio/build/teensy40/FrameworkArduino/fuse.c.o
Compiling .pio/build/teensy40/FrameworkArduino/interrupt.c.o
Compiling .pio/build/teensy40/FrameworkArduino/keylayouts.c.o
Compiling .pio/build/teensy40/FrameworkArduino/main.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/memcpy-armv7m.S.o
Compiling .pio/build/teensy40/FrameworkArduino/memset.S.o
Compiling .pio/build/teensy40/FrameworkArduino/new.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/nonstd.c.o
Compiling .pio/build/teensy40/FrameworkArduino/pwm.c.o
Compiling .pio/build/teensy40/FrameworkArduino/rtc.c.o
Compiling .pio/build/teensy40/FrameworkArduino/serialEvent.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/serialEvent1.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/serialEvent2.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/serialEvent3.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/serialEvent4.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/serialEvent5.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/serialEvent6.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/serialEvent7.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/serialEvent8.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/serialEventUSB1.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/serialEventUSB2.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/sm_alloc_valid.c.o
Compiling .pio/build/teensy40/FrameworkArduino/sm_calloc.c.o
Compiling .pio/build/teensy40/FrameworkArduino/sm_free.c.o
Compiling .pio/build/teensy40/FrameworkArduino/sm_hash.c.o
Compiling .pio/build/teensy40/FrameworkArduino/sm_malloc.c.o
Compiling .pio/build/teensy40/FrameworkArduino/sm_malloc_stats.c.o
Compiling .pio/build/teensy40/FrameworkArduino/sm_pool.c.o
Compiling .pio/build/teensy40/FrameworkArduino/sm_realloc.c.o
Compiling .pio/build/teensy40/FrameworkArduino/sm_realloc_i.c.o
Compiling .pio/build/teensy40/FrameworkArduino/sm_realloc_move.c.o
Compiling .pio/build/teensy40/FrameworkArduino/sm_szalloc.c.o
Compiling .pio/build/teensy40/FrameworkArduino/sm_util.c.o
Compiling .pio/build/teensy40/FrameworkArduino/sm_zalloc.c.o
Compiling .pio/build/teensy40/FrameworkArduino/startup.c.o
Compiling .pio/build/teensy40/FrameworkArduino/tempmon.c.o
Compiling .pio/build/teensy40/FrameworkArduino/usb.c.o
Compiling .pio/build/teensy40/FrameworkArduino/usb_audio.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/usb_desc.c.o
Compiling .pio/build/teensy40/FrameworkArduino/usb_flightsim.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/usb_inst.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/usb_joystick.c.o
Compiling .pio/build/teensy40/FrameworkArduino/usb_keyboard.c.o
Compiling .pio/build/teensy40/FrameworkArduino/usb_midi.c.o
Compiling .pio/build/teensy40/FrameworkArduino/usb_mouse.c.o
Compiling .pio/build/teensy40/FrameworkArduino/usb_mtp.c.o
Compiling .pio/build/teensy40/FrameworkArduino/usb_rawhid.c.o
Compiling .pio/build/teensy40/FrameworkArduino/usb_seremu.c.o
Compiling .pio/build/teensy40/FrameworkArduino/usb_serial.c.o
Compiling .pio/build/teensy40/FrameworkArduino/usb_serial2.c.o
Compiling .pio/build/teensy40/FrameworkArduino/usb_serial3.c.o
Compiling .pio/build/teensy40/FrameworkArduino/usb_touch.c.o
Compiling .pio/build/teensy40/FrameworkArduino/yield.cpp.o
Archiving .pio/build/teensy40/libFrameworkArduino.a
Indexing .pio/build/teensy40/libFrameworkArduino.a
Linking .pio/build/teensy40/firmware.elf
Checking size .pio/build/teensy40/firmware.elf
Building .pio/build/teensy40/firmware.hex
Configuring upload protocol...
AVAILABLE: jlink, teensy-cli, teensy-gui
CURRENT: upload_protocol = teensy-cli
Rebooting...
Uploading .pio/build/teensy40/firmware.hex
Teensy Loader, Command Line, Version 2.2
Read ".pio/build/teensy40/firmware.hex": 134144 bytes, 6.6% usage
Unable to soft reboot with USB error: Success
Waiting for Teensy device...
 (hint: press the reset button)
Found HalfKay Bootloader
Read ".pio/build/teensy40/firmware.hex": 134144 bytes, 6.6% usage
Programming................................................................................................................................
Booting
======================== [SUCCESS] Took 589.07 seconds ========================

Environment    Status    Duration
-------------  --------  ------------
teensy40       SUCCESS   00:09:49.073
========================= 1 succeeded in 00:09:49.073 =========================
jetson@nano:~/linorobot2_hardware/firmware$ 
@grassjelly
Copy link
Member

is the LED blinking?

@EnderDragonEP
Copy link
Author

is the LED blinking?

No, the LED stay on. But if I use teleop_twist_keyboard to move the robot around, LED start blinking as the serial receive and sending the packages.

@EnderDragonEP
Copy link
Author

Hmm... After I changed to an different IMU but the same model (MPU-9250/6500), the LED start to blink nonstop. What's does the blinking LED means?

@hippo5329
Copy link
Contributor

It could be the IMU failed to initialize. I synced the i2cdev and imu code from upstream i2cdevlib in my port to ESP32. The imu compatibility might be improved. You may try.

@EnderDragonEP
Copy link
Author

It could be the IMU failed to initialize. I synced the i2cdev and imu code from upstream i2cdevlib in my port to ESP32. The imu compatibility might be improved. You may try.

Thanks for your reply! This fix my issue!

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

3 participants