Closed ansemjo closed 5 years ago
@ansemjo please try my PR. I can compile using ANET default cnf
Nice! Your pull request compiles correctly with platformio
, yes.
Out of interest I retried compiling with arduino-cli
again and I am once more hitting the errors from #15540:
$ arduino-cli compile --fqbn Sanguino\:avr\:sanguino\:cpu=atmega1284p Marlin/Marlin.ino
In file included from /tmp/arduino-sketch-CE86B61259E71E1DEABA5D41D890BEF6/sketch/src/module/endstops.cpp:36:0:
/tmp/arduino-sketch-CE86B61259E71E1DEABA5D41D890BEF6/sketch/src/module/../HAL/HAL_AVR/endstop_interrupts.h: In function 'void setup_endstop_interrupts()':
/tmp/arduino-sketch-CE86B61259E71E1DEABA5D41D890BEF6/sketch/src/module/../HAL/HAL_AVR/endstop_interrupts.h:119:7: error: non-constant condition for static assertion
static_assert(digitalPinToPCICR(X_MIN_PIN), "X_MIN_PIN is not interrupt-capable");
^~~~~~~~~~~~~
In file included from /home/ansemjo/.arduino15/packages/arduino/hardware/avr/1.8.1/cores/arduino/Arduino.h:257:0,
from /tmp/arduino-sketch-CE86B61259E71E1DEABA5D41D890BEF6/sketch/src/module/../inc/../HAL/./HAL_AVR/../shared/Marduino.h:36,
from /tmp/arduino-sketch-CE86B61259E71E1DEABA5D41D890BEF6/sketch/src/module/../inc/../HAL/./HAL_AVR/HAL.h:21,
from /tmp/arduino-sketch-CE86B61259E71E1DEABA5D41D890BEF6/sketch/src/module/../inc/../HAL/HAL.h:26,
from /tmp/arduino-sketch-CE86B61259E71E1DEABA5D41D890BEF6/sketch/src/module/../inc/MarlinConfig.h:30,
from /tmp/arduino-sketch-CE86B61259E71E1DEABA5D41D890BEF6/sketch/src/module/endstops.h:28,
from /tmp/arduino-sketch-CE86B61259E71E1DEABA5D41D890BEF6/sketch/src/module/endstops.cpp:27:
/home/ansemjo/.arduino15/packages/Sanguino/hardware/avr/1.0.3/variants/sanguino/pins_arduino.h:112:70: error: reinterpret_cast from integer to pointer
#define digitalPinToPCICR(p) ( (((p) >= 0) && ((p) <= 31)) ? (&PCICR) : ((uint8_t *)0) )
~^~~~~~~
/tmp/arduino-sketch-CE86B61259E71E1DEABA5D41D890BEF6/sketch/src/module/../HAL/HAL_AVR/endstop_interrupts.h:119:21: note: in expansion of macro 'digitalPinToPCICR'
static_assert(digitalPinToPCICR(X_MIN_PIN), "X_MIN_PIN is not interrupt-capable");
// repeated for Y_MIN_PIN and Z_MIN_PIN
I compiled ANET with arduino ide and compiles fine. What is arduino-cli?
arduino-cli
is from here: https://github.com/arduino/arduino-cli
I originally tried it because I wanted to automate builds with a Makefile without opening the IDE each time and before I knew about PlatformIO.
Can you try to compile with arduino ide? Just to know if it works and if issue is only on "-cli" version I was able to compile!
I'm not sure if I'm doing something wrong but the newest Arduino IDE doesn't work for me either -- it fails with exactly the same error message.
~/Arduino
and ~/.arduino15
to ensure clean environment.Sanguino
and processor ATmega1284 or ATmega1284P (16 MHz)
from Tools menu.In file included from sketch/src/module/endstops.cpp:36:0:
sketch/src/module/../HAL/HAL_AVR/endstop_interrupts.h: In function 'void setup_endstop_interrupts()':
sketch/src/module/../HAL/HAL_AVR/endstop_interrupts.h:119:7: error: non-constant condition for static assertion
static_assert(digitalPinToPCICR(X_MIN_PIN), "X_MIN_PIN is not interrupt-capable");
^~~~~~~~~~~~~
In file included from /tmp/arduino-1.8.10/hardware/arduino/avr/cores/arduino/Arduino.h:257:0,
from sketch/src/module/../inc/../HAL/./HAL_AVR/../shared/Marduino.h:36,
from sketch/src/module/../inc/../HAL/./HAL_AVR/HAL.h:21,
from sketch/src/module/../inc/../HAL/HAL.h:26,
from sketch/src/module/../inc/MarlinConfig.h:30,
from sketch/src/module/endstops.h:28,
from sketch/src/module/endstops.cpp:27:
/home/ansemjo/.arduino15/packages/Sanguino/hardware/avr/1.0.3/variants/sanguino/pins_arduino.h:112:70: error: reinterpret_cast from integer to pointer
#define digitalPinToPCICR(p) ( (((p) >= 0) && ((p) <= 31)) ? (&PCICR) : ((uint8_t *)0) )
~^~~~~~~
sketch/src/module/../HAL/HAL_AVR/endstop_interrupts.h:119:21: note: in expansion of macro 'digitalPinToPCICR'
static_assert(digitalPinToPCICR(X_MIN_PIN), "X_MIN_PIN is not interrupt-capable");
^~~~~~~~~~~~~~~~~
In file included from sketch/src/module/endstops.cpp:36:0:
sketch/src/module/../HAL/HAL_AVR/endstop_interrupts.h:135:7: error: non-constant condition for static assertion
static_assert(digitalPinToPCICR(Y_MIN_PIN), "Y_MIN_PIN is not interrupt-capable");
^~~~~~~~~~~~~
edit: Just to be clear: the exact same checkout and configuration compiles fine with PlatfromIO via platformio run -e sanguino_atmega1284p
.
However, this is unrelated to the original issue that I opened here, I think. Discussion about the error around error: reinterpret_cast from integer to pointer
should maybe continue in #15540?
so since this compiles fine on platform.io would it be fair to say that this is not related to marlin?
This is related to arduino ide, @thinkyhead tryed to solve it but since new define are not present for other avr boards..he solved only 2560... Since some define have to be added I think its better to leave old defines and add something only for "assertion" check, I have not figured out how to solve it. All supported avr boards have to be consideredto create new define and I have no idea how many boards needs to be added
oki, will close as its related to compiler software and not marlin
we can reopen if the issue is truely within marlin
I do not agree, @boelle. This issue still needs @GMagician's pull request #15771 merged to be fixed. As it stands, the current bugfix-2.0.x
branch does not compile with the example Anet A8 configuration -- neither with the Arduino IDE nor with PlatformIO. See the scripts in my first comment to reproduce this.
I was simply saying that the next issue about reinterpet_cast
around &PCICR
is a different issue.
Please reopen this issue and / or merge #15771.
I was simply saying that the next issue about reinterpet_cast around &PCICR is a different issue.
@ansemjo my PR now should also fix it
@boelle, could you please re-open this issue? It is an issue within Marlin and @GMagician already has a fix for it. But that still needs to be merged.
what pr # is it?
It's PR #15771. That pull request also fixes issue #15540.
Weird, this wasn't closed when the PR was merged.
I believe this is fixed now, thanks.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Description
The Marlin bugfix-2.0.x branch cannot be compiled for the Anet A8 (
sanguino_atmega1284p
) when the interrupts featureENDSTOP_INTERRUPTS_FEATURE
is enabled. Specifically the function used to check interrupt capability on pins does not seem to be defined:Steps to Reproduce
I'm trying to build via the PlatformIO CLI Version 4.0.3 (most recent, installed via
pip
) but I've previously tried the Arduino IDE Version 1.8.9 and the Arduino CLIarduino-cli
Version 0.3.7-alpha.preview as well.Below are two scripts to reproduce with the default example configurations for the Anet A8 on the
bugfix-1.1.x
andbugfix-2.0.x
branch. Thebugfix-1.1.x
branch works fine.bugfix-2.0.x
Shell script to reproduce:
Full Build Log (click to expand)
``` $ bash ~/marlin-bugfix-2.0.x-anet-a8 /tmp/tmp.i9Bo3aejSL Cloning into '.'... remote: Enumerating objects: 26, done. remote: Counting objects: 100% (26/26), done. remote: Compressing objects: 100% (8/8), done. remote: Total 221681 (delta 22), reused 18 (delta 18), pack-reused 221655 Receiving objects: 100% (221681/221681), 116.50 MiB | 6.87 MiB/s, done. Resolving deltas: 100% (143164/143164), done. Branch 'bugfix-2.0.x' set up to track remote branch 'bugfix-2.0.x' from 'origin'. Switched to a new branch 'bugfix-2.0.x' Using base prefix '/usr' New python executable in /tmp/tmp.i9Bo3aejSL/venv/bin/python Installing setuptools, pip, wheel... done. Processing /home/ansemjo/.cache/pip/wheels/a1/d0/2b/9cd2336ee6fe396dceaa2ec4419df4e96da9f4fd61c36ac208/platformio-4.0.3-cp37-none-any.whl Collecting colorama Using cached https://files.pythonhosted.org/packages/4f/a6/728666f39bfff1719fc94c481890b2106837da9318031f71a8424b662e12/colorama-0.4.1-py2.py3-none-any.whl Processing /home/ansemjo/.cache/pip/wheels/e1/41/5e/e201f95d90fc84f93aa629b6638adacda680fe63aac47174ab/tabulate-0.8.5-cp37-none-any.whl Collecting semantic-version<3,>=2.8.1 Using cached https://files.pythonhosted.org/packages/0f/3b/8fee26649a86c71df159ed0ae7ac5f9ac38829bccd8a7404e116f903929b/semantic_version-2.8.2-py2.py3-none-any.whl Collecting bottle<0.13 Using cached https://files.pythonhosted.org/packages/69/d1/efdd0a5584169cdf791d726264089ce5d96846a8978c44ac6e13ae234327/bottle-0.12.17-py3-none-any.whl Collecting click<8,>=5 Using cached https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl Collecting pyserial!=3.3,<4,>=3 Using cached https://files.pythonhosted.org/packages/0d/e4/2a744dd9e3be04a0c0907414e2a01a7c88bb3915cbe3c8cc06e209f59c30/pyserial-3.4-py2.py3-none-any.whl Collecting requests<3,>=2.4.0 Using cached https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 Using cached https://files.pythonhosted.org/packages/e0/da/55f51ea951e1b7c63a579c09dd7db825bb730ec1fe9c0180fc77bfb31448/urllib3-1.25.6-py2.py3-none-any.whl Collecting idna<2.9,>=2.5 Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl Collecting chardet<3.1.0,>=3.0.2 Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl Collecting certifi>=2017.4.17 Using cached https://files.pythonhosted.org/packages/18/b0/8146a4f8dd402f60744fa380bc73ca47303cccf8b9190fd16a827281eac2/certifi-2019.9.11-py2.py3-none-any.whl Installing collected packages: colorama, tabulate, semantic-version, bottle, click, pyserial, urllib3, idna, chardet, certifi, requests, platformio Successfully installed bottle-0.12.17 certifi-2019.9.11 chardet-3.0.4 click-7.0 colorama-0.4.1 idna-2.8 platformio-4.0.3 pyserial-3.4 requests-2.22.0 semantic-version-2.8.2 tabulate-0.8.5 urllib3-1.25.6 Processing sanguino_atmega1284p (platform: atmelavr; framework: arduino; board: sanguino_atmega1284p) -------------------------------------------------------------------------------- Verbose mode can be enabled via `-v, --verbose` option CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/sanguino_atmega1284p.html PLATFORM: Atmel AVR 1.15.0 > Sanguino ATmega1284p (16MHz) HARDWARE: ATMEGA1284P 16MHz, 16KB RAM, 127KB Flash PACKAGES: toolchain-atmelavr 1.50400.190710 (5.4.0), framework-arduinoavr 4.1.2 Converting Marlin.ino LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf LDF Modes: Finder ~ chain, Compatibility ~ soft LibraryManager: Installing U8glib-HAL Using cache: /home/ansemjo/.platformio/.cache/a7/b7a9b473d1c239d9843ca943887cd0a7 U8glib-HAL @ 0.4.1 has been successfully installed! Looking for LiquidCrystal library in registry Conflict: More than one library has been found by request {"name": "LiquidCrystal", "requirements": "1.3.4"}: LiquidCrystal ============= #ID: 136 LiquidCrystal Library is faster and extensable, compatible with the original LiquidCrystal library Automatically chose the first available library (use `--interactive` option to make a choice) Keywords: lcd, hd44780 Compatible frameworks: Arduino Compatible platforms: Atmel AVR, Espressif 32, Espressif 8266 Authors: F Malpartida LiquidCrystal ============= #ID: 887 Allows communication with alphanumerical liquid crystal displays (LCDs). Keywords: display Compatible frameworks: Arduino Compatible platforms: Atmel AVR, Atmel SAM, Espressif 32, Espressif 8266, Intel ARC32, Microchip PIC32, Nordic nRF51, Nordic nRF52, ST STM32, Teensy, TI MSP430 Authors: Arduino, Adafruit Found: https://platformio.org/lib/show/136/LiquidCrystal LibraryManager: Installing id=136 @ 1.3.4 Using cache: /home/ansemjo/.platformio/.cache/56/e51065281cd05bea572117c1aab6cb56 LiquidCrystal @ 1.3.4 has been successfully installed! Looking for TMCStepper library in registry Found: https://platformio.org/lib/show/5513/TMCStepper LibraryManager: Installing id=5513 @ >=0.5.0,<1.0.0 Using cache: /home/ansemjo/.platformio/.cache/f2/c964ba3bc2d0f713c5f18c28dffcb7f2 TMCStepper @ 0.5.2 has been successfully installed! Looking for Adafruit NeoPixel library in registry Found: https://platformio.org/lib/show/28/Adafruit NeoPixel LibraryManager: Installing id=28 @ 1.2.5 Using cache: /home/ansemjo/.platformio/.cache/1e/027dc0abcdf77d5062fe1a257738301e Adafruit NeoPixel @ 1.2.5 has been successfully installed! LibraryManager: Installing LiquidTWI2 Using cache: /home/ansemjo/.platformio/.cache/85/8b02db3fff9254d346da3ee4646b5f85 LiquidTWI2 @ 0.0.0 has been successfully installed! LibraryManager: Installing Arduino-L6470 Using cache: /home/ansemjo/.platformio/.cache/e0/a85bf8ed5b8232b743f62637d1e2c2e0 Arduino-L6470 @ 0.7.0 has been successfully installed! LibraryManager: Installing SailfishLCD Using cache: /home/ansemjo/.platformio/.cache/e1/f7005198ad8e3a4b619768bbbcd33ae1 SailfishLCD @ 0.0.0 has been successfully installed! LibraryManager: Installing SailfishRGB_LED Using cache: /home/ansemjo/.platformio/.cache/ae/92268909fe23d8d88d696e4077aa46ae SailfishRGB_LED @ 0.0.0 has been successfully installed! LibraryManager: Installing SlowSoftI2CMaster Using cache: /home/ansemjo/.platformio/.cache/57/ba98e6910d02720ff6cc39cb62b43957 SlowSoftI2CMaster @ 0.0.0 has been successfully installed! LibraryManager: Installing TMC26XStepper Using cache: /home/ansemjo/.platformio/.cache/76/17932f018f31ca6496fe4128e14ef276 TMC26XStepper @ 0.0.0 has been successfully installed! Found 15 compatible libraries Scanning dependencies... Dependency Graph |--bugfix-1.1.x
A similar bash script to reproduce the example compilation on the
bugfix-1.1.x
branch, which compiles without error:Expected behavior: The example configuration should compile without error with
ENDSTOP_INTERRUPTS_FEATURE
enabled.Actual behavior: The compilation fails on the
bugfix-2.0.x
branch.Additional Information
The full build log can be seen above.
I have previously tried other build methods and used older commits of the
bugfix-2.0.x
branch and hit #15540 before. Issues #9632 and #10480 might be related too but I'm not sure.Of course I can simply disable the interrupts feature and then the firmware compiles without error. But then why did it work before (and still does on the
bugfix-1.1.x
branch)?