J-f-Jensen / libraries

Libraries
4 stars 2 forks source link

Error compiling on Arduino 1.8.13 with Dan Brown's STM32duino #3

Open diegorivera opened 2 years ago

diegorivera commented 2 years ago

Hello. I'm trying to use this library on a generic STM32F board and Arduino IDE 1.8.13.

I'm using the http://dan.drown.org/stm32duino/package_STM32duino_index.json URL for additional board manager, and it's failing to compile.

Any ideas?

WARNING: library STM32CAN claims to run on stm32 architecture(s) and may be incompatible with your current board which runs on STM32F1 architecture(s).
In file included from C:\Users\Diego\Documents\WorkingCopies\stm32_camera\stm32_camera.ino:2:0:
C:\Users\Diego\Documents\Arduino\libraries\STM32CAN/STM32CAN.h:164:32: error: expected ')' before '*' token
     stm32Can( CAN_HandleTypeDef* pCanHandle, int portNumber );
                                ^
C:\Users\Diego\Documents\Arduino\libraries\STM32CAN/STM32CAN.h:215:21: error: 'CAN_HandleTypeDef' has not been declared
     void      init( CAN_HandleTypeDef* CanHandle, int baudrate, bool UseAltPins, bool loopBack );
                     ^
C:\Users\Diego\Documents\Arduino\libraries\STM32CAN/STM32CAN.h:216:34: error: 'CAN_HandleTypeDef' has not been declared
     void      calculateBaudrate( CAN_HandleTypeDef *CanHandle, int Baudrate );
                                  ^
C:\Users\Diego\Documents\Arduino\libraries\STM32CAN/STM32CAN.h:226:5: error: 'CAN_HandleTypeDef' does not name a type
     CAN_HandleTypeDef *n_pCanHandle;
     ^
exit status 1
Error compiling for board Generic STM32F103C series.
diegorivera commented 2 years ago

Forget this, I ended up using the official STM32 https://github.com/stm32duino/Arduino_Core_STM32 board support for arduino and now this compiles. Now I have to get a method to upload it to the board. Man, thanks for making this library, I was struggling to find a simple library that supported the not-so-common 33.3kbps for SWCAN, hope this works! Thanks!