Today I also was also very keen to use Jantje's plugin under Eclipse (Mars.1 Release 4.5.1) on macosx for compiling to the Maple Mini target board using Arduino for STM32.
After installing the Jantje plugin, the first issue under Eclipse was that in usb_core.c, the compiler could not find the definitions for NULL. I had to add the following include at the top of this file:
There were various other compile errors for which I started to add additional include paths to the following sections based on the reported missing files:
Eclipse->Project->Properties->C/C++ Build->Tool Settings->Arduino C++ Compiler->Include Folders
Eclipse->Project->Properties->C/C++ Build->Tool Settings->Arduino C Compiler->Include Folders
I eventually added the following "Include Folders" to both the C++ and C compiler sections:
Code: Select all
I then had a problem compiling the .S assembly language files which used the #include paths. I had assumed the above paths set in the Eclipse settings were the ones being used , but for the .S files, Eclipse was generating the include paths in a different way. The .S files consequently would not compile under Eclipse because the expanded gcc statement for the assembly files was referenced to the root directory.
I managed to solve the problem and get the STM32 Arduino source to compile for Maple Mini target using the following steps:
Eclipse->Project->Properties->C/C++ Build->Build Variables->Add
I then added a variable called "A.BUILD.SYSTEM.PATH" which on my mac needs to point to the following path: "/Applications/Arduino.app/Contents/Java/hardware/Arduino_STM32/STM32F1/system"
On other operating systems this path will be different depending on where the Arduino application was installed and where the Arduino_STM32 code was copied into the application.
I also noticed that the plugin assumes by default that the user is using Windows and that the upload tools are the Windows versions. In the Jantje plugin I could not see an option to select the machine OS type for the upload tools, so I worked around this by adding two symbolic links from the tools/win directory to the tools/macosx directory so that eclipse and the plugin could find them :
ln -s ../macosx/maple_upload maple_upload
ln -s ../macosx/upload-reset upload-reset
With the above, my code compiled and was downloaded to the target, but at first the target was unresponsive. I suspected that the binary file for the maple_upload was incorrect, but then I eventually worked out that it was not actually compiling my sketch as the .ino sketch file was in a subfolder of the Eclipse project, and this was not actually been compiled at all, so the resultant binary effectively had empty void setup() and void loop() functions. Once I realised this, I moved the sketch into the top level of the selected Eclipse project recompiled and the hit the upload button and it all worked well. Hurray, now I can do some development work...