Board_Defs.h: No such file or directory

DonReedDonReed Europe
edited May 2016 in Software
I'm on linux 64 bit. I've done the following.
# Downloaded arduino
wget https://www.arduino.cc/download_handler.php?f=/arduino-1.6.9-linux64.tar.xz
tar -xvf arduino-1.6.9-linux64.tar.xz
# Downloaded libraries
git clone https://github.com/OpenBCI/OpenBCI_32bit_Library
mv OpenBCI/OpenBCI_32bit_Library/OBCI32_SD arduino-1.6.9/libraries/
mv OpenBCI/OpenBCI_32bit_Library/OpenBCI_32_Daisy arduino-1.6.9/libraries/

# Downloaded chipKit
wget https://chipkit.s3.amazonaws.com/chipkit-core/builds/linux64/chipkit-core-linux64.16778024.41ae417.zip
mv chipkit-core arduino-1.6.9/hardware/
# Checked that I have hardware/chipkit-core/pic32
cd arduino-1.6.9/hardware/chipkit-core/pic32
pwd
# /home/jon/library/projects/openbci/arduino-1.6.9/hardware/chipkit-core/pic32
# Going back
cd -

git clone https://github.com/OpenBCI/OpenBCI_32bit
cd arduino-1.6.9
# Starting IDE by opening the .ino file
./arduino ../OpenBCI_32bit/OpenBCI_32bit/OpenBCI_32bit.ino

Then when ide shows up I click on Tools-> Board and select "OpenBCI 32"
Tools -> Port -> /dev/ttyUSB0

It fails during compilation with this error:

In file included from /home/jon/library/projects/openbci/arduino-1.6.9/hardware/chipkit-core/pic32/cores/pic32/WProgram.h:9:0,
                 from /home/jon/library/projects/openbci/arduino-1.6.9/hardware/chipkit-core/pic32/cores/pic32/Arduino.h:4,
                 from sketch/OpenBCI_32bit.ino.cpp:1:
/home/jon/library/projects/openbci/arduino-1.6.9/hardware/chipkit-core/pic32/cores/pic32/pins_arduino.h:263:24: fatal error: Board_Defs.h: No such file or directory
compilation terminated.
exit status 1
Error compiling for board OpenBCI 32.

At this point I don't even know where to look, because I've tried everything. Even downloaded test release chipkit. Pretty much stuck with old firmware until I'm going to be old and die. Any ideas of what that could be? 

Comments

  • DonReedDonReed Europe
    edited May 2016
    Ah yeah, I've installed the chipkit on accident through "Tools->Board->Board Manager" first, it gave me same error. Then I saw that on openBCI tutorial recommendation to use the manual approach, so I `rm-rf ~./arduino15` removed everything else as well and redid it as I've shown above, and I was still getting this error. So, it seems that I've installed it manually correctly (I assume), because automatic approach was giving the same error.

    Tried using Arduino 1.6.7 instead of 1.6.9, same error.
    Tried test build 2015-09-03 on 1.6.7, same error. 
  • DonReedDonReed Europe
    Hi William,
    Yes. I've tried using ~/Arduino now, instead of using the directory where arduino binaries are (which also has libraries and  hardware folder). Same effect, just different paths:

    Arduino: 1.6.9 (Linux), Board: "OpenBCI 32"

    Build options changed, rebuilding all
    In file included from /home/jon/Arduino/hardware/chipkit-core/pic32/cores/pic32/WProgram.h:9:0,
                     from /home/jon/Arduino/hardware/chipkit-core/pic32/cores/pic32/Arduino.h:4,
                     from sketch/OpenBCI_32bit.ino.cpp:1:
    /home/jon/Arduino/hardware/chipkit-core/pic32/cores/pic32/pins_arduino.h:263:24: fatal error: Board_Defs.h: No such file or directory
     #include <Board_Defs.h>

                            ^
    compilation terminated.
    exit status 255
    Error compiling for board OpenBCI 32.

    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

  • DonReedDonReed Europe
    I moved the file into the directory with file that was complaining. The error disappeared, and it started to show an error pointing out to missing another file (plib.h).

    ➜  Arduino  find ./ -name 'Board_Defs.h' | grep openbci                                                                  
    ./hardware/chipkit-core/pic32/variants/openbci/Board_Defs.h
    ➜  Arduino  cp ./hardware/chipkit-core/pic32/variants/openbci/* /home/jon/Arduino/hardware/chipkit-core/pic32/cores/pic32/

    I've seen this: http://openbci.com/forum/index.php?p=/discussion/598/openbci-32bit-compile-error-plib-h-no-such-file-or-directory

    So, I've commented out: /* #include plib.h */
    in /home/jon/Arduino/libraries/OBCI32_SD/utility/Sd2Card.cpp

    Now, it's yelling at me showing same errors which are shown in that thread on plib file. I'm tying to figure it out, because I haven't programmed in C++. But I'm slowly making progress. This rabbit hole goes deep.
  • DonReedDonReed Europe
    And it compiled. A couple more things I had to deal with:

    /home/jon/Arduino/libraries/OpenBCI_32_Daisy/OpenBCI_32_Daisy.cpp
    1001: byte inByte = spi.transfer((uint8_t)0x00);   // retrieve data
    1018: inData = spi.transfer((uint8_t)0x00) | (spi.transfer((uint8_t)0x00) << 8);  // get the data and arrange it

    Similarly, I had to do the same thing with "/home/jon/Arduino/libraries/OBCI32_SD/utility/Sd2Card.cpp", looking at which lines it complained and adding (uint8_t) there to have explicit cast.

    This solved the cast errors, but it still showed one more error afterwards:
    "/home/jon/Arduino/hardware/chipkit-core/pic32/variants/OpenBCI No such directory"

    I've looked there and there was "/home/jon/Arduino/hardware/chipkit-core/pic32/variants/openbci", so I copied it (probably rename would be fine) to create "/home/jon/Arduino/hardware/chipkit-core/pic32/variants/OpenBCI"

    Now, it's time to upload it. If it fails, I'm gonna throw my notebook out of the window, buy a sheep and go live in mountains of Tibet.
  • DonReedDonReed Europe
    It uploaded after failing a couple of times. Had to move the BCI right next to the dongle even though it was already close.  At one point it turned off and I thought that I bricked it because it wasn't turning when I switched power on to see if it's working, but it turned when I used button sequence (holding RST and PROG, power on, release RST then PROG).

    @wjcroft I don't think this issue (Board_Defs.h, etc) was caused by me installing something terribly wrong. Something is clearly broken with the code from chipkit or repos in http://docs.openbci.com/tutorials/02-Upload_Code_to_OpenBCI_Board One has to modify code to make it work, also it expects folders to be named one way, but they are named another way (E.g., OpenBCI_32  vs openbci). I'm not sure whether this is Linux specific or if it's universal. Based on types of errors I suspect it may be the latter.  So, perhaps, as a temporary solution we can put some disclaimer in the docs, to threads like this and plib. Because at it is now things from the guide don't seem to work together at all. If this is indeed not me screwing something up, then I can create a pull request on docs repo with a small (linux?) disclaimer like "If you see Board_Defs.h" look this way and a link to this and plib threads.
  • wjcroftwjcroft Mount Shasta, CA
    Don, hi again.

    All these compilation problems apparently go away with the correct chipKIT core. See,


    No source level changes such as casts should be needed.

    Regards,

    William

Sign In or Register to comment.