This application note explains how to use the Libero SoC and SoftConsole software to develop a simple application on the M2S-FG484 Starter Kit. The application is a "Hello, world" demo that uses GPIO to blink the on-board LEDs and LPDDR memory for data storage.
The hardware platform is Emcraft Systems' M2S-FG484 system-on-module (SOM) plugged into the SOM-BSB-EXT baseboard.
The demo described in this application note assumes that the mini-USB cable is plugged into the P1 mini-USB connector on the SOM-BSB-EXT board (to provide power and serial console) and the FlashPro4 (or FlashPro3) JTAG programmer is connected to the development host and to the P5 connector on the SOM-BSB-EXT board.
The serial connection may require the FT232R USB drivers to be installed to the development host.
Also, please open the serial console window on the USB-Serial console port using any terminal application (HyperTerm, PuTTY, etc.) with the 115200,8N1 parameters.
Installing the Software on the Development Host
For this application note we use SoftConsole and Libero software running on a Windows development host.
- Install the Emcraft project at C:\Actleprj\.
- Download and install Libero SoC v11.6 here. Select the following components during installation:
- Synplify Pro
- ModelSim AE with SmartFusion and SmartFusion2
- Download and install SoftConsole 4.x from the above location.
- Download the .zip version of the M2S-FG484 SOM Libero project and open the M2S-FG484 SOM project in Libero, update IP cores if asked.
- Download the prebuilt M2S-FG484 SOM firmware design .stp file.
- Program the .stp design into M2S-FG484 SOM using the FlashPro, which is a part of the Libero installation:
- Start FlashPro on a Windows host.
- From the FlashPro IDE, create a new project with an arbitrary name.
- From the main FlashPro window, push Configure Device.
- Push Browse next to load existing programming file.
- Browse to the Linux SmartFusion2 project .stp file and choose it.
- Power reset the board after the successful programming.
Running and Debugging the Project
- Start SoftConsole 4.x and select the SoftConsole folder inside the Emcraft Libero project as the SoftConsole workspace:
- Clean up the project by running Project -> Clean.
- Rebuild the project by running Project -> Build all.
- Start debugging the application. Select Run -> Debug Configurations. Open the Debugger tab to the right and check that your M2S-FG484 SOM model matches the --command argument, change to the correct value is necessary.
- Click Debug, confirm Open Debug perspective dialogue:
- The program will be loaded to the target eNVM and stopped on the first breakpoint at main(). Single-step over the program, observe the variables changes.
- Resume the program run with F8 ("green triangle" in the Debug window). Observe the Hello, SmartFusion2 on the console and two LEDs blinking.
Modifying the Libero and SoftConsole Projects
To modify the Libero project, rebuild and rerun the application in SoftConsole:
- Terminate the program with Ctrl-F2 ("red square") and switch back to the C/C++ Editor perspective. Don't leave SoftConsole.
- In Libero, open the Design -> Configure Firmware tab. Let's add a new software driver to our SoftConsole project. Add a checkbox to the SmartFusion2_MSS_NVM_Driver_0.
- Run Export Firmware. Do not put checkbox on Create project for selected Software Tool Chain:
Confirm overwriting the firmware directory.
- Now, in the Windows Explorer, update all files in the SoftConsole\g4m_system_MSS_CM3_hw_platform\ directory with the files from the firmware directory:
- Edit SoftConsole\g4m_system_MSS_CM3_hw_platform\drivers_config\sys_config\sys_config.h and make sure that MSS_SYS_MDDR_CONFIG_BY_CORTEX is defined as 0.
This is needed because Libero re-generated firmware files and unconditionally enabled initialization of the LPDDR memory by the DDR module firmware.
This initialization is incompatible with the memory used on the M2S-FG484 SOM (the demo application uses the correct LPDDR initialization code in config_mddr_lpddr()).
- Clean and rebuild the project in SoftConsole.
- Re-run the debug session of the project.