#6 HAL for Actel SmartFusion (cortex-M3)

This port adds eCos support to the Actel SmartFusion evaluation board. The SmartFusion devices are a mix of programmable logic around a ARM cortex-M3 based processor. The SmartFusion has 3 variants: A2F060, A2F200, A2F500. The evaluation kit is mounted with the A2F200 device. The A2F200 MSS (Microcontroller Subsystem) user guide is acccessible from here. Openocd [18] does not currently supports the SmartFusion on-chip FLASH. The FASH can be programmed using the utility tools provided by Actel [19] (registration required). The FPGA fabric uses a nonvolatile technologie removing the need of additional flash memory for storing the FPGA programing matrix.

I. Literature:

- Microcontroller Subsystem User Guide
- Programming FPGA Fabric and eNVM Using In-Application Programming Interface
- FlashPro User Guide
- Libero IDE User Guide
- SmartDesign MSS simulation (mss_sim_ug_1.pdf)

II. Actel utilities:

Actel provides a set of development tools to design and program the smartfusion chip.
- The Libero IDE is mostly required to generate the progamming file for the chip internal FPGA fabric. Liberto is a top level design graphical tool that gives overview of the project. The VHDL and/or Verilog synthesis is done with Synplify Pro, VHDL simulation with Modelsim and P&R with Actel Designer software. The Cortex-M3 peripherals are configured with the SmartDesign MSS configurator. The complete IDE package is available for both Windows and Linux. A 1 year free license scheme is available. Pricing for license extension is not provided from Actel web site.
- FlashPro is an utility provided to program the smartfusion internal flash and FPGA fabric. The utility is free for download.
- The SoftConsole IDE is an Eclipse based IDE free for download. It is installed along with the CodeSourcery [27] ARM compiler. Only available for Windows, it allows to debug RAM and ROM based applications using the ARM Sprite utility from CodeSourcery and the flashpro DLL. Debugging the target only requires 2 USB cables, one cable to access the debug interface and a second cable for UART communication and powering of the board.

III. Tutorials:

The best way to get familiarised with the SoftConsole IDE is to follow the tutorials from Actel. Two of the tutorials available here are:
- Using UART with SmartFusion: Libero IDE and SoftConsole Flow Tutorial
- Using UART with SmartFusion: SoftConsole Standalone Flow Tutorial
Both tutorials demonstrate how to compile the UART code example and load it either to ROM or RAM from SoftConsole IDE.

IV. Boot process:

The Smartfusion is delivered with write protected sectors that contain the factory and system boot routines. The boot process is described here. One task of the boot code is to configure the device clock network according to the user configuration. Typically, the clock setttings are selected from the MSS Configurator GUI and written to a particular sector of the internal flash. For the eCos HAL, it shall be possible to either let the user configure the clock from the MSS Configurator or to re-configure the system according to the settings from the CDL input.

V. Current HAL:

The A2F200 part has 256KB of internal FLASH and 64KB of SRAM. Some of the peripherals are : Ethernet MAC 10/100Mbps, 2 UARTS, 2 I2C buses, 2 SPI buses etc... The eCos HAL currently supports:

Peripheral Driver state
I2C Completed
SPI Completed
DMA Completed
UART Completed
Atmel SPI AT25DF641 flash Completed
Ethernet MAC Completed

There is currently no plan to write the OLED driver, the ADC driver or the In-Application Programming Interface use to re-program the internal FLASH and FPGA fabric from within the application. Three startup type are available, ROM, SRAM and ROM_SOFTCONSOLE.

$ mdkir smartfusion
$ cd smartfusion
$ ecosconfig new smartfusion default
$ -> Select SOFTCONSOLE startup type to debug using SoftConsole IDE from ROM
$ ecosconfig tree
$ make

Complete documentation of the eCos port is available from chapter 72 of the eCos PDF documentation.

V. Redboot:

While not required for such a small device, it is possible to compile/run redboot on the target.