Go Down

Topic: Compile error with Mega2560 selected (Read 1 time) previous topic - next topic

Marius

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: [Select]


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)'

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

mellis


Coding Badly

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

Marius

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 ;-)
Rather people think you to be a fool than you open your mouth and confirm it.

mellis

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?

Coding Badly

#5
Jun 15, 2012, 02:15 am Last Edit: Jun 15, 2012, 04:39 am by Coding Badly Reason: 1
Code: [Select]
#include <EEPROM.h>
void setup( void ) {}
void loop( void ) {}

Arduino Mega 2560 or Mega ADK
Arduino 1.0.1.

...not me.

Marius


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.

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

mellis

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?

Marius

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.
Rather people think you to be a fool than you open your mouth and confirm it.

mellis

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

Marius

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
Rather people think you to be a fool than you open your mouth and confirm it.

Go Up