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

Compiling error for Teensy 4.0 #5

Open
flasher69 opened this issue Dec 1, 2021 · 3 comments
Open

Compiling error for Teensy 4.0 #5

flasher69 opened this issue Dec 1, 2021 · 3 comments

Comments

@flasher69
Copy link

Hi,

first of all thank you for the great work.

So, I was trying to compile the Aurora example using a Teensy 4.0 and Smartmatrix Shield V5 but I get an error message in line 400:

Arduino: 1.8.16 (Mac OS X), TD: 1.55, Board: "Teensy 4.1, Serial, 600 MHz, Faster, US English"

In file included from /Users/thecrow/Documents/Arduino/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos-master/GFX/Aurora/matrix.h:8:0,
from /Users/thecrow/Documents/Arduino/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos-master/GFX/Aurora/Aurora.ino:1:
neomatrix_config.h:400: error: #elif with no expression
Multiple libraries were found for "FastLED.h"
Used: /Users/thecrow/Documents/Arduino/libraries/FastLED
Not used: /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/FastLED
Multiple libraries were found for "SD.h"
Used: /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SD
Not used: /Applications/Teensyduino.app/Contents/Java/libraries/SD
#elif with no expression

I've already defined IMXRT1062 for line 47 but that's the error I get. I din't have this problem with Teensy 3.5 and Smartmatrix Shield V4.

I'm also using Arduino 1.8.16 with Teensyduino 1.55

Any idea what might be the problem?

Thanx in advance.

cheers

@marcmerlin
Copy link
Owner

right, untested code, sorry :)
Try
#elif defined(IMXRT1062)

@flasher69
Copy link
Author

flasher69 commented Dec 2, 2021

Thanx Marc for the fast reply 👍

Unfortunately I have lot more errors now! XD
Here is what I get:

Arduino: 1.8.16 (Mac OS X), TD: 1.55, Board: "Teensy 4.1, Serial, 600 MHz, Faster, US English"

In file included from /Users/thecrow/Documents/Arduino/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos-master/GFX/Aurora/matrix.h:8:0,
                 from /Users/thecrow/Documents/Arduino/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos-master/GFX/Aurora/Aurora.ino:1:
/Users/thecrow/Documents/Arduino/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos-master/GFX/Aurora/neomatrix_config.h:47:0: warning: "__IMXRT1062__" redefined
 #define __IMXRT1062__
 ^
<command-line>:0:0: note: this is the location of the previous definition
In file included from /Users/thecrow/Documents/Arduino/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos-master/GFX/Aurora/neomatrix_config.h:132:0,
                 from /Users/thecrow/Documents/Arduino/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos-master/GFX/Aurora/matrix.h:8,
                 from /Users/thecrow/Documents/Arduino/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos-master/GFX/Aurora/Aurora.ino:1:
/Users/thecrow/Documents/Arduino/libraries/FastLED/src/FastLED.h:14:21: note: #pragma message: FastLED version 3.004.000
 #    pragma message "FastLED version 3.004.000"
                     ^
In file included from /Users/thecrow/Documents/Arduino/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos-master/GFX/Aurora/neomatrix_config.h:404:0,
                 from /Users/thecrow/Documents/Arduino/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos-master/GFX/Aurora/matrix.h:8,
                 from /Users/thecrow/Documents/Arduino/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos-master/GFX/Aurora/Aurora.ino:1:
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixHardware_Teensy3_ShieldV4.h:29:17: note: #pragma message: MatrixHardware: SmartLED Shield for Teensy 3 (V4)
 #pragma message "MatrixHardware: SmartLED Shield for Teensy 3 (V4)"
                 ^
In file included from /Users/thecrow/Documents/Arduino/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos-master/GFX/Aurora/neomatrix_config.h:407:0,
                 from /Users/thecrow/Documents/Arduino/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos-master/GFX/Aurora/matrix.h:8,
                 from /Users/thecrow/Documents/Arduino/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos-master/GFX/Aurora/Aurora.ino:1:
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/SmartMatrix.h:40:21: note: #pragma message: SmartMatrix Library version 4.000.003
 #    pragma message "SmartMatrix Library version 4.000.003"
                     ^
In file included from /Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/SmartMatrix.h:218:0,
                 from /Users/thecrow/Documents/Arduino/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos-master/GFX/Aurora/neomatrix_config.h:407,
                 from /Users/thecrow/Documents/Arduino/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos-master/GFX/Aurora/matrix.h:8,
                 from /Users/thecrow/Documents/Arduino/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos-master/GFX/Aurora/Aurora.ino:1:
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h: In static member function 'static void SmartMatrixRefreshT4<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>::begin()':
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:269:32: error: 'FLEXIO_PIN_CLK_TEENSY_PIN' was not declared in this scope
     uint8_t selected_clk_pin = FLEXIO_PIN_CLK_TEENSY_PIN;
                                ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:271:28: error: 'FLEXIO_PIN_CLK_TEENSY_PIN_ALT' was not declared in this scope
         selected_clk_pin = FLEXIO_PIN_CLK_TEENSY_PIN_ALT;
                            ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:276:13: error: 'FLEXIO_PIN_B0_TEENSY_PIN' was not declared in this scope
     pinMode(FLEXIO_PIN_B0_TEENSY_PIN, OUTPUT);
             ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:277:13: error: 'FLEXIO_PIN_R0_TEENSY_PIN' was not declared in this scope
     pinMode(FLEXIO_PIN_R0_TEENSY_PIN, OUTPUT);
             ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:278:13: error: 'FLEXIO_PIN_R1_TEENSY_PIN' was not declared in this scope
     pinMode(FLEXIO_PIN_R1_TEENSY_PIN, OUTPUT);
             ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:279:13: error: 'FLEXIO_PIN_G0_TEENSY_PIN' was not declared in this scope
     pinMode(FLEXIO_PIN_G0_TEENSY_PIN, OUTPUT);
             ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:280:13: error: 'FLEXIO_PIN_G1_TEENSY_PIN' was not declared in this scope
     pinMode(FLEXIO_PIN_G1_TEENSY_PIN, OUTPUT);
             ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:281:13: error: 'FLEXIO_PIN_B1_TEENSY_PIN' was not declared in this scope
     pinMode(FLEXIO_PIN_B1_TEENSY_PIN, OUTPUT);
             ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:282:13: error: 'FLEXPWM_PIN_OE_TEENSY_PIN' was not declared in this scope
     pinMode(FLEXPWM_PIN_OE_TEENSY_PIN, OUTPUT);
             ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:283:13: error: 'FLEXPWM_PIN_LATCH_TEENSY_PIN' was not declared in this scope
     pinMode(FLEXPWM_PIN_LATCH_TEENSY_PIN, OUTPUT);
             ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h: In static member function 'static void SmartMatrixRefreshT4<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>::hardwareSetup()':
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:426:32: error: 'FLEXIO_PIN_CLK_TEENSY_PIN' was not declared in this scope
     uint8_t selected_clk_pin = FLEXIO_PIN_CLK_TEENSY_PIN;
                                ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:428:28: error: 'FLEXIO_PIN_CLK_TEENSY_PIN_ALT' was not declared in this scope
         selected_clk_pin = FLEXIO_PIN_CLK_TEENSY_PIN_ALT;
                            ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:440:31: error: 'FLEXIO_PIN_B0_TEENSY_PIN' was not declared in this scope
     pFlex->setIOPinToFlexMode(FLEXIO_PIN_B0_TEENSY_PIN);
                               ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:441:31: error: 'FLEXIO_PIN_R0_TEENSY_PIN' was not declared in this scope
     pFlex->setIOPinToFlexMode(FLEXIO_PIN_R0_TEENSY_PIN);
                               ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:442:31: error: 'FLEXIO_PIN_R1_TEENSY_PIN' was not declared in this scope
     pFlex->setIOPinToFlexMode(FLEXIO_PIN_R1_TEENSY_PIN);
                               ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:443:31: error: 'FLEXIO_PIN_G0_TEENSY_PIN' was not declared in this scope
     pFlex->setIOPinToFlexMode(FLEXIO_PIN_G0_TEENSY_PIN);
                               ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:444:31: error: 'FLEXIO_PIN_G1_TEENSY_PIN' was not declared in this scope
     pFlex->setIOPinToFlexMode(FLEXIO_PIN_G1_TEENSY_PIN);
                               ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:445:31: error: 'FLEXIO_PIN_B1_TEENSY_PIN' was not declared in this scope
     pFlex->setIOPinToFlexMode(FLEXIO_PIN_B1_TEENSY_PIN);
                               ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:483:49: error: 'R_0_SIGNAL' was not declared in this scope
     flexPinConfig.r0 = pFlex->mapIOPinToFlexPin(R_0_SIGNAL) - lowestFlexPin;
                                                 ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:484:49: error: 'G_0_SIGNAL' was not declared in this scope
     flexPinConfig.g0 = pFlex->mapIOPinToFlexPin(G_0_SIGNAL) - lowestFlexPin;
                                                 ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:485:49: error: 'B_0_SIGNAL' was not declared in this scope
     flexPinConfig.b0 = pFlex->mapIOPinToFlexPin(B_0_SIGNAL) - lowestFlexPin;
                                                 ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:486:49: error: 'R_1_SIGNAL' was not declared in this scope
     flexPinConfig.r1 = pFlex->mapIOPinToFlexPin(R_1_SIGNAL) - lowestFlexPin;
                                                 ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:487:49: error: 'G_1_SIGNAL' was not declared in this scope
     flexPinConfig.g1 = pFlex->mapIOPinToFlexPin(G_1_SIGNAL) - lowestFlexPin;
                                                 ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:488:49: error: 'B_1_SIGNAL' was not declared in this scope
     flexPinConfig.b1 = pFlex->mapIOPinToFlexPin(B_1_SIGNAL) - lowestFlexPin;
                                                 ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:491:52: error: 'ADDX_0_SIGNAL' was not declared in this scope
     addxPinConfig.addx0 = pFlex->mapIOPinToFlexPin(ADDX_0_SIGNAL) - lowestFlexPin;
                                                    ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:492:52: error: 'ADDX_1_SIGNAL' was not declared in this scope
     addxPinConfig.addx1 = pFlex->mapIOPinToFlexPin(ADDX_1_SIGNAL) - lowestFlexPin;
                                                    ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:493:52: error: 'ADDX_2_SIGNAL' was not declared in this scope
     addxPinConfig.addx2 = pFlex->mapIOPinToFlexPin(ADDX_2_SIGNAL) - lowestFlexPin;
                                                    ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:494:52: error: 'ADDX_3_SIGNAL' was not declared in this scope
     addxPinConfig.addx3 = pFlex->mapIOPinToFlexPin(ADDX_3_SIGNAL) - lowestFlexPin;
                                                    ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:495:52: error: 'ADDX_4_SIGNAL' was not declared in this scope
     addxPinConfig.addx4 = pFlex->mapIOPinToFlexPin(ADDX_4_SIGNAL) - lowestFlexPin;
                                                    ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:569:62: error: 'FLEXIO_CLOCK_DIVIDER' was not declared in this scope
     flexIO->TIMCMP[0] = ((shiftsPerReload * 2 - 1) << 8) | ((FLEXIO_CLOCK_DIVIDER / 2 - 1) << 0);
                                                              ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:577:55: error: 'FLEXPWM_PIN_LATCH_TEENSY_PIN' was not declared in this scope
     const pwm_pin_info_struct latchPin = pwm_pin_info[FLEXPWM_PIN_LATCH_TEENSY_PIN];
                                                       ^
/Users/thecrow/Documents/Arduino/libraries/SmartMatrix-4.0.3/src/MatrixTeensy4Hub75Refresh_Impl.h:578:52: error: 'FLEXPWM_PIN_OE_TEENSY_PIN' was not declared in this scope
     const pwm_pin_info_struct OEPin = pwm_pin_info[FLEXPWM_PIN_OE_TEENSY_PIN];
                                                    ^
Multiple libraries were found for "SD.h"
 Used: /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SD
 Not used: /Applications/Teensyduino.app/Contents/Java/libraries/SD
Multiple libraries were found for "FastLED.h"
 Used: /Users/thecrow/Documents/Arduino/libraries/FastLED
 Not used: /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/FastLED
Error compiling for board Teensy 4.1.

@marcmerlin
Copy link
Owner

marcmerlin commented Dec 2, 2021

Ok, so I took arduino-teensy on linux, told it to build Aurora for teensy 4.0, and it built fine
Actually my compiler is fine with both

    #elif defined(__IMXRT1062__) // teensy v.4
and
    #elif __IMXRT1062__ // teensy v.4

so it seems the arduino compiler on Mac doesn't behave the same.

But I see you added

#define __IMXRT1062__

This is not something you define, it's defined by the compiler if the correct chip is specified at build time.

Then all your errors are in MatrixTeensy4Hub75Refresh_Impl.h and seem to be because of a mismatch in your CPU and the code being selected by SmartMatrix.

It's hard to tell from my side, but I'll give the same advise than in the other issue, which is to get basic smartmatrix working first, If you encounter issues with featuredemo, please post on https://community.pixelmatix.com/

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

No branches or pull requests

2 participants