Skip to content
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

MySensors GatewayW5100 example sketch do not compile with ATmega128 board #1403

Open
lwaga opened this issue Apr 10, 2020 · 0 comments
Open

Comments

@lwaga
Copy link

lwaga commented Apr 10, 2020

The same output gives boards with ATMega64, 128, 640, 1281, 2561.

>Executing task in folder home_light_automation: C:\.platformio\penv\Scripts\platformio.exe run

Processing ATmega128 (platform: atmelavr; board: ATmega128; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/ATmega128.html
PLATFORM: Atmel AVR 2.0.0 > ATmega128/A
HARDWARE: ATMEGA128 16MHz, 4KB RAM, 127KB Flash
PACKAGES:
 - framework-arduino-avr-megacore 2.0.2
 - toolchain-atmelavr 1.50400.190710 (5.4.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 14 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <Ethernet> 2.0.0
|   |-- <SPI> 1.0
|-- <MySensors> 2.3.1
|   |-- <Wire> 1.0
|   |-- <SPI> 1.0
|   |-- <EEPROM> 2.0
Building in release mode
Compiling .pio\build\ATmega128\src\main.cpp.o
Compiling .pio\build\ATmega128\lib475\SPI\SPI.cpp.o
Compiling .pio\build\ATmega128\lib134\Ethernet-2.0.0\Dhcp.cpp.o
Compiling .pio\build\ATmega128\lib134\Ethernet-2.0.0\Dns.cpp.o
In file included from C:\.platformio\packages\framework-arduino-avr-megacore\cores\MegaCore/Arduino.h:30:0,
                 from lib\Ethernet-2.0.0\src/Ethernet.h:49,
                 from src\main.cpp:124:
lib\MySensors/hal/architecture/AVR/MyHwAVR.cpp: In function 'void WDT_vect()':
lib\MySensors/hal/architecture/AVR/MyHwAVR.cpp:79:6: warning: 'WDT_vect' appears to be a misspelled signal handler, missing __vector prefix [-Wmisspelled-isr]
 ISR (WDT_vect)
      ^
In file included from lib\MySensors/MySensors.h:62:0,
                 from src\main.cpp:125:
lib\MySensors/hal/architecture/AVR/MyHwAVR.cpp: In function 'void hwPowerDown(uint8_t)':
lib\MySensors/hal/architecture/AVR/MyHwAVR.cpp:93:26: error: 'WDTCSR' was not declared in this scope
  const uint8_t WDTsave = WDTCSR;
                          ^
lib\MySensors/hal/architecture/AVR/MyHwAVR.cpp:97:33: error: 'WDIE' was not declared in this scope
   WDTCSR |= (1 << WDCE) | (1 << WDIE);
                                 ^
In file included from c:\.platformio\packages\toolchain-atmelavr\avr\include\avr\io.h:99:0,
                 from c:\.platformio\packages\toolchain-atmelavr\avr\include\avr\pgmspace.h:90,
                 from C:\.platformio\packages\framework-arduino-avr-megacore\cores\MegaCore/Arduino.h:28,
                 from lib\Ethernet-2.0.0\src/Ethernet.h:49,
                 from src\main.cpp:124:
lib\MySensors/hal/architecture/AVR/MyHwAVR.cpp: In function 'bool hwUniqueID(uint8_t (*)[16])':
lib\MySensors/hal/architecture/AVR/MyHwAVR.cpp:264:27: error: 'SIGRD' was not declared in this scope
  *((uint8_t *)uniqueID) = boot_signature_byte_get(0x00);
                           ^
lib\MySensors/hal/architecture/AVR/MyHwAVR.cpp:265:31: error: 'SIGRD' was not declared in this scope
  *((uint8_t *)uniqueID + 1) = boot_signature_byte_get(0x02);
                               ^
lib\MySensors/hal/architecture/AVR/MyHwAVR.cpp:266:31: error: 'SIGRD' was not declared in this scope
  *((uint8_t *)uniqueID + 2) = boot_signature_byte_get(0x04);
                               ^
lib\MySensors/hal/architecture/AVR/MyHwAVR.cpp:267:31: error: 'SIGRD' was not declared in this scope
  *((uint8_t *)uniqueID + 3) = boot_signature_byte_get(0x01); //OSCCAL
                               ^
In file included from lib\MySensors/MySensors.h:62:0,
                 from src\main.cpp:125:
lib\MySensors/hal/architecture/AVR/MyHwAVR.cpp: In function 'uint16_t hwCPUFrequency()':
lib\MySensors/hal/architecture/AVR/MyHwAVR.cpp:304:26: error: 'WDTCSR' was not declared in this scope
  const uint8_t WDTsave = WDTCSR;
                          ^
lib\MySensors/hal/architecture/AVR/MyHwAVR.cpp:308:2: error: 'TIFR1' was not declared in this scope
  TIFR1 = 0xFF;
  ^
lib\MySensors/hal/architecture/AVR/MyHwAVR.cpp:315:18: error: 'WDIE' was not declared in this scope
  WDTCSR |= (1 << WDIE);
                  ^
In file included from c:\.platformio\packages\toolchain-atmelavr\avr\include\avr\io.h:99:0,
                 from c:\.platformio\packages\toolchain-atmelavr\avr\include\avr\pgmspace.h:90,
                 from C:\.platformio\packages\framework-arduino-avr-megacore\cores\MegaCore/Arduino.h:28,
                 from lib\Ethernet-2.0.0\src/Ethernet.h:49,
                 from src\main.cpp:124:
lib\MySensors/hal/architecture/AVR/MyHwAVR.cpp:320:29: error: 'WDIF' was not declared in this scope
  while (bit_is_clear(WDTCSR,WDIF)) {};
                             ^
*** [.pio\build\ATmega128\src\main.cpp.o] Error 1
=================================================================================== [FAILED] Took 1.07 seconds ===================================================================================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

I suppose there is problem with using definictions from wdt.h maybe.

#define wdt_reset() __asm__ __volatile__ ("wdr")

#ifndef __DOXYGEN__

#if defined(WDP3)
# define _WD_PS3_MASK       _BV(WDP3)
#else
# define _WD_PS3_MASK       0x00
#endif

#if defined(WDTCSR)
#  define _WD_CONTROL_REG     WDTCSR
#elif defined(WDTCR)
#  define _WD_CONTROL_REG     WDTCR
#else
#  define _WD_CONTROL_REG     WDT
#endif

#if defined(WDTOE)
#define _WD_CHANGE_BIT      WDTOE
#else
#define _WD_CHANGE_BIT      WDCE
#endif

#endif	/* !__DOXYGEN__ */

With ATmega128 board we have here NOT defined WDP3, WDTCSR and WDTOE, but defined WDTCR.
With ATmega2560 board, we have defined WDP3 and WDTCSR, but not defined WDTCR and WDTOE.

I do not know if it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants