Hi, guys
I've managed to compile and run blink example for Arduino Uno on archlinux x86_64, gcc-avr 4.6.1
Here is patch:
diff -u /usr/share/arduino/hardware/arduino/cores/arduino/pins_arduino.h ./pins_arduino.h
--- /usr/share/arduino/hardware/arduino/cores/arduino/pins_arduino.h 2011-07-19 14:29:17.000000000 +0300
+++ ./pins_arduino.h 2011-07-19 09:47:42.732685122 +0300
@@ -63,14 +63,14 @@
// On the ATmega1280, the addresses of some of the port registers are
// greater than 255, so we can't store them in uint8_t's.
-extern const uint16_t PROGMEM port_to_mode_PGM[];
-extern const uint16_t PROGMEM port_to_input_PGM[];
-extern const uint16_t PROGMEM port_to_output_PGM[];
+extern const prog_uint16_t port_to_mode_PGM[];
+extern const prog_uint16_t port_to_input_PGM[];
+extern const prog_uint16_t port_to_output_PGM[];
-extern const uint8_t PROGMEM digital_pin_to_port_PGM[];
-// extern const uint8_t PROGMEM digital_pin_to_bit_PGM[];
-extern const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[];
-extern const uint8_t PROGMEM digital_pin_to_timer_PGM[];
+extern const prog_uint8_t digital_pin_to_port_PGM[];
+// extern const prog_uint8_t digital_pin_to_bit_PGM[];
+extern const prog_uint8_t digital_pin_to_bit_mask_PGM[];
+extern const prog_uint8_t digital_pin_to_timer_PGM[];
// Get the bit location within the hardware port of the given virtual pin.
// This comes from the pins_*.c file for the active board configuration.
diff -u /usr/share/arduino/hardware/arduino/cores/arduino/Tone.cpp ./Tone.cpp
--- /usr/share/arduino/hardware/arduino/cores/arduino/Tone.cpp 2011-07-19 14:29:17.000000000 +0300
+++ ./Tone.cpp 2011-07-19 14:28:34.798922373 +0300
@@ -90,7 +90,7 @@
#define AVAILABLE_TONE_PINS 1
-const uint8_t PROGMEM tone_pin_to_timer_PGM[] = { 2 /*, 3, 4, 5, 1, 0 */ };
+const prog_uint8_t tone_pin_to_timer_PGM[] = { 2 /*, 3, 4, 5, 1, 0 */ };
static uint8_t tone_pins[AVAILABLE_TONE_PINS] = { 255 /*, 255, 255, 255, 255, 255 */ };
#elif defined(__AVR_ATmega8__)
@@ -105,7 +105,7 @@
#define AVAILABLE_TONE_PINS 1
// Leave timer 0 to last.
-const uint8_t PROGMEM tone_pin_to_timer_PGM[] = { 2 /*, 1, 0 */ };
+const prog_uint16_t tone_pin_to_timer_PGM[] = { 2 /*, 1, 0 */ };
static uint8_t tone_pins[AVAILABLE_TONE_PINS] = { 255 /*, 255, 255 */ };
#endif
Apply it with
cd / && sudo patch -p0 < /tmp/arduino.patch
As you see, I changed only types for constants. Got working ones from "avr/pgmspace.h", like:
typedef uint16_t PROGMEM prog_uint16_t;
So, it seems to me, that the problem lies in gcc-avr.
P.S.: delay() issue still exists with gcc-avr 4.6.1