5.11 Handoff Design for Firmware Development (SmartFusion 2 and IGLOO 2)

The following sections apply to SmartFusion 2 and IGLOO 2 devices only.

5.11.1 Software IDE Integration (SmartFusion 2 and IGLOO 2)

Libero SoC simplifies the task of transitioning between designing your FPGA to developing your embedded firmware.

Libero SoC manages the firmware for your FPGA hardware design, including:

  • Firmware hardware abstraction layers required for your processor
  • Firmware drivers for the processor peripherals that you use in your FPGA design
  • Sample application projects are available for drivers that illustrate the proper usage of the APIs

To see which firmware drivers Libero SoC has found to be compatible with your design, open the Firmware View. From this view, you can change the configuration of your firmware, change to a different version, read driver documentation, and generate any sample projects for each driver.

Libero SoC manages the integration of your firmware with your preferred Software Development Environment, including SoftConsole, Keil, and IAR Embedded Workbench. The projects and workspaces for your selected development environment are generated automatically with the proper settings and flags so you can write your application immediately.

5.11.2 Viewing/Configuring Firmware Cores (SmartFusion 2 and IGLOO 2)

The Design Firmware tab allows you to select and configure firmware cores (drivers) for your Software IDE project. The tab lists the compatible firmware for the hardware you instantiated in your design.

To display the Design Firmware tab in the Design Flow tab, expand Create Design and double-click View/Configure Firmware Cores.

The Firmware table lists the compatible firmware and drivers based on the hardware peripherals used in your design. Each row represents a firmware core that is compatible with a hardware peripheral in your design. The following table describes the columns in the Firmware table.

Table 5-124. Columns in the Firmware Table
ColumnDescription
GenerateChoose whether you want the files for this firmware core to be generated on disk and added to your Software IDE project. Click the checkbox to generate firmware for each peripheral in your design.
Instance NameName of the firmware instance. This can help to identify firmware cores when you have multiple firmware cores with the same Vendor:Library:Name:Version (VLNV) in your design.
Core TypeName from the VLNV ID of the core. This name generally corresponds to the name of the hardware peripheral with which the firmware core is compatible.
VersionFirmware core version. Use the drop-down menu to upgrade or choose a different version.
Compatible Hardware Instance Hardware instance in your design that is compatible with this firmware core.

5.11.2.1 Downloading Firmware

Libero attempts to find compatible firmware located in the IP Vault located on your disk, as well as firmware in the IP Repository via the Internet.

If compatible firmware is found in the IP repository but not on your disk, the row will be italicized, indicating that it needs to be downloaded. To download all firmware cores necessary for your project peripherals, click the Download All Firmware icon in the vertical toolbar.

Libero IDE Fails to Connect to Default Repositories over the Internet

If Libero IDE fails to connect to the web repositories on a computer connected to the Internet, it typically means that the connection is being blocked by a network firewall or that the Internet connection is made via a proxy server. Verify that the URLs shown in your catalog options window are correct: Libero > Catalog > Options > Vault Repositories Settings/Repositories.

If your Internet gateway uses a proxy server:
  1. From the Libero IDE toolbar, go to Project > Preferences and click the Proxy tab.
  2. Check the Use a Proxy Server check box.
  3. Enter the Proxy Server name on the network. In most cases, using the proxy server name solves the problem. If the server name does not work, enter the IP address of the proxy server.

5.11.2.2 Configuring Firmware

Firmware cores that have configurable options will have a wrench icon in the row. Click the wrench icon to configure the firmware core.

It is important that you check the configuration of your firmware cores if they have configurable options. They might have options that target your software IDE (Keil, IAR, or SoftConsole), or your processor, that are vital configuration options for the system to work properly.

5.11.2.3 Generating Firmware

Click the UI control icon to export the firmware drivers and software IDE project for your project. The firmware drivers are generated into <project>\firmware and the software workspace is exported to <project>\<toolchain>.

<toolchain> could be SoftConsole, IAR, or Keil, depending on your software IDE. The firmware drivers are also copied into the <toolchain> folder.

5.11.2.4 Changing Firmware Core Versions

You can manually change to the latest version by selecting the drop-down in the Version column.

There will often be multiple versions of a firmware cores available for a particular peripheral. The MSS Configurator selects the latest compatible version for a new design.

However, once the firmware is added to your design, Libero will not automatically change to the latest version if one becomes available.

Note: If a core version is shown in italics, it is available in the Web Repository but not in your Vault. You must download the firmware core version to use it in your design.

5.11.2.5 Generating Sample Projects

Firmware cores are packaged with sample projects that demonstrate their usage. They are packaged for specific tool chains, such as Keil, IAR, and SoftConsole

To generate a sample project,
  1. Right-click the firmware core
  2. Choose Generate Sample Project
  3. Select your IDE tool chain (such as Keil) and choose from the list of available samples.

You will be prompted to select the destination folder for the sample project.

Once this project is generated you can use it as a starting point in your Software IDE tool or use the example project as a reference on how to use the firmware driver.

5.11.2.6 Fabric Peripherals

Libero SoC also attempts to find compatible firmware for soft (fabric) peripherals that you have added in your top- level SmartDesign if that top-level is Set as Root.

To set your top-level design as a root, right-click your top-level design in the Design Hierarchy and choose Set as Root. The root component appears in bold.

The following figure shows CoreGPIO, CorePWM, and CoreUARTapb soft cores that are added into your top-level SmartDesign.

Figure 5-233. Firmware Cores Tab (DESIGN_FIRMWARE)
???

5.11.3 Exporting Firmware (SmartFusion 2 and IGLOO 2)

When your design is completed, you can export the design firmware configuration using the Export Firmware tool. The firmware configuration contains:

  • Register configuration files for MSS, FDDR, and SERDES blocks instantiated in your design. This information, along with the SmartFusion 2 CMSIS firmware core, must be compiled with your application to have proper Peripheral Initialization when the Cortex-M3 boots.
  • Firmware drivers compatible with the hard and soft peripherals instantiated in your design.
Note: If you make any changes to your design, you must re-export firmware.
To export your design firmware configuration:
  1. In the Libero SoC Design Flow window, under Handoff Design for Firmware Development, double-click Export Firmware. The Export Firmware dialog box appears.
  2. Complete the fields in the dialog box.
  3. Click OK.
Figure 5-234. Export Firmware Dialog Box
???
Table 5-125. Fields in the Export Firmware Dialog Box
FieldDescription
LocationLocation where you want the firmware configuration files to be exported. When you export the firmware, Libero SoC creates a Firmware folder to store all the drivers and register configuration files.
Software IDE: <selected Software Tool Chain>Libero SoC creates the firmware project for the IDE tool of your choice and stores the projects in the folder SoftConsole/IAR/Keil (per your choice).
Export hardware configuration and firmware driversThis option is selected by default. This setting exports register configuration files for MSS, FDDR, and SERDES blocks instantiated in your design. CMSIS and other firmware drivers must be generated using the stand-alone Firmware Catalog executable. These options are available to support SoftConsole 4.0 flow.
Create software project including hardware configuration and firmware drivers
To enable you to manage your firmware project separately from Libero’s automatically generated firmware data, the created software workspace contains two software projects:
  • hardware_platform contains all the firmware and hardware abstraction layers that correspond to your hardware design. This project is configured as a library and is referenced by your application project. The content of this folder is overwritten each time you export your firmware project.
  • application produces a program and results in the binary file. It links with the hardware_platform project. This folder does not get overwritten when you re-export your firmware. This is where you can write your own main.c and other application code, as well as add other user drivers and files. You can reference header (*.h) files of any hardware peripherals in the hardware_platform project – include paths are automatically set up for you.

To build your workspace, have the hardware_platform and application projects set to the same compile target (Release or Debug) and build both projects.

To open your exported firmware projects, start your third-party development tool (SoftConsole, Keil, or IAR) outside Libero SoC and point it to the exported firmware workspace.

5.11.3.1 TCL Command

export_firmware \

-export_dir {D:\Designs\software_drivers} \

-create_project 1 \

-software_ide {Keil}

5.11.3.2 Version Supported

Libero SoC v11.7 and later supports the following versions of third-party development tools:

  • SoftConsole v4.0
  • SoftConsole v3.4
  • IAR EWARM
  • Keil