17.2.7 Building Your Firmware Project

This section describes how to build your firmware project when using the Custom Flow.

Important: This section applies to SmartFusion 2 devices only.

The following are the three types of files that make up a firmware project:

  • Source files (your firmware application)
  • Drivers: These are drivers provided to facilitate your use of SmartFusion 2 SoC Components and Soft IP blocks. They include the CMSIS Hardware Abstraction Layer, which facilitates the use of the Cortex®-M3 processor, and peripheral drivers (for example, MSS SPI, MSS UART, and so on).
  • Peripheral Initialization Drivers: These files are generated by Libero SoC if you use the MDDR, FDDR, or SerDes components. Libero translates configuration settings for these blocks into register values that are stored in these files. You must import these into your firmware project manually, as listed:

Build your firmware project as follows:

Note: Steps 1–4 are detailed in the SmartFusion 2 CMSIS Hardware Abstraction Layer User Guide, which you can access using the Firmware catalog.
  1. Select a Software IDE Tool.
  2. Use the Firmware Catalog to download driver files for SoC Components or Soft IP you use in your Libero project.
  3. Create a new firmware project using your Software IDE tool of choice.
  4. Import driver files and write your application code as you normally would.
  5. Create a directory in your firmware project.
    <my_project>/drivers_config/sys_config
  6. For each 17.2.2.2 Component Manifests Report (generated in 17.2.2 Component Configuration):
    • Import each file in the Firmware files for all Software IDE tools section (Figure 2-2) into your firmware project's drivers_config/sys_config directory.
  7. Navigate to your Libero installation directory ( where Libero is installed), and then navigate to the following directory:
    <Libero install dir>\data\aPA4M\sysconfig
    • There are two files here:
      • sysconfig.c
      • sysconfig.h.
    • Import sysconfig.c (as is, do not modify the file) into your firmware project's drivers_config/sys_config directory.
    • Edit the local copy of sysconfig.h:
      • If you use the MDDR, change the following line:
        #define SYS_MDDR_CONFIG_BY_CORTEX	0

        to

        #define SYS_MDDR_CONFIG_BY_CORTEX	1
      • Similarly, depending on whether you use FDDR and SerDes blocks 0 to 3 in your design, change their respective lines as preceding.
      • Import sysconfig.h into your firmware project's drivers_config/sys_config directory.
  8. Import sysconfig.h into your firmware project's drivers_config/sys_config directory.
    /*====== * MDDR configuration */ 
    #define MSS_SYS_MDDR_CONFIG_BY_CORTEX 0 /
    *====== * FDDR configuration */ 
    #define MSS_SYS_FDDR_CONFIG_BY_CORTEX 0 /
    *=======* SERDES Interface configuration 0 */ 
    #define MSS_SYS_SERDES_0_CONFIG_BY_CORTEX 
    #if MSS_SYS_SERDES_0_CONFIG_BY_CORTEX 
    #include "sys_config_SERDESIF_0.h" 
    #endif 
    #define MSS_SYS_SERDES_1_CONFIG_BY_CORTEX 0 
    #if MSS_SYS_SERDES_1_CONFIG_BY_CORTEX #include "sys_config_SERDESIF_1.h" 
    #endif 
    #define MSS_SYS_SERDES_2_CONFIG_BY_CORTEX 0 
    #if MSS_SYS_SERDES_2_CONFIG_BY_CORTEX #include "sys_config_SERDESIF_2.h" 
    #endif 
    #define MSS_SYS_SERDES_3_CONFIG_BY_CORTEX 0 
    #if MSS_SYS_SERDES_3_CONFIG_BY_CORTEX 
    #include "sys_config_SERDESIF_3.h" 
    #endif