Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Compile issue with different ARM Cortex-M0+ boards #4

@gerowtj

Description

@gerowtj

The example code compiles correctly on my computer using Arduino IDE 1.8.13 and the Teensy LC board. The Teensy LC uses an ARM Cortex-M0+ processor. The board I am trying to use for my project is also an ARM Cortex-M0+ made by Seeeduino, the XIAO.

The Teensy LC compiles without any errors using your example program.
Changing the board to the XIAO gives several pages of errors.
Below are just the first few that have files for both the seeeduino board and eigen library listed:


In file included from sketch\sketch.ino.cpp:1:0:
c:\users\arduino\appdata\local\arduino15\packages\seeeduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\complex:69:30: error: expected unqualified-id before 'const'
   template<typename _Tp> _Tp abs(const complex<_Tp>&);
                              ^
c:\users\arduino\appdata\local\arduino15\packages\seeeduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\complex:69:30: error: expected ')' before 'const'
c:\users\arduino\appdata\local\arduino15\packages\seeeduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\complex:69:30: error: expected ')' before 'const'
c:\users\arduino\appdata\local\arduino15\packages\seeeduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\complex:601:5: error: expected unqualified-id before 'const'
     abs(const complex<_Tp>& __z) { return __complex_abs(__z); }
     ^
c:\users\arduino\appdata\local\arduino15\packages\seeeduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\complex:601:5: error: expected ')' before 'const'
c:\users\arduino\appdata\local\arduino15\packages\seeeduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\complex:601:5: error: expected ')' before 'const'
c:\users\arduino\appdata\local\arduino15\packages\seeeduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\complex: In static member function 'static _Tp std::_Norm_helper<true>::_S_do_it(const std::complex<_Tp>&)':
C:\Users\Arduino\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.3\cores\arduino/Arduino.h:137:16: error: expected unqualified-id before '(' token
 #define abs(x) ((x)>0?(x):-(x))
                ^
In file included from C:\Users\Arduino\Documents\Arduino\libraries\Bolder_Flight_Systems_Eigen\src/Eigen/Core:50:0,
                 from C:\Users\Arduino\Documents\Arduino\libraries\Bolder_Flight_Systems_Eigen\src/eigen.h:36,
                 from C:\Users\Arduino\Documents\Arduino\EigenProj\sketch\sketch.ino:1:
c:\users\arduino\appdata\local\arduino15\packages\seeeduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\complex: In function 'std::complex<_Tp> std::__complex_log(const std::complex<_Tp>&)':
c:\users\arduino\appdata\local\arduino15\packages\seeeduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\complex:773:26: error: expected primary-expression before '(' token
     { return complex<_Tp>(log(std::abs(__z)), std::arg(__z)); }
                          ^
In file included from sketch\sketch.ino.cpp:1:0:
C:\Users\Arduino\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.3\cores\arduino/Arduino.h:137:16: error: expected unqualified-id before '(' token
 #define abs(x) ((x)>0?(x):-(x))
                ^
c:\users\arduino\appdata\local\arduino15\packages\seeeduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\complex: In function 'std::complex<_Tp> std::__complex_sqrt(const std::complex<_Tp>&)':
C:\Users\Arduino\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.3\cores\arduino/Arduino.h:137:16: error: expected unqualified-id before '(' token
 #define abs(x) ((x)>0?(x):-(x))
                ^
c:\users\arduino\appdata\local\arduino15\packages\seeeduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\complex: In function '_Tp std::fabs(const std::complex<_Tp>&)':
C:\Users\Arduino\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.3\cores\arduino/Arduino.h:137:16: error: expected unqualified-id before '(' token
 #define abs(x) ((x)>0?(x):-(x))
                ^
C:\Users\Arduino\Documents\Arduino\libraries\Bolder_Flight_Systems_Eigen\src/Eigen/src/Core/MathFunctions.h: At global scope:
C:\Users\Arduino\Documents\Arduino\libraries\Bolder_Flight_Systems_Eigen\src/Eigen/src/Core/MathFunctions.h:1389:51: error: expected unqualified-id before 'const'
 inline EIGEN_MATHFUNC_RETVAL(round, Scalar) round(const Scalar& x)
                                                   ^
C:\Users\Arduino\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.3\cores\arduino/Arduino.h:139:24: note: in definition of macro 'round'
 #define round(x)     ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
                        ^
C:\Users\Arduino\Documents\Arduino\libraries\Bolder_Flight_Systems_Eigen\src/Eigen/src/Core/MathFunctions.h:1389:51: error: expected ')' before 'const'
 inline EIGEN_MATHFUNC_RETVAL(round, Scalar) round(const Scalar& x)
                                                   ^
C:\Users\Arduino\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.3\cores\arduino/Arduino.h:139:24: note: in definition of macro 'round'
 #define round(x)     ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
                        ^
C:\Users\Arduino\Documents\Arduino\libraries\Bolder_Flight_Systems_Eigen\src/Eigen/src/Core/MathFunctions.h:1389:51: error: expected ')' before 'const'
 inline EIGEN_MATHFUNC_RETVAL(round, Scalar) round(const Scalar& x)

I am assuming these errors are related to the C libraries that the Seeeduino board uses in the arduino compiler, from the ..\Seeeduino\hardware\samd\1.8.3\cores\ folder.
Some of the errors show headers from the eigen library as well that I assume are because of the errors with the Seeeduino code.

Do you know if there is any work around for these? My skill set is pretty limited in dealing with compilers and any core files for the boards.

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions