User manual

Table Of Contents
Raisonance Tools for ARM 4. Creating a project
The reduced version (“Small printf”) links the <Ride>\lib\ARM\small_printf(_thumb).a library,
which includes a complete printf, reduced for embedded applications.
The no-float version (“no-float printf”) links the <Ride>\lib\ARM\e_stdio(_thumb).a library, which
includes a even more reduced printf that does not handle floating points.
These libraries (small and no-float) have been written by Raisonance but are free and open-
source. The sources of the libraries can be found in
<Ride>\lib\ARM\small_printf\…
<Ride>\lib\ARM\e_stdio\…
You can use and distribute them freely.
These libraries call the __io_putchar function to send characters to their destination. (see “UART0
putchar” section above)
You just need to provide your own __io_putchar function if you want to redirect the output of
printf to whichever output channel(s) you wish. (UART1, etc.)
C++ Libraries
This option tells the linker to include the C++ libraries in addition to the C libraries, and is
required for linking C++ applications. See the section about C++ for more information.
This option MUST NOT be activated when building C applications.
4.4.2.5 More
This option lets you specify options that will be added to the command line. Those options are added
just before the linker configuration file in the command line. Look at the LD documentation for more
information on the available commands and switches.
4.4.2.6 Creating a C++ project (Enterprise)
Although the GCC toolchain allows building of C++ applications, Ride7 is designed to provide the best
experience to C users, not C++. Even so, the Enterprise version of the RKit-ARM can be used to build
C++ applications.
To create a C++ application, you need to proceed as described above for creating a C application, with
the following changes:
Change the C++ Libraries linker option to Yes. You can only do that if you are using the
Enterprise version of the RKit-ARM.
If you are using the default linker script, make sure you set the Starter Kit Limited option
(described above) to No. This is required because even the simplest C++ application is larger
than the 64K limitation.
Use a custom startup file (see above) and make sure it calls the __libc_init_array function
for executing static constructors before calling main. Most default startup codes, from
Raisonance, ST or others, DO NOT include this call because they are optimized for C
applications. So you need to add it yourself for C++ applications.
Include the GCC startup files by setting the Use GCC Startups linker option to 'Yes'. These
startups will include the C++ constructors.
Include at least one C++ file in your project. Ride7 and GCC use the file extension to recognize
that it is C or C++. All C++ files should have the cpp extension.
After that, building, programming and debugging the application works exactly as for a C application.
You will find an example of Ride7 project for a C++ application here:
<Ride>\Examples\ARM\REva\STM32F103_toggle_cpp
It implements all the points listed above. It is an interesting example of these points even if you work on
other CPUs.
Note: Debugging C++ applications with the the RKit-ARM Lite version is not supported. It may work in
some specific situations, however it is not included in the support agreement.
- 19 -