Author Topic: Arduino IDE not compiling with OAK board selected  (Read 7090 times)

peabo

  • Newbie
  • *
  • Posts: 8
Arduino IDE not compiling with OAK board selected
« on: February 22, 2016, 02:15:10 pm »
I have successfully added my two Oaks on to the Particle.io and can see them connected to my Wifi on both the PC dash board and the Android Particle app.  Pleased about this!!
I wanted to up load a simple blink sketch just to get me off the ground and comfortable with the programming process.
I couldn't seem to make the Particle IDE programming environment work (even the simplest sketch wouldn’t compile) so i thought i would try getting the Arduino IDE to compile and upload the Sketch as this is what I am more used to.
I immediately came up against an obstacle in that the Arduino compiler isn't happy with some aspect of the access permissions that the new Oak board has introduced. See the error that is kicked up when i perform a verify -  The xtensa-lx106-elf-g++ object seems to be causing the issue…..

Error form Arduino IDE Verify:-

Arduino: 1.6.5 (Windows 7), Board: "Oak by Digistump, 80 MHz, Particle OTA, OAK (4M/1M SPIFFS), Single - 1MB (Fullsize)"
Build options changed, rebuilding all
C:\Users\User.name\AppData\Roaming\Arduino15\packages\digistump\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -IC:\Users\User.name\AppData\Roaming\Arduino15\packages\digistump\hardware\oak\0.9.3/tools/sdk/include -c -O2 -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -DF_CPU=80000000L -DARDUINO=10605 -DARDUINO_ESP8266_OAK -DARDUINO_ARCH_OAK -DESP8266 -IC:\Users\User.name\AppData\Roaming\Arduino15\packages\digistump\hardware\oak\0.9.3\cores\oak -IC:\Users\User.name\AppData\Roaming\Arduino15\packages\digistump\hardware\oak\0.9.3\variants\oak C:\Users\USER~1.NAME\AppData\Local\Temp\build2014624590134223423.tmp\Blink.cpp -o C:\Users\USER~1.NAME\AppData\Local\Temp\build2014624590134223423.tmp\Blink.cpp.o 
Cannot run program "C:\Users\User.name\AppData\Roaming\Arduino15\packages\digistump\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\bin\xtensa-lx106-elf-g++" (in directory "."): CreateProcess error=5, Access is denied.

Any suggestions ideas much appreciated.

Cheers

Dan

PeterF

  • Hero Member
  • *****
  • Posts: 881
Re: Arduino IDE not compiling with OAK board selected
« Reply #1 on: February 23, 2016, 02:27:13 am »
Hi Dan,

Firstly, the Particle IDE is not supported for programming Oaks yet... it is used for OTA updates, programming and logging, but not for actual code compiling, etc. That will probably be enabled/made available shortly after the firmware makes it out of beta to version 1.

As far as the compile errors... it looks like it may be a file permission issue - as error 5 is usually indicates that  the file is not executable, or that it is not accessible. If it is file permission errors, you may be able to quickly find out by running the Arduino IDE as an administrator... (right click on the Arduino IDE icon and 'Run as Administrator'). See if a simple blink sketch compiles then.

It may be be worth removing the board through the board manager and installing it again if that doesn't get you anywhere (when you are running the Arduino IDE as normal again) just in case something went amiss when installing the support files.

Hope that helps,
Pete

peabo

  • Newbie
  • *
  • Posts: 8
Re: Arduino IDE not compiling with OAK board selected
« Reply #2 on: February 23, 2016, 03:56:18 pm »
Hi Pete,

Firstly Thanks for the reply.

I took your advice and removed all the digistump packages from the

C:\Users\User.name\AppData\Roaming\Arduino15\packages\digistump\

Folder.

I then restarted the the Arduino IDE and then reinstalled the Digistump Oak Board.

I then tried to compile the code again.

Good news is that i no longer get an access denied but the xtensa-lx106-elf-g++ module is still causing an issue - see the error from the Arduino IDE:-


Arduino: 1.6.5 (Windows 7), Board: "Oak by Digistump, 80 MHz, Particle OTA, OAK (4M/1M SPIFFS), Single - 1MB (Fullsize)"


C:\Users\user.name\AppData\Roaming\Arduino15\packages\digistump\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -IC:\Users\user.name\AppData\Roaming\Arduino15\packages\digistump\hardware\oak\0.9.3/tools/sdk/include -c -O2 -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -DF_CPU=80000000L -DARDUINO=10605 -DARDUINO_ESP8266_OAK -DARDUINO_ARCH_OAK -DESP8266 -IC:\Users\user.name\AppData\Roaming\Arduino15\packages\digistump\hardware\oak\0.9.3\cores\oak -IC:\Users\user.name\AppData\Roaming\Arduino15\packages\digistump\hardware\oak\0.9.3\variants\oak C:\Users\user~1.name\AppData\Local\Temp\build187285779461581532.tmp\sketch_feb23a.cpp -o C:\Users\user~1.name\AppData\Local\Temp\build187285779461581532.tmp\sketch_feb23a.cpp.o

xtensa-lx106-elf-g++: error: CreateProcess: No such file or directory

Error compiling.

xtensa-lx106-elf-g++ is definately present in the following folder

C:\Users\user.name\AppData\Roaming\Arduino15\packages\digistump\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\bin\g++.exe




Any further thoughts?


Cheers

Dan



PeterF

  • Hero Member
  • *****
  • Posts: 881
Re: Arduino IDE not compiling with OAK board selected
« Reply #3 on: February 23, 2016, 05:18:40 pm »
Ok, so a step in the right direction then?  :D

From the command prompt, can you try running this exact command and seeing what response you get?

Code: [Select]
C:\Users\user.name\AppData\Roaming\Arduino15\packages\digistump\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++
You should get the following message if it runs:
Code: [Select]
xtensa-lx106-elf-g++: fatal error: no input files
compilation terminated.

Then try running this one (same as last time, but with double quotes surrounding the command):

Code: [Select]
"C:\Users\user.name\AppData\Roaming\Arduino15\packages\digistump\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++"
If that runs, but the first one didn't, try upgrading your Arduino IDE to 1.6.7 (as I noticed you're running 1.6.5). There were quite a few changes to the build system in 1.6.6 & 1.6.7, and quotes surrounding the compile commands was one of them, which would resolve issues related to spaces and certain characters in the file paths. You may need to install the Oak board support again when you upgrade, as 1.6.7 also defaults to installing board packages in a different location.

peabo

  • Newbie
  • *
  • Posts: 8
Re: Arduino IDE not compiling with OAK board selected
« Reply #4 on: February 24, 2016, 02:43:06 am »
Hi Pete,

As a test i installed the 1.6.7 Arduino IDE on a new "fresh" computer, installed the Oak board, and ran the OakCLI in order to generate the config.json file

Which it put in:-
C:\Users\user.name\AppData\Roaming\oak\config.json

I then compiled and uploaded a new sketch ( a more complicated blink program to test the upload)

The IDE came back with

" sending File to Cloud, to flash device......
Device flashing started sucessfully.

Bingo...... :)

Unfortunately my Oak board is plugged in at home some 30km away so i will have to check it is blinking differently when i get in.... fingers crossed

As far as my original problem goes, i updated the the Arduino IDE to 1.6.7 on my laptop ( this is the machinre which is giving me the issue. it is a i5 Windows 7 OS same as the fresh machine which i had no problems with ) after completetly deleting the 1.6.5 install and all the associated C:\Users\user.name\AppData\*.* stuff.

I still get the error   :(


xtensa-lx106-elf-g++: error: CreateProcess: No such file or directory

Exit status 1
Error compiling.


What i did notice is that the OakCLI configuration hadn't created the folder which tell the complier which Oak board to use.

C:\Users\user.name\AppData\Roaming\oak\config.json

Running the oak.exe now briefly pops up with a command prompt is says "No devices available" and then shuts down.

I have tried copying the config.json file into the same location but still no joy.

i wonder if this is causing the problem with the xtensa-lx106-elf-g++ or if is another issue or if my machine is in compatible with the xtensa-lx106-elf-g++ stuff

Cheers

Dan


PeterF

  • Hero Member
  • *****
  • Posts: 881
Re: Arduino IDE not compiling with OAK board selected
« Reply #5 on: February 25, 2016, 01:58:44 am »
lol...l just a bit hard to check... you mean you didn't set up a webcamera to watch it blink from 30km away?

One way to check is to use Particle.publish events - such as

Code: [Select]
bool success;
success = Particle.publish("setup()");
if (!success) {
  success = Particle.publish("setup()");
}

The if !sucess is simply to give it a second chance to publish the message just incase the first one didn't send. I put that in the setup function to see if it has started, and also the loop if there is a long enough delay to warrant more messages there, and will be doing so again shortly with a temp sensor Oak. You can then look at the logs on the Particle.io cloud, and should see messages logged if it upload and runs the sketch. Also, you should get a message logged on Particle.io to indicate that programming has started, and has completed, and the Oak disconnecting and reconnecting to run the new user sketch (as long as you leave the log view open - it doesn't seem to save events, only those that have been captured whilst you have the log view open).

As far as your error, all I can think of is a weird test - try copying your config.json file to the following folder, and try running the Oak CLI command again to see if it changes its tune...

C:\Users\user.name\AppData\Local\oak\config.json