OpenBCI_32bit compile error: plib.h: no such file or directory

edited January 2016 in Software
Hi,

I just wanted to compile OpenBCI_32bit following the Instructions in the README.md.
I get the compiler error:
C:\Users\...\Documents\Arduino\libraries\OBCI32_SD\utility\Sd2Card.cpp:20:18: fatal error: plib.h: No such file or directory
 #include <plib.h>
                  ^
compilation terminated.
C:\Users\...\AppData\Roaming\Arduino15\packages\chipKIT\tools\pic32-tools\4.8.3-pic32gcc/bin/pic32-g++ gab 255 zurück
Fehler beim Kompilieren.

How can I include this header file?

Best,
Friedemann

Comments

  • biomurphbiomurph Brooklyn, NY
    Which version of the Arduino IDE are you using? We have verified up to 1.6.5
  • Hi,

    I am using version 1.6.5.

    Cheers, Friedemann
  • biomurphbiomurph Brooklyn, NY
    Something may have been installed incorrectly?
    Please open your libraries folder, and go to Documents\Arduino\libraries\OBCI32_SD\utility\Sd2Card.cpp and see what's there. On my computer, I have:

    #include <p32xxxx.h>
    #include <plib.h>

    #include <WProgram.h>
    #include "Sd2Card.h"


  • Hi,

    same here. Is there something I can try to re-install?

    Best,
    Friedemann
  • Same problem here. 
    I have Sd2Card.cpp as listed above.

    Help!
  • and installed plib.h and peripherals subdirectory in C:\Users\david\AppData\Local\Arduino15\packages\chipKIT\tools\pic32-tools\4.8.3-pic32gcc\pic32mx\include.

    Now when I'm compiling I'm getting:

    Arduino: 1.6.7 (Windows 10), Board: "OpenBCI 32"

    C:\Users\david\Documents\Arduino\libraries\OBCI32_SD\utility\Sd2Card.cpp: In member function 'uint8_t Sd2Card::spiRec()':
    C:\Users\david\Documents\Arduino\libraries\OBCI32_SD\utility\Sd2Card.cpp:59:35: error: call of overloaded 'transfer(int)' is ambiguous
             data = _spi->transfer(0xFF);
                                       ^
    C:\Users\david\Documents\Arduino\libraries\OBCI32_SD\utility\Sd2Card.cpp:59:35: note: candidates are:
    In file included from C:\Users\david\Documents\Arduino\libraries\OBCI32_SD\utility\Sd2Card.h:154:0,
                     from C:\Users\david\Documents\Arduino\libraries\OBCI32_SD\utility\Sd2Card.cpp:26:
    C:\Users\david\AppData\Local\Arduino15\packages\chipKIT\hardware\pic32\1.1.0\libraries\DSPI/DSPI.h:177:10: note: uint32_t DSPI::transfer(uint32_t)

     uint32_t transfer(uint32_t bVal);

              ^

    C:\Users\david\AppData\Local\Arduino15\packages\chipKIT\hardware\pic32\1.1.0\libraries\DSPI/DSPI.h:178:13: note: virtual uint8_t DSPI::transfer(uint8_t)

     uint8_t     transfer(uint8_t bVal) { return((uint8_t) transfer((uint32_t) bVal)); }

                 ^

    exit status 255
    Error compiling.

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

    In C:\Users\david\Documents\Arduino\libraries\OpenBCI_32_Daisy\OpenBCI_32_Daisy.cpp lines 1000 and 1017 there's a similar error.
    I hacked around by casting the constants to uint8_t.
    Now the code compiles.

    I'm afraid downloading it, since if it's bad I have no way to return to a good load.

    Please advise.
    David

  • I commented out the include of plib.h and removed plib.h and peripherals subdirectory from installation.
    The code compiles with the added casts to Sd2Card.cpp and OpenBCI_32_Daisy.cpp.

    I wonder how it compiled before?
  • biomurphbiomurph Brooklyn, NY
    @quer1304
    were you able to upload the code to your board with those changes?
  • Yes, and it seems the work.
    You REALLY need to add to the documentation the magic sequence of:
    1.Power dongle and board down
    2.Power dongle up
    3.Press RST on board
    4.Power board up
    5.Press PROG on board
    6.Release RST on board
    7.Release PROG on board

    If you don't, you get verification errors.

    David

    PS The documentation has the sequence 3-5-6-7. You will get the blue light flashing, but flash verification will fail.

  • biomurphbiomurph Brooklyn, NY
    @quer1304
    This is an intermittent problem. We will update the docs with trouble-shooting.
    Also, we are using 1.6.5 here in our lab. The ChipKit folks have made updates to their core, and they are under test here. We will updated the docs when improvements are stable.
  • I got the same problem, but didnt work the solution qwer1304 try, is there any official solution? why I cant compile the code?
  • What error are you getting?
    What version of Chipkit do you have installed?
    Did you try commenting plib.h out?
    What happened after you did?
  • Commenting out plib.h fixed that error.
    There're a second group of errors.
    Look at my post where I describe adding casts to fix the 2nd class of errors.
    You need to add them in two files, maybe in several places.
    The fix is the same in all cases.
  • I didnt understand well the casting part, for example the first error, isthis correct?
    data = _spi->(uint8_t) transfer(0xFF); or data = (uint8_t) _spi->transfer(0xFF);
    I still getting errors in this line :S, how did you cast? and also did your code work correctly in the openBCI?
  • edited February 2016
    data =  _spi->transfer((uint8_t)0xFF);

    yes it does
  • Oh, I cast the expresion not the Hex value, I did it in all errors I get, now I got the following error:

    pic32-g++.exe: error: C:\Users\Marcelo\AppData\Local\Temp\build314722887501305307.tmp/core.a: No such file or directory
    C:\Users\Marcelo\Documents\Arduino\hardware\chipkit-core/pic32/compiler/pic32-tools/bin/pic32-g++ returned 255
    Error compiling.
  • I wasn't getting this error.
    Looks like a configuration issue.
    Did you select the OpenBCI 32 board in Arduino?
  • Yes I did, this is an Image of the error and the openBCI board selected
  • Looking at the image and comparing it to my installation I see that your chipKit toolchain is in Roaming, while mine is in Local.
    Also note that that the file it's looking for is in Local.
    Looks like a bad installation.
  • Wow! Finally I did it! Thank you so much for your help qwer1304!, the last step I did was using http://chipkit.net/wiki/index.php?title=ChipKIT_core from version 2015-10-18 because the last version 2016-1-10 - Version 1.1.0 (same code as URL install version v1.1.0) didnt work for me. and It compile!, Im not sure if the code is correct but at least now it compile! Thank you again!
  • wjcroftwjcroft Mount Shasta, CA
    edited May 2016
    Folks, sorry for the confusion. @Marceloruiz has the correct solution to the compile errors. No source changes are needed to the OpenBCI code (such as the casts mentioned earlier). These compile errors were apparently introduced by the chipKIT core changes. The INCORRECT core is v1.1.0-18. Which is currently labeled as the 'Release' version.

    The chipKIT core which compiles OpenBCI_32bit correctly is v1.0.0-27, from 2015-10-18. Here is a cut/paste of the direct links in case chipKIT modifies their wiki page,

    2015-10-18
    Windows : https://chipkit.s3.amazonaws.com/chipkit-core/builds/win/chipkit-core-windows.16778039.v1.0.0-27-gdfa0309.zip

    It's possible that when Joel and AJ Keller complete the firmware revisions, they will ensure the compiles work with the latest chipKIT core zip. Until that time it seems safe to use this core from last fall. Hoping Joel @biomurph will also comment here.

    William

  • biomurphbiomurph Brooklyn, NY
    Thanks @wjcroft, I will make an explicit note in the tutorial to use the 2015-10-18 builds.
Sign In or Register to comment.