-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EtherCard does not work on Arduino Due, compilation error #211
Comments
Hi Jack I had the same issue when i started using the enc28j60 Your problem is a clash between the two libraries enc28j60 & EtherCard You can't use both, Pick one to use. Also I think that the version of the IDE also has a part to play, but can't remember which one to use. also this is a duplicate issue of #192 Hope this helps |
Hi,
Another compilation error is shown:
I don't know where the
Any ideas? |
P.S.: I use latest version of Arduino IDE (1.7.8) if that matters. |
The errors you get (" error: 'SPCR' was not declared in this scope ") are because the Ethercard library uses AVR SPI registers directly and not the Arduino SPI library, You might be able to go trough the "hardware interface " where specific AVR SPI registers are used and replace them with SPI library functions.
you will still need to set up the SPI port etc.. |
I could update the docs to make it explicit that this library only supports AVR-based platforms? |
That would probably solve some misconcptions. |
Ok. I'm ok with closing this one as "not supported" (yet). This library predates the arduino SPI library. I don't think a port would be that hard, but as @Daniel-dk says, you kinda need a reason to go down that rabbit-hole. |
Slightly closer to making EtherCard run on non-AVR micro-controllers. I have created Pull Request #335 for switching to using the Arduino SPI library. Needs a little bit more work but it is nearly there. If anyone is able to help with testing, that would be great. |
Hi,
I have a compilation error on my Arduino Due:
C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master\dhcp.cpp: In static member function 'static bool EtherCard::dhcpSetup(const char*, bool)': C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master\dhcp.cpp:327:61: error: 'strncpy_P' was not declared in this scope strncpy_P(hostname, hname, DHCP_HOSTNAME_MAX_LEN); ^ Error compiling.
there is no other code in my sketch, just the library include:
I'm getting more compile errors, whe trying to add the EtherCard libarary from Arduino IDE (using all 3 header files):
C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:41:12: error: 'uint8_t' does not name a type static uint8_t buffer[]; //!< Data buffer (shared by recieve and transmit) ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:42:12: error: 'uint16_t' does not name a type static uint16_t bufferSize; //!< Size of data buffer ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:46:12: error: 'uint8_t' does not name a type static uint8_t* tcpOffset () { return buffer + 0x36; } //!< Pointer to the start of TCP payload ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:59:12: error: 'uint8_t' does not name a type static uint8_t initialize (const uint16_t size, const uint8_t* macaddr, ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:71:29: error: 'uint16_t' has not been declared static void packetSend (uint16_t len); ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:77:12: error: 'uint16_t' does not name a type static uint16_t packetReceive (); ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:83:26: error: 'uint8_t' has not been declared static void copyout (uint8_t page, const uint8_t* data); ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:83:46: error: 'uint8_t' does not name a type static void copyout (uint8_t page, const uint8_t* data); ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:83:55: error: ISO C++ forbids declaration of 'data' with no type [-fpermissive] static void copyout (uint8_t page, const uint8_t* data); ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:89:25: error: 'uint8_t' has not been declared static void copyin (uint8_t page, uint8_t* data); ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:89:39: error: 'uint8_t' has not been declared static void copyin (uint8_t page, uint8_t* data); ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:96:12: error: 'uint8_t' does not name a type static uint8_t peekin (uint8_t page, uint8_t off); ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:147:12: error: 'uint8_t' does not name a type static uint8_t doBIST(uint8_t csPin = 8); ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:156:12: error: 'uint16_t' does not name a type static uint16_t readPacketSlice(char* dest, int16_t maxlength, int16_t packetOffset); ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:164:12: error: 'uint16_t' does not name a type static uint16_t enc_malloc(uint16_t size); ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:169:12: error: 'uint16_t' does not name a type static uint16_t enc_freemem(); ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:177:31: error: 'uint16_t' has not been declared static void memcpy_to_enc(uint16_t dest, void* source, int16_t num); ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:177:60: error: 'int16_t' has not been declared static void memcpy_to_enc(uint16_t dest, void* source, int16_t num); ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:184:45: error: 'uint16_t' has not been declared static void memcpy_from_enc(void* dest, uint16_t source, int16_t num); ^ C:\Users\Jacek\Documents\Arduino\libraries\ethercard-master/enc28j60.h:184:62: error: 'int16_t' has not been declared static void memcpy_from_enc(void* dest, uint16_t source, int16_t num); ^ Error compiling.
What I'm doing wrong?
Thanks for help
Jack
The text was updated successfully, but these errors were encountered: