E2END constant used but not declared in Eeprom.h

Hi,

I have successfully installed arduino 1.8.5, the OpenBCI
libraries and the ChipKit package. The next step in the OpenBCI Cyton
tutorial is to load the DefaultBoard example. It then gives me the
following error message:

In
file included from \\users\\Windows.Documents\My
Documents\Arduino\libraries\OpenBCI_32bit_Library\examples\DefaultBoard\DefaultBoard.ino:3:0:
C:\Users\m\AppData\Local\Arduino15\packages\chipKIT\hardware\pic32\2.0.3\libraries\EEPROM/EEPROM.h:
In member function 'uint16_t EEPROMClass::length()':

C:\Users\m\AppData\Local\Arduino15\packages\chipKIT\hardware\pic32\2.0.3\libraries\EEPROM/EEPROM.h:127:51:
error: 'E2END' was not declared in this scope

     uint16_t length()                    { return E2END + 1; }

                                                   ^
exit status 255
Error compiling for board OpenBCI 32.

I
have checked the header files in the search for this constant (where it is declared) but to no avail. I also have searched for possible solutions to this problem online but it has not been asked here in the
forum yet. I'd greatly appreciate some help and pointers. Thank you.

Comments

  • I just learned that it should be declared in the avr/io.h header file, but checking the avr files in my chipKit tree, it is not there. Any help is appreciated. Thanks.
  • Okay, I think it has to do with the ChipKit code. Apparently they added a length() function that uses E2END, but the AVR code included in their distribution does not define the E2END. Any help is appreciated.
  • Update: I added a #define E2END 0x0fff to the EEPROM.h header and it compiled and loaded. The question now is whether the value 0x0fff is correct at all? I got this number from the ChipKit issues in GitHub (https://github.com/chipKIT32/chipKIT-core/issues/271) , but I don't know if it is correct or not.

  • edited April 2018
    Thanks. I read the thread in more detail and I understand that E2END is not used anywhere in the ChipKit code, so the specific value won't really matter at this point. I guess this closes the issue.
  • JoshJosh Los Angeles
    edited April 2018
    Could you paste your exact code? I'm having the same issue but have yet to resolve it. 

    My header is now:

    #include <DSPI.h>
    #include <OBCI32_SD.h>
    #include <EEPROM.h >
    #define E2END 0xFFF  // I added this to try to fix error
    #include <OpenBCI_Wifi_Master_Definitions.h>
    #include <OpenBCI_Wifi_Master.h>
    #include <OpenBCI_32bit_Library.h>
    #include <OpenBCI_32bit_Library_Definitions.h>

    Getting error:  error: 'E2END' was not declared in this scope

         uint16_t length()                    { return E2END + 1; }
  • The added line is correct, it is the code I used.
    I did have an extra zero there (0x0FFF) but I don't think it makes any difference.

    However,
    I placed it in the EEPROM.h header file in the Arduino installation. I
    believe this is the only thing you need to change.

    Cheers
  • JoshJosh Los Angeles
    edited April 2018
    Oh, stupid mistake. That worked! Thankyou!
  • Great!
  • retiututretiutut Louisiana, USA
    Confirmed @dmontezano 's fix by assigning an arbitrary value for E2END in the EEPROM.h header file. The location of this header file on a Mac is in the Library folder, accessible by Finder->Go->Option-Key->Library. Nice work!

    /Users/$UserName$/Library/Arduino15/packages/chipKIT/hardware/pic32/2.0.3/libraries/EEPROM
  • wjcroftwjcroft Mount Shasta, CA
    Logged this as an issue on the docs file for building the firmware,


    It's possible a better fix would be to add the line to the Cyton source.

Sign In or Register to comment.