Problems compiling Firmware

Have not been able to compile firmware from the beginning. I get the following error;

In file included from Encoder.cpp:2:0:
Encoder.h:41:37: fatal error: utility/direct_pin_read.h: No such file or directory
#include <utility/direct_pin_read.h>
^
compilation terminated.

The utility directory is included in the same location as the cnc_ctrl_v1.ino file in “sketchbook/libraries/Firmware/cnc_ctrl_v1/” . is there an issue with the file path here or is there some other step I need to take with Arduino to find the utility folder? I was able to include the full path to “utility/direct_pin_read.h” in “Encoder.h” where these header files are contained, but then encounter multiple other functional issues preventing compiling including attachInterrup being duplicately used as a macro with 2 parameters and a function with 3. Any help you can offer would be appreciated.

OS? Windows, Mac, Linux, BeOS, Plan9, etc?

1 Like

Linux, same error with Ubuntu and raspian

What version of Arduino? I think 1.83 is current. Are you running the IDE, or compiling from the command line?

The steps here are what I followed in Linux and everything works fine. I also got Atom setup with PlatformIO based on these instructions and it also works.

Am using Atom 1.13.0 with PlatformIO 2.0.0
Also Arduino IDE 1.8.1
On Ubuntu 17.04

So it is definitely possible. For Arduino IDE I did not change anything in the code or structure. For PlatformIO I just modified its platformio.ini file like in the directions.

I am getting the same error jamesonhm159.
Presario CQ70
Ubuntu 16.04 LTS
Arduino IDE 1.8.3 shows 2:1.0.5+dfsg2-4 in About Arduino

device shows as /dev/ttyACM0

Tried Arduino Web and got a red X in the Select Board. I selected Arduino/Genuino Mega or Mega 2560 at /dev/ttyACM0

I went through the install instructions before and after coffee with the same results. I was on the june shipment and just now got to get started working on it.

What happens if you move ‘Firmware’ with all its subdirectories up to your home directory? I don’t think Arduino wants to find any part of Firmware in its libraries directory.

the arduino IDE doesn’t really care, you just have to navigate around to that
directory to open the project

Not sure why you’re getting that error. I can see it if I use the Arduino web IDE, though. You could turn on verbose output during compiling to see where it’s looking for the files…
I find that I can work around it in the web IDE by copying the files from the utility folder into the cnc_ctrl_v1 folder and editing Encoder.h to remove the reference to the utility folder in three places:
Encoder.h:41:#include "utility/direct_pin_read.h"
Encoder.h:46:#include "utility/interrupt_pins.h"
Encoder.h:48:#include “utility/interrupt_config.h”

After that it compiles without complaint.

What command are you using to compile?

@blurfl - this worked for those 3 files, the compiler gets past that hangup now. It then had a file not found error with the EEPROM library in Axis.h. I got around that by including it in the cnc_ctrl_v1.ino file. I now have the following errors;

Axis.cpp: In constructor ‘Axis::Axis(const int&, const int&, const int&, const int&, const int&, const String&, const int&)’:
Axis.cpp:34:82: error: invalid conversion from ‘volatile double*’ to ‘double*’ [-fpermissive]
_pidController.setup(&_pidInput, &_pidOutput, &_pidSetpoint, 0, 0, 0, REVERSE);
^
In file included from Axis.h:23:0,
from Axis.cpp:20:
PID_v1.h:21:10: note: initializing argument 1 of ‘void PID::setup(double*, double*, double*, const double&, const double&, const double&, const int&)’
void setup(double*, double*, double*, // * constructor. links the PID to the Input, Output, and
^
Axis.cpp:34:82: error: invalid conversion from ‘volatile double*’ to ‘double*’ [-fpermissive]
_pidController.setup(&_pidInput, &_pidOutput, &_pidSetpoint, 0, 0, 0, REVERSE);
^
In file included from Axis.h:23:0,
from Axis.cpp:20:
PID_v1.h:21:10: note: initializing argument 2 of ‘void PID::setup(double*, double*, double*, const double&, const double&, const double&, const int&)’
void setup(double*, double*, double*, // * constructor. links the PID to the Input, Output, and
^
Axis.cpp:34:82: error: invalid conversion from ‘volatile double*’ to ‘double*’ [-fpermissive]
_pidController.setup(&_pidInput, &_pidOutput, &_pidSetpoint, 0, 0, 0, REVERSE);
^
In file included from Axis.h:23:0,
from Axis.cpp:20:
PID_v1.h:21:10: note: initializing argument 3 of ‘void PID::setup(double*, double*, double*, const double&, const double&, const double&, const int&)’
void setup(double*, double*, double*, // * constructor. links the PID to the Input, Output, and
^

It seems there is dome functional issue with the code itself and I do not know enough about c style programming to debug.
@TheRiflesSpiral - I am compiling with the arduino IDE verify checkmark - version 1.8.4

Are you sure you’ve chosen the “Board: Arduino/Genuino Mega or Mega2650” target to compile for? It sounds like the compiler is targeting a different platform.
You could change the setting for verbose output for the compiler, then zip the output and attach it here. That might provide a clue to go on.

Thanks for all your responses, successfully compiled and uploaded with Atom/PlatformIO.

3 Likes

I had similar problems in addition to others involving not being able to include EEPROM.h from anything other than the .ino file and then having the EEPROM class not having the ‘update’ method.

I eventually figured out that I was using a very old version 1.0.5 of the Arduino IDE under Ubuntu/Linux (16.04.2). I went to the Arduino downloads page and downloaded the latest Arduino IDE version 1.8.5.

After setting the board and port correctly, it compiled and uploaded without any modification of the source or file locations that was provided by the latest Maslow firmware (0.96).

A quick recap in case others encounter the same problems I did:

  • Check to make sure you have an up-to-date Arduino IDE (for example 1.8.5)
  • Make sure you have the Arduino 2560 board selected (Tools->Board->Arduino/Genuino Mega or Mega 2560)
  • Make sure you have the proper Port selected (Tools->Port->…)
  • If you have permissions problems uploading to the Arduino, the following should hopefully work:

        sudo usermod -a -G dialout <username>

    (taken from the Arduino IDE Linux installation guide)
3 Likes

I’m getting this error trying to compile it with the Arduino Create app on my Chromebook. Is this generally a bad idea?

I haven’t tested the Arduino Create app, did it end up working for you or did you have to switch to a different system?

The Arduino Create App compiled and uploaded the test_electronics_firmware sketch to the controller without trouble, but when attempting to compile/verify the cnc_ctrl_v1 sketch it seems to have trouble linking dependencies. I had simply imported the sketch into the web app as the zip file after downloading it.

This is the output from the console:

./opt/arduino-builder/arduino-builder -compile -core-api-version 10611 -build-path /tmp/413617047/build -hardware opt/arduino-builder/hardware -hardware ./opt/cores -tools opt/arduino-builder/tools -tools ./opt/tools -built-in-libraries opt/libraries/latest -libraries /tmp/413617047/pinned -libraries /tmp/413617047/custom -fqbn arduino:avr:mega:cpu=atmega2560 -build-cache /tmp -logger humantags -verbose=true /tmp/413617047/cnc_ctrl_v1

Using board ‘mega’ from platform in folder: /home/admin/builder/opt/cores/arduino/avr

Using core ‘arduino’ from platform in folder: /home/admin/builder/opt/cores/arduino/avr

Detecting libraries used…

“/home/admin/builder/opt/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR “-I/home/admin/builder/opt/cores/arduino/avr/cores/arduino” “-I/home/admin/builder/opt/cores/arduino/avr/variants/mega” “/tmp/413617047/build/sketch/cnc_ctrl_v1.ino.cpp” -o “/dev/null”

“/home/admin/builder/opt/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR “-I/home/admin/builder/opt/cores/arduino/avr/cores/arduino” “-I/home/admin/builder/opt/cores/arduino/avr/variants/mega” “-I/home/admin/builder/opt/cores/arduino/avr/libraries/EEPROM/src” “/tmp/413617047/build/sketch/cnc_ctrl_v1.ino.cpp” -o “/dev/null”

“/home/admin/builder/opt/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR “-I/home/admin/builder/opt/cores/arduino/avr/cores/arduino” “-I/home/admin/builder/opt/cores/arduino/avr/variants/mega” “-I/home/admin/builder/opt/cores/arduino/avr/libraries/EEPROM/src” “/tmp/413617047/build/sketch/cnc_ctrl_v1.ino.cpp” -o “/tmp/413617047/build/preproc/ctags_target_for_gcc_minus_e.cpp”

Multiple libraries were found for “EEPROM.h”

Used: /home/admin/builder/opt/cores/arduino/avr/libraries/EEPROM

Not used: /home/admin/builder/opt/libraries/latest/arduino-nvm-0-9-1

Using library EEPROM at version 2.0 in folder: /home/admin/builder/opt/cores/arduino/avr/libraries/EEPROM

In file included from /tmp/413617047/build/sketch/MotorGearboxEncoder.h:22:0,

from /tmp/413617047/build/sketch/Axis.h:24,

from /tmp/413617047/build/sketch/CNC_Functions.h:19,

from /tmp/413617047/cnc_ctrl_v1/cnc_ctrl_v1.ino:15:

/tmp/413617047/build/sketch/Encoder.h:41:37: fatal error: utility/direct_pin_read.h: No such file or directory

#include “utility/direct_pin_read.h”

^

compilation terminated.

exit status 1

I should add that I was able to compile/verify/upload cnc_ctrl_v1 from the Arduino IDE on my dreaded Windows machine.

Now I’m hoping to install Ubuntu linux on my Chromebook so I can get Ground Control running there hopefully. Failing that, I’ll try the Raspberry Pi solution.

Anything to avoid Windows!

2 Likes

@JustinC, what version of the Arduino IDE are you running? Also, have you made sure to select the “Arduino 2560” board in the “Tools->Board” dropdown?

I wonder if the web version can handle the files in the sub folder? The termination with “utility/direct_pin_read.h” suggests that’s the problem.