SoftConsole Quick Reference
Automatically Creating a C Project in SoftConsole
To create a C project, simply click on the "Write Application Code"
button in Libero, in the Design Flow pane. This will create a
SoftConsole workspace in <Project Directory>/SoftConsole that is
automatically populated with drivers and other useful tools., similar
to the image below. They are as follows:
is where application code should be located. If you expand this folder,
you'll notice a simple main.c is provided.
is where drivers and other useful platform-specific stuff are. Look
through the header files in this directory, there's a lot of
functionality here that will save you time. Some of the particularly
These are the drivers for the devices you added in the MSS or in
the top-level canvas in Libero. Look through the headers, they're very
well documented. If you can't find the driver you're looking for, you
can add it by opening "View/Configure Firmware Cores", found in the
Design Flow in Libero.
functions for enabling/disabling interrupts and for setting registers.
Contains the memory map for user-specified peripherals (e.g.
devices connected to the APB3).
for Cortex Microcontroller Software Interface Standard. It contains
abstractions for processor-level functionality. This will probably not
be particularly useful (the drivers and hal provide further
core_cm3.h: Contains Cortex-M3 specific
register definitions and intrinsics (C functions which map directly to
After doing this step, continue this tutorial at "Additional Project
Manually Creating a C Project in SoftConsole
Creating a Project
- Open SoftConsole and specify a workspace (file directory) for
- Select New Project under File
- Select a project for an Executable managed make targeted
Cortex M3 tools
- Confirm the following the configuration settings for Debug and
Release and finish.
- A project will be created with standard library includes. You
should see the following components in the SoftConsole Project Explorer.
Compiler, Assembler and Linker Settings
It may be necessary to change some of the default settings for the
compiler, assembler or linker. The setting are accessed by selecting
the project, right clicking and then selecting properties.
Under C/C++ build select settings. You will then see categories for
changing Compiler, Assembler and Linker Settings.
Adding MSS Device
Drivers to the Project
Libero will create device drivers for MSS components such as a UART or
GPIO. You must add these drivers to your SoftConsole project manually.
- You can import the drivers with SoftConsole under File
- Select General --> File System
- Select and browse to the Firmware directory of your Libero
project where the drivers reside.
- Select the firmware directory. Next expand and typically select
and drivers subdirectories.
- Finish and you should see the CMSIS and drivers directories added
to your project in SoftConsole Project Explorer.
Alternatively, you can drag the CMSIS
and driver directories from the Libero firmware directory into
the SoftConsole Project Explorer. Drop the directories onto the
directory you wish to place them in (in this case MyProject). This is
much easier then using SoftConsole Import function.
Adding Core Device
Drivers to the Project
The IO capacity of the SmartFusion system is not limited to the MSS.
Core library for standard IO like UARTs, SPI and
I2C can be instantiated in the FPGA by dragging core from the Libero
Core Library to the SmartFusion canvas. Libero
will also provide drivers for this hardware that you will need to
manually import to the SoftConsole. The process is a bit different than
that used to import drivers from the MSS.
- You must evoke a special application called Catalog. The
application is not currently available in the Libero Project Manager.
To find the executable, using a file system browser, go to Actel-->Libero_9.1-->Designer-->BIN--
in the C drive and
- Select the Driver you want and Generate in the lower left corner.
You will be prompted to select a destination directory for the driver.
select your SoftConsole project workspace and then project directory.
- The Catalog application should put the new drivers in the your
SoftConsole driver directory. In this case we added a Core UART driver.
NOTE: Some of the core drivers need
the HAL (hardware application layer) folder generated by the MSS. This
is a layer of software to standardize the interface between hardware
and software drivers. For instance, the CoreUARTap needs the HAL
folder. You will have to add this to your SoftConsole directory from
the Libero firmware directory. As stated above, you can simply drag the
folder into the SoftConsole Project Explorer. Be sure to drop it on the
Your SoftConsole project directory look something like this after
adding the HAL folder.
You may find that some of the hal directory path includes are
incomplete. You can manually edit them so they work, or in SoftConsole
setting you can add include paths under
Click add directory (+ box) and browse to any directory path you want
Linking Start Up and Default Libraries
Several default libraries and critical startup files contains the
startup exception code and interrupt vector tables must be linked in
with your code. By default these files should be linked, but you can
check by checking the linker settings.
- Select C/C++ Build-->Settings-->GNU C
Linker-->General. The general settings should have all categories
deselected and look like this.
NOTE: THIS IS DIFFERENT THEN THE
SETTINGS FOR AN ASSEMBLY PROJECT!
Additional Project Setup
Specifying Linker Load
We need to specify if we want to load the program into volatile or
non-volatile memory. The linker uses the load file for this purpose.
The path to the load file is set under
Project-->Properties-->C/C++ Build-->Settings-->GNU C
Static RAM (SRAM): Copy the
into the Miscellaneous Linker Flags
Window and Apply. The static ram is
volatile and has a capacity of 64K bytes for our devices.
Flash RAM: Copy the
following line into
the Miscellaneous Linker Flags Window
and Apply. The flash ram is
non-volatile and has a capacity of 256K bytes for our device.
Enable UART for printf()
To use a standard output like printf, you must add a UART
in the Libero MSS configuration tool and set a global variable in
Select the Project in the Project Explorer-->Properties. Under
C Compiler, select Symbols and add the following line.
Building a SoftConsole Project
To build all components of a project select clean under project and select build
all components in the option window that will appear at the start of a
Be sure that either Clean all projects is select or the project in
question, Start a build immediately and Build the entire
workspace is selected in the options that follow clean selection.
You can observe each source file compiling, linking and other file
generation by selecting the Console Tab in the command line window
below. This can be useful to trace errors.
Opening a SoftConsole
Open SoftConsole. under FILE, select switch Workspace. Select a recent
workspace directory or browse. When browsing, you should see 2
directories under the workspace directory. SELECT the workspace directory.
Debugging in SoftConsole
Once you have succesfully built a C project you can evoke the debugger
in SoftConsole to load the program to either SRAM or eNVM ram and debug
with the source line level debugger. You must first configure the
You must configure the SoftConsole Debugger for a static or flash
ram located program.
Static Ram Located Program
- To open the configuration tool, select the project in the project
window explore and select Debug as and Debug Configurations.
- The following window should appear.
- Select Launch Group Cortex M3
Ram target if you linked your
project to static ram (volatile
- Then select the "New" button. The following window will appear.
You can choose Debug and you will be prompted to launch into the
NOTE: For the debugger to load the
program to the kit, a Debug directory must be available in your
SoftConsole project and the location specified in the C/C++ Application
window shown above while configuring. The debug directory is not
created until you do a full build of your SoftConsole project. If you
configure the debugger before doing a build, the C/C++ Application
window will be empty. You will have to go back and manually browse for
the for the project location. In this case it is specified as
eNVM (non-volatile) Ram Located Program
- If you are locating your
program in flash (non-volatile)
ram, you must specify the Cortex-M3
eNVM Target when configuring the debugger as shown as follows.