This application note explains how to use the Libero SoC and SoftConsole software to develop a simple application on the SmartFusion Starter Kit. The application is a "Hello, world" demo that uses GPIO to blink the on-board LEDs.
The hardware platform is Emcraft Systems' SmartFusion system-on-module (SOM) plugged into the SOM-BSB baseboard (SmartFusion Starter Kit).
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 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 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.
- Download and install the following components:
- Libero SoC v10.1 SP2
- SoftConsole 3.3
- Firmware catalog
- Download the .zip version of the A2F-SOM Libero project and open the A2S-SOM project in Libero, update IP cores if asked.
- To be able to develop your firmware using SoftConsole, you need a special version of the A2F-SOM firmware programmed to the A2F-SOM.
Note: To run uClinux on A2F-SOM, you'll need to re-program it with the release version of the design <.pdb> file.
- Program the .pdb design into A2F-SOM using the FlashPro v10.1 (FlashPro 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 .pdb file and choose it.
- Power reset the board after the successful programming.
Running and Debugging the Project
- Being connected to the A2F-SOM serial console with a terminal application, stop at U-Boot prompt by pushing the Reset button on the SOM-BSB baseboard, then hit any key in the console window:
U-Boot 2010.03-linux-cortexm-1.9.0 (Dec 06 2012 - 16:15:01)
CPU : SmartFusion FPGA (Cortex-M3 Hard IP)
Board: A2F-SOM Rev 1.A, www.emcraft.com
DRAM: 16 MB
Flash: 16 MB
Hit any key to stop autoboot: 0
- In the Libero Design Flow view, launch the Write Application Code action. SoftConsole will start with the sample project workspace with two projects opened.
- Start debugging the prebuilt application. Open the Debug Configurations menu and select MSS_CORE_MSS_CM3_0_app Debug. Confirm the Perspective Launch dialog.
- The program will be loaded to the target SRAM and stopped on the first breakpoint at main(). Step over (F6) and into the functions (F5), examine variables (just point the mouse over the variable), and so on.
- 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 MSS_NVM_Driver_0. Re-generate SoftConsole workspace (yellow barrel with gear in the middle of the Libero window).
- Now switch to SoftConsole and observe that the mss_nvm firmware appears in the tree of the MSS_CORE_MSS_CM3_0_hw_platform project (in the drivers/ directory).
- Rebuild the project: Project -> Clean, select Clean all projects and Start the build immediately.
- Re-run the debug session of the project.