-
Notifications
You must be signed in to change notification settings - Fork 6
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
Will not compile on Arduino IDE with an STM32F103 (Bluepill) #2
Comments
Thanks, I was able to reproduce this issue. Indeed the first error is with the round macro in the STM32F103 cores. I quickly bypassed this issue by adding I'm not sure the best path to fix eigen and units to work with the STM32F103 or whether those fixes should be made. In the meantime, I suggest forking the mpu9250 library and removing the dependencies on eigen and units. Sorry, I wish it was a more straightforward fix. |
Hello sir In file included from /Users/Documents/Arduino/libraries/eigen-main/src/Eigen/Core:19:0, in fact I want to use it with this library : https://github.com/FlyTheThings/uNavINS#axis-system. The author is using your library (even give this address) and after the compilation, the system is returning me also an error : In file included from /Documents/Arduino/Sketches/GPS/TinyGPSplus-for-Neo-M8N-master/examples/FullExample/FullExample.ino:1:0: I am a new for sure, but I already use several time other libraries and now, with this problem, I m little bit lost :( Thank you in advance for your time. |
Hi, |
@Heikkif, you can try v1.0.2 of the MPU9250 Library, which does not have dependencies on the Eigen or Units library. |
@Cougar83, which processor are you using? Based on the error message, it seems like it's not an ARM processor. |
i met the same error, im working on porting mini cheetah's code on arduino uno, lots of cpp .h or lib can't be found, |
@FrankXu626522, are you porting to an Arduino Uno? I wouldn't expect this to work on that platform. It's going to need a 32 bit ARM processor to work. |
This fails to compile the MPU9250 example using this library with either SPI or I2C examples.
It seems to be unhappy about the round macro .
Here is the log from the Compiler
Arduino: 1.8.19 (Linux), Board: "Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), Serial, 72Mhz (Normal), Smallest (default)"
In file included from /home/user/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/cores/maple/wirish.h:63:0,
from /home/user/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/cores/maple/Arduino.h:30,
from sketch/spi.ino.cpp:1:
/home/user/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)
^
/home/user/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/cores/maple/wirish_math.h:123:35: note: in definition of macro 'round'
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
^
/home/user/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)
^
/home/user/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/cores/maple/wirish_math.h:123:35: note: in definition of macro 'round'
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
^
/home/user/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)
^
/home/user/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/cores/maple/wirish_math.h:123:35: note: in definition of macro 'round'
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
^
In file included from /home/user/Arduino/libraries/Bolder_Flight_Systems_Eigen/src/Eigen/Core:172:0,
from /home/user/Arduino/libraries/Bolder_Flight_Systems_Eigen/src/eigen.h:36,
from /home/user/Arduino/libraries/Bolder_Flight_Systems_MPU9250/src/mpu9250.h:38,
from /home/user/Arduino/libraries/Bolder_Flight_Systems_MPU9250/examples/arduino/spi/spi.ino:26:
/home/user/Arduino/libraries/Bolder_Flight_Systems_Eigen/src/Eigen/src/Core/GenericPacketMath.h: In function 'Packet Eigen::internal::pround(const Packet&)':
/home/user/Arduino/libraries/Bolder_Flight_Systems_Eigen/src/Eigen/src/Core/GenericPacketMath.h:826:48: error: 'Eigen::numext::round' has not been declared
Packet pround(const Packet& a) { using numext::round; return round(a); }
^
In file included from /home/user/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/cores/maple/wirish.h:63:0,
from /home/user/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/cores/maple/Arduino.h:30,
from sketch/spi.ino.cpp:1:
/home/user/Arduino/libraries/Bolder_Flight_Systems_Eigen/src/Eigen/src/Core/arch/Default/Half.h: At global scope:
/home/user/Arduino/libraries/Bolder_Flight_Systems_Eigen/src/Eigen/src/Core/arch/Default/Half.h:732:50: error: expected unqualified-id before 'const'
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC half round(const half& a) {
^
/home/user/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/cores/maple/wirish_math.h:123:35: note: in definition of macro 'round'
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
^
/home/user/Arduino/libraries/Bolder_Flight_Systems_Eigen/src/Eigen/src/Core/arch/Default/Half.h:732:50: error: expected ')' before 'const'
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC half round(const half& a) {
^
/home/user/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/cores/maple/wirish_math.h:123:35: note: in definition of macro 'round'
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
^
/home/user/Arduino/libraries/Bolder_Flight_Systems_Eigen/src/Eigen/src/Core/arch/Default/Half.h:732:50: error: expected ')' before 'const'
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC half round(const half& a) {
^
/home/user/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/cores/maple/wirish_math.h:123:35: note: in definition of macro 'round'
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
^
/home/user/Arduino/libraries/Bolder_Flight_Systems_Eigen/src/Eigen/src/Core/arch/Default/BFloat16.h:564:54: error: expected unqualified-id before 'const'
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 round(const bfloat16& a) {
^
/home/user/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/cores/maple/wirish_math.h:123:35: note: in definition of macro 'round'
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
^
/home/user/Arduino/libraries/Bolder_Flight_Systems_Eigen/src/Eigen/src/Core/arch/Default/BFloat16.h:564:54: error: expected ')' before 'const'
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 round(const bfloat16& a) {
^
/home/user/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/cores/maple/wirish_math.h:123:35: note: in definition of macro 'round'
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
^
/home/user/Arduino/libraries/Bolder_Flight_Systems_Eigen/src/Eigen/src/Core/arch/Default/BFloat16.h:564:54: error: expected ')' before 'const'
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 round(const bfloat16& a) {
^
/home/user/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/cores/maple/wirish_math.h:123:35: note: in definition of macro 'round'
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
^
/home/user/Arduino/libraries/Bolder_Flight_Systems_Eigen/src/Eigen/src/Core/functors/UnaryFunctors.h: In member function 'const Scalar Eigen::internal::scalar_round_op::operator()(const Scalar&) const':
/home/user/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/cores/maple/wirish_math.h:123:33: error: expected unqualified-id before '(' token
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
^
/home/user/Arduino/libraries/Bolder_Flight_Systems_Eigen/src/Eigen/src/Core/functors/UnaryFunctors.h:798:106: note: in expansion of macro 'round'
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a) const { return numext::round(a); }
^
/home/user/Arduino/libraries/Bolder_Flight_Systems_Eigen/src/Eigen/src/Core/../plugins/ArrayCwiseUnaryOps.h: At global scope:
/home/user/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/cores/maple/wirish_math.h:123:36: error: expected unqualified-id before ')' token
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
^
/home/user/Arduino/libraries/Bolder_Flight_Systems_Eigen/src/Eigen/src/Core/../plugins/ArrayCwiseUnaryOps.h:467:1: note: in expansion of macro 'round'
round() const
^
/home/user/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/cores/maple/wirish_math.h:123:37: error: expected ')' before '>=' token
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
^
/home/user/Arduino/libraries/Bolder_Flight_Systems_Eigen/src/Eigen/src/Core/../plugins/ArrayCwiseUnaryOps.h:467:1: note: in expansion of macro 'round'
round() const
^
Multiple libraries were found for "Wire.h"
Used: /home/user/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/libraries/Wire
Not used: /home/user/.arduino15/packages/stm32duino/hardware/STM32F1/2021.5.31/libraries/WireSlave
exit status 1
Error compiling for board Generic STM32F103C series.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
The text was updated successfully, but these errors were encountered: