1.3.1 can not compile for Arduino Mega

328 views
Skip to first unread message

Stefan Shivarov

unread,
Aug 7, 2018, 3:32:09 AM8/7/18
to LINOROBOT
Hello everybody!
First of all, thank you Juan, for your effort to create and maintain Linorobot opensource!

I downlowded the 1.3.1 tagged version. Compiling the 2WD base firmware as is (i.e. teensy 31) goes fine (on platformio Win10 computer). When i change the target in platformio.ini to:

[env:mega]
platform = atmelavr
framework = arduino
board = megaatmega2560
upload_port = COM8

I get the following errors:

Processing mega (platform: atmelavr; board: megaatmega2560; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: Atmel AVR > Arduino Mega or Mega 2560 ATmega2560 (Mega 2560)
SYSTEM: ATMEGA2560 16MHz 8KB RAM (248KB Flash)
Converting firmware.ino
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 31 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ros_lib>
|-- <config>
|-- <encoder>
|-- <imu>
| |-- <ros_lib>
| |-- <Wire> 1.0
|-- <Servo> 1.1.2
|-- <kinematics>
|-- <motor>
| |-- <Servo> 1.1.2
|-- <pid>
Compiling .pioenvs\mega\src\firmware.ino.cpp.o
Archiving .pioenvs\mega\libec9\libros_lib.a
Archiving .pioenvs\mega\libcf2\libencoder.a
Archiving .pioenvs\mega\lib982\libWire.a
In file included from D:/linorobot-1.3.1/firmware/src/firmware.ino:27:0:
Compiling .pioenvs\mega\lib2fd\imu\ITG3200.cpp.ol
ib\encoder/Encoder.h: In function 'void __vector_1()':
lib\encoder/Encoder.h:185:14: error: 'static void Encoder::update(Encoder_internal_state_t*)' is private
static void update(Encoder_internal_state_t *arg) {
^
lib\encoder/Encoder.h:915:79: error: within this context
ISR(INT0_vect) { Encoder::update(Encoder::interruptArgs[SCRAMBLE_INT_ORDER(0)]); }
^
lib\encoder/Encoder.h: In function 'void __vector_2()':
lib\encoder/Encoder.h:185:14: error: 'static void Encoder::update(Encoder_internal_state_t*)' is private
static void update(Encoder_internal_state_t *arg) {
^
lib\encoder/Encoder.h:918:79: error: within this context
ISR(INT1_vect) { Encoder::update(Encoder::interruptArgs[SCRAMBLE_INT_ORDER(1)]); }
^
lib\encoder/Encoder.h: In function 'void __vector_3()':
lib\encoder/Encoder.h:185:14: error: 'static void Encoder::update(Encoder_internal_state_t*)' is private
static void update(Encoder_internal_state_t *arg) {
^
lib\encoder/Encoder.h:921:79: error: within this context
ISR(INT2_vect) { Encoder::update(Encoder::interruptArgs[SCRAMBLE_INT_ORDER(2)]); }
^
lib\encoder/Encoder.h: In function 'void __vector_4()':
lib\encoder/Encoder.h:185:14: error: 'static void Encoder::update(Encoder_internal_state_t*)' is private
static void update(Encoder_internal_state_t *arg) {
^
lib\encoder/Encoder.h:924:79: error: within this context
ISR(INT3_vect) { Encoder::update(Encoder::interruptArgs[SCRAMBLE_INT_ORDER(3)]); }
^
lib\encoder/Encoder.h: In function 'void __vector_5()':
lib\encoder/Encoder.h:185:14: error: 'static void Encoder::update(Encoder_internal_state_t*)' is private
static void update(Encoder_internal_state_t *arg) {
^
lib\encoder/Encoder.h:927:79: error: within this context
CIompiling .pioenvs\mega\lib2fd\imu\MPU6050.cpp.oSR(INT4_vect) { Encoder::update(Encoder::interruptArgs[SCRAMBLE_INT_ORDER(4)]); }

^
lib\encoder/Encoder.h: In function 'void __vector_6()':
lib\encoder/Encoder.h:185:14: error: 'static void Encoder::update(Encoder_internal_state_t*)' is private
static void update(Encoder_internal_state_t *arg) {
^
lib\encoder/Encoder.h:930:79: error: within this context
ISR(INT5_vect) { Encoder::update(Encoder::interruptArgs[SCRAMBLE_INT_ORDER(5)]); }
^
In file included from lib\ros_lib/ros.h:65:0,
from D:/linorobot-1.3.1/firmware/src/firmware.ino:9:
lib\ros_lib/ros/node_handle.h: In instantiation of 'int ros::NodeHandle_<Hardware, MAX_SUBSCRIBERS, MAX_PUBLISHERS, INPUT_SIZE, OUTPUT_SIZE>::publish(int, const ros::Msg*) [with Hardware = ArduinoHardware; int MAX_SUBSCRIBERS = 5; int MAX_PUBLISHERS = 5; int INPUT_SIZE = 1024; int OUTPUT_SIZE = 1024]':
lib\ros_lib/ros/node_handle.h:297:39: required from 'void ros::NodeHandle_<Hardware, MAX_SUBSCRIBERS, MAX_PUBLISHERS, INPUT_SIZE, OUTPUT_SIZE>::requestSyncTime() [with Hardware = ArduinoHardware; int MAX_SUBSCRIBERS = 5; int MAX_PUBLISHERS = 5; int INPUT_SIZE = 1024; int OUTPUT_SIZE = 1024]'
lib\ros_lib/ros/node_handle.h:227:35: required from 'int ros::NodeHandle_<Hardware, MAX_SUBSCRIBERS, MAX_PUBLISHERS, INPUT_SIZE, OUTPUT_SIZE>::spinOnce() [with Hardware = ArduinoHardware; int MAX_SUBSCRIBERS = 5; int MAX_PUBLISHERS = 5; int INPUT_SIZE = 1024; int OUTPUT_SIZE = 1024]'
D:/linorobot-1.3.1/firmware/src/firmware.ino:88:21: required from here
lib\ros_lib/ros/node_handle.h:441:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i =5; i<l+7; i++)
^
Compiling .pioenvs\mega\lib2fd\imu\MPU9150.cpp.o
Compiling .pioenvs\mega\libb18\Servo\avr\Servo.cpp.o
*** [.pioenvs\mega\src\firmware.ino.cpp.o] Error 1
====================================================================================================== [ERROR] Took 4.21 seconds ======================================================================================================
The terminal process terminated with exit code: 1

I've changed the pins numbers in lino_base_config.h to relevant ones for the 2WD part...
What I am missing?

Juan Miguel Jimeno

unread,
Aug 7, 2018, 6:24:10 AM8/7/18
to LINOROBOT

Stefan Shivarov

unread,
Aug 7, 2018, 11:57:22 AM8/7/18
to LINOROBOT
Thank's,
Sorry for wasting your time, I was assuming using teensy encoder optimisations is conditional, based on the board used, so I did not look at the code carefully...
It compiles now, 
got some warnings :

soumitra dey

unread,
Oct 6, 2019, 6:22:34 AM10/6/19
to LINOROBOT
Hii

Trying to use arduino mega, 2wd, Kinect now
Getting following compilation error,
Attaching the screenshot

20191006_154647.jpg
20191006_154702.jpg
20191006_154732.jpg
20191006_154809.jpg

Juan Miguel Jimeno

unread,
Oct 6, 2019, 6:40:37 AM10/6/19
to LINOROBOT
can you try:
platformio upgrade

and recompile

soumitra dey

unread,
Oct 6, 2019, 7:19:45 AM10/6/19
to LINOROBOT
Hiii
Thanks for your message.
Yes upgraded saying latest version 4.0.3
Also did pio upgrade...latest
Error still continues.

"Looking for Servo.h....as attached above.
Thanks
Regards

Juan Miguel Jimeno

unread,
Oct 6, 2019, 7:29:00 AM10/6/19
to LINOROBOT
I’m not sure why this is failing. Cant’t replicate the issue as I dont have access to my comp now.

Have you tried deleting your .pionenvs and recompiling again. Probably clashes with the prev env.

arminf82

unread,
Oct 6, 2019, 12:20:41 PM10/6/19
to LINOROBOT
Ooooh, I had the same problem but stupidly can´t exactly remember what the solution was.
The problem had nothing to do with the upload process itself. 

I think it was either 
1. something with the path to the Arduino library in the Arduino IDE: check the path in IDE.
or
2. with the servo library: maybe I had the servo library installed in the arduino/library directory.

sorry, I can´t remember exactly.



arminf82

unread,
Oct 6, 2019, 3:36:55 PM10/6/19
to LINOROBOT
Try this:

Put the servo library in the lib folder

linorobot/teensy/firmware/lib/PUTHERE

and change

firmware.ino
#include <Servo.h> --> #include "Servo.h"

soumitra dey

unread,
Oct 6, 2019, 10:05:58 PM10/6/19
to LINOROBOT
Thanks so much !!!!
Compiled now as you suggested ...success
Regards

Reply all
Reply to author
Forward
0 new messages