Pages: [1]   Go Down
Author Topic: Compile error with Mega2560 selected  (Read 1678 times)
0 Members and 1 Guest are viewing this topic.
Centurion RSA
Offline Offline
Full Member
***
Karma: 0
Posts: 166
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I am using Arduino1.0. All works fine when I select any 328 board but when I try to compile for the Mega2560, I get string of errors from the core that I cant find the reason for.

This is some of them
Code:

In file included from C:\arduino-1.0\hardware\arduino\cores\arduino\/Platform.h:7,
                 from C:\arduino-1.0\hardware\arduino\cores\arduino\CDC.cpp:19:
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h: In function 'void eeprom_read_block(void*, const void*, size_t)':
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:290: error: ISO C++ forbids incrementing a pointer of type 'void*'
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:290: error: ISO C++ forbids incrementing a pointer of type 'const void*'
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:290: error: invalid conversion from 'const void*' to 'const uint8_t*'
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:290: error:   initializing argument 1 of 'uint8_t eeprom_read_byte(const uint8_t*)'
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h: In function 'void eeprom_write_block(const void*, void*, size_t)':
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:398: error: ISO C++ forbids incrementing a pointer of type 'void*'
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:398: error: ISO C++ forbids incrementing a pointer of type 'const void*'
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:398: error: invalid conversion from 'void*' to 'uint8_t*'
c:/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:398: error:   initializing argument 1 of 'void eeprom_write_byte(uint8_t*, uint8_t)'

Logged

Rather people think you to be a fool than you open your mouth and confirm it.

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 11
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you post your sketch?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12739
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you post your sketch?

Why?  It's an old problem with and old solution...

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1287507497/0#0

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1278172720/2#2
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1278172720/8#8
Logged

Centurion RSA
Offline Offline
Full Member
***
Karma: 0
Posts: 166
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks guys, the new eeprom.h solves the problem.
The thing is - I did a search on the forum but picked up no responses for this problem. Maybe the criteria was wrong ;-)
Logged

Rather people think you to be a fool than you open your mouth and confirm it.

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 11
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Weird, I thought I fixed this a long time ago: http://code.google.com/p/arduino/issues/detail?id=381

It seems to work on my Mac.  Does this happen for everyone on Windows?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12739
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
#include <EEPROM.h>
void setup( void ) {}
void loop( void ) {}
Arduino Mega 2560 or Mega ADK
Arduino 1.0.1.

...not me.
« Last Edit: June 14, 2012, 09:39:37 pm by Coding Badly » Logged

Centurion RSA
Offline Offline
Full Member
***
Karma: 0
Posts: 166
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Weird, I thought I fixed this a long time ago: http://code.google.com/p/arduino/issues/detail?id=381

Mellis,
It worked fine on Arduino0022. I just recently switched to Arduino1.0 as I was finishing up some projects and did not want to change midstream. The problem started with working code (from 0022) that was moved to Arduino1.0. It would seem that the Arduino1.0 core files are not all as up to date with your fixes.

Logged

Rather people think you to be a fool than you open your mouth and confirm it.

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 11
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Weird, it works just fine for me with Arduino 1.0.1 (on Windows with the Mega 2560 or ADK selected).  I don't think it's changed since 1.0).  Can you post your sketch?
Logged

Centurion RSA
Offline Offline
Full Member
***
Karma: 0
Posts: 166
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's working now. I replaced the eeprom.h file and now it is working. The sketch was a example for a TFT grapic display. Not my code.
Logged

Rather people think you to be a fool than you open your mouth and confirm it.

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 11
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Weird.  Where was the old eeprom.h file located?  Where did you get the one you replaced it with?
Logged

Centurion RSA
Offline Offline
Full Member
***
Karma: 0
Posts: 166
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I found the replacement from one of the links that you provided earlier at this site:

http://www.cbxdragbike.com/arduino/new/

I dont recall where the eeprom.h file was located as I just pasted the new code when the file opened on the error. I think it was here though :

C:\arduino-1.0\hardware\tools\avr\avr\include\avr
Logged

Rather people think you to be a fool than you open your mouth and confirm it.

Pages: [1]   Go Up
Jump to: