Problems with IDE 1.6.3

Phono
Tue May 05, 2015 6:30 am
Hello
I have installed the STM32 package as said on Arduino version 1.6.3.
Then I checked whether an empty sketch would compile.
So far, just compiling the empty sketch gives an error :

C:\Users\Jean-Marc\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\cores\maple\Stream.cpp: In member function ‘long int Stream::parseInt(char)’:
C:\Users\Jean-Marc\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\cores\maple\Stream.cpp:140:3: error: ‘boolean’ was not declared in this scope
boolean isNegative = false;
^

I have checked where boolean or bool is initially defined in the basic Arduino system, but I am not sure where it is.
I found 2 different definitions of a boolean type, but none is ideal.
As far as I know, a boolean can be of any integer type, but the best definitions for true and false are :

#define true (0==0)
#define false (0!=0)

I fear that other definitions may lead to inconsistencies.

For the time being, I just report the first problem, and I would be pleased if a fix could be found.

For your information, my aim is moving from the Maple IDE which is obsolete to Arduino, in order to keep the ability to program Olimex STM32 boards I use widely.

The libraries I need are :
EEPROM
OneWire
Ethernet
Wifly
FreeRTOS
LiquidCrystal
HardwareCAN

For the latter, I have used the one mentioned in the Maple forum, and I have even contributed to debug it. I think I can help porting it to Arduino.

Thanks for help

Jean-Marc


madias
Tue May 05, 2015 7:58 am
Oddly enough, I didn’t have such error messages, no matter what board.
but you are right, there are double defines (controlled by some #ifdef’s):

STM32F4/cores/maple/wirish.h
Showing the top match. Last indexed on Dec 28 2014.
68 bitClear(value, bit))
69 #define bit(b) (1UL << (b))
70
71 typedef uint8 boolean;
72 typedef uint8 byte;
73
74 #endif

STM32F3/cores/maple/wirish/wirish_types.h
Showing the top match. Last indexed on Feb 20.
63 #define __FLASH__ __attr_flash
64
65 typedef uint8 boolean;
66 typedef uint8 byte;
67
68 #endif


RogerClark
Tue May 05, 2015 9:56 am
Just to chip in.

Stream.cpp and Stream.h were taken from the Arduino IDE versions at about 1.5.8 So I if something doesnt compile, it could be best to try compiling for the Due as its basically the same code.

We have had instances, where people have code that won’t compile, but it transpired that it would not compile for Due either because of some differences in the ARM compiler etc

I know in this case you would have been using the ARM compiler already but the version is probably different.

PS. Its possible Stream.cpp and .h are now a little out of date with the files shipped in Arduino IDE for the Due, but its impossible to keep up with the mass of small changes that the IDE team are constantly making, and normally their changes to core files are not something would stop things compiling


Phono
Tue May 05, 2015 7:44 pm
I did the experiment.
I am using a new skectch, as comes when you start the IDE.
I have selected “Arduino Due with programming port”.
Then It compiles ok.
I change the board to “Leaflabs Maple rev 3+ to flash”, and I start compilation.
I get the error with the boolean type again.

C:\Users\Jean-Marc\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\cores\maple\Stream.cpp: In member function ‘long int Stream::parseInt(char)’:
C:\Users\Jean-Marc\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\cores\maple\Stream.cpp:140:3: error: ‘boolean’ was not declared in this scope
boolean isNegative = false;
^


Phono
Tue May 05, 2015 8:19 pm
Ok, I have re-installed the Arduino_STM32-master files, and attempted to compile an empty sketch.
It works better. So far, I can include the following libraries :
EEPROM
LiquidCrystal
OneWireSTM
Wifly
SPI

The sketch is :

#include <SPI.h>

#include <Debug.h>
#include <WiFly.h>

#include <OneWireSTM.h>

#include <LiquidCrystal.h>

#include <EEPROM.h>
#include <flash_stm32.h>

void setup() {
// put your setup code here, to run once:

}

void loop() {
// put your main code here, to run repeatedly:

}

**********************************************************
BUT !!!

If I add FreeRTOS, I get :

In file included from C:\Users\Jean-Marc\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\cores\maple/boards.h:38:0,
from C:\Users\Jean-Marc\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\cores\maple/wirish.h:53,
from C:\Users\Jean-Marc\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\cores\maple/Arduino.h:30,
from C:\Users\Jean-Marc\Documents\Arduino\libraries\FreeRTOS_ARM\FreeRTOS_ARM.c:6:
C:\Users\Jean-Marc\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\cores\maple/wirish_types.h:66:1: error: unknown type name ‘bool’
typedef bool boolean;

If I remove FreeRTOS and I add HardwareCAN, I get

In file included from C:\Users\Jean-Marc\Documents\Arduino\libraries\HardwareCAN/HardwareCAN.h:8:0,
from sketch_may05b.ino:1:
C:\Users\Jean-Marc\Documents\Arduino\libraries\HardwareCAN/utility/can.h:8:28: fatal error: libmaple_types.h: No such file or directory
#include “libmaple_types.h”
^
If I remove HardwareCAN and I add SdFat :

In file included from C:\Users\Jean-Marc\Documents\Arduino\libraries\SdFat/SdFat.h:38:0,
from sketch_may05b.ino:10:
C:\Users\Jean-Marc\Documents\Arduino\libraries\SdFat/SdFile.h:44:7: error: conflicting return type specified for ‘virtual int SdFile::write(const char*)’
int write(const char* str);
^


madias
Tue May 05, 2015 8:45 pm
Not a solution, but you can try this:
Move/copy all your used (non STM32-arduino included) libraries from the /User/Arduino/Library to the Arduino/Hardware/Arduino-STM32/STM32F1/libraries folder.

Phono
Tue May 05, 2015 8:56 pm
So did I, but with exactly the same errors.

RogerClark
Tue May 05, 2015 9:49 pm
I think you will need to post some of your code

If possible make a simple test program that demonstrates the problem, rather than posting the whole of your source code

BTW.

I’m not sure it anyone has tried the RTOS library recently, its likely not to work. Its the original RTOS lib from the Maple IDE but the Maple IDE used the Arduino API 0022, which is a bit different from the Arduino 1.0 API and also the changes is 1.5 and now 1.6

Can you also post links to

#include <Debug.h>
#include <WiFly.h>


mrburnette
Tue May 05, 2015 11:17 pm
RogerClark wrote:Just to chip in.

<…>
PS. Its possible Stream.cpp and .h are now a little out of date with the files shipped in Arduino IDE for the Due, but its impossible to keep up with the mass of small changes that the IDE team are constantly making, and normally their changes to core files are not something would stop things compiling


RogerClark
Tue May 05, 2015 11:37 pm
I think the difference is any, are very minor

Phono
Wed May 06, 2015 4:28 pm
To Roger Clarke :
I have absolutely no code to show you, for I have just opened the IDE and included the mentioned libraries into the skeleton code that comes, then compiled.

RogerClark
Thu May 07, 2015 1:25 am
A lot of the libraries you referenced are not ones that have been ported to STM32

In general its best to assume that any library which is not part of the repo may not work

This isnt necessarily a STM32 issue, it could be an ARM vs AVR compiler issue

Try switching the board type to Due and see is it compiles. This will highlight compiler issues and stuff not specific to STM32

The other option is to add the libs one by one to a blank sketch and see which ones don’t compile.

You’ll then need to post individually about each lib to see if anyone has ported it before, or whether you have to port it yourself


Phono
Thu May 07, 2015 5:31 am
Please explain the following from your installation procedure :

* If using Maple or Maple mini under windows the Maple Drivers page :
this sentence is incomplete. Can you complete it?

I did exactly as you said : from a blank sketch, I add one by one libraries until it does not compile.
The ones that do not compile are

FreeRTOS_ARM
HardwareCAN
SDFat

Could you have a look?
For the HardwareCAN, I contributed to debug it for Maple, so I can help but I do not know the APIs for Arduino. Could you give me hints to start the porting?


RogerClark
Thu May 07, 2015 5:55 am
Re: SDFat

I think there is a special / updated version of this.

VictorPV has been working with the original author of SDFat and I thought the latest version of SDFat has STM32 support, but it may not be the same lib as you are using.

Re: Libs like Hardware CAN and RTOS that worked with the original Maple IDE. The core of libmaple has been updated from the original version which was equivalent to Arduino 0022 to be generally compliant with the new API in 1.0 and now in 1.5+

Its likely that these changes may stop old libraries working, as they were written to interface with the old codebase

You can of course go back to using the original IDE and the original libmaple if you want.

However if you want to use this version (e.g. compatible with Arduino 1.0+ you will need to update your libs)


Leave a Reply

Your email address will not be published. Required fields are marked *