RCU2 Software Development Firmware
Programming
A FlashPro project including a STAPL programming file with firmware and u-boot images can be found here[1]. The firmware is compiled for the SmartFusion2 Starter Kit and the device MS2050T_ES. The Libero project will be made available on the Subversion directory ASAP in case you have other devices (for now, find the project here).
Usage:
- Open FlashPro software
- Select Open Project and find the file rcu2_linux_fw.pro
- Make sure the FlashPro programmer is inserted and that it has been selected by pressing View Programmers. If necessary, hit Refresh/Rescan for Programmers
- Now hit PROGRAM, wait for it to finish and then power cycle the board.
For more information on FlashPro, check the user guide[2].
Setup of the SmartFusion2 Target
Boot Linux Image
The Linux image is fetched from a network and can be booted directly from the network as well as loaded into the external Flash memory on the board. This requires a TFTP server to host the Linux image, for help on setting up a server, check the TFTP page. If you would like to quickly test the boot process, a Linux image can be fetched from Github.
For now, the U-Boot enviroment has to be set manually.
- Log in to the board through serial, baud rate 115200, 1 stop bit, no parity
- Reset board and hit a key to stop boot sequence
- Define the IP addresses for the target board and the TFTP server, as well as the name for the boot image.
setenv ipaddr 192.168.1.11 setenv serverip 192.168.1.10 setenv image rculinux.uImage saveenv
To run the image over the network, reset the board and stop the autoboot sequence, then type
run netboot
To load the image into the Flash, type
run update
Development
Download the Linux BSP and software development environment as well as the GNU tool-chain from EmcraftEmcraft SF2 Starter kit downloads.
- Extract linux-M2S-1.11.0.tar.bz2 to a preferred directory
- Extract GNU toolchain arm-2010q1-189-arm-uclinuxeabi-i686-pc-linux-gnu.tar.bz2 to directory ./linux-cortexm-1.11.0/tools
- Make sure that the information in ACTIVATE.sh is correct and that the file is executable.
- Source ACTIVATE.sh: . ACTIVATE.sh
You are now ready for doing development.
To create a new project, you can clone the developer project:
lars@borg-2:~/work/linux-cortexm-1.11.0/projects/developer$ make clone new=test New project created in /home/lars/work/linux-cortexm-1.11.0/projects/test lars@borg-2:~/work/linux-cortexm-1.11.0/projects/developer$ cd ../test/
Or you can clone this project from Github and copy it to the projects folder in your development enviroment.
Network and development
The startup script of the SF2 should be updated such that you can mount a directory from the development host onto the target board. This way you can compile any software you are working on, and run it straight away from the mount on the board. Add something along the following lines to local/rc in your project directory:
mount -o nolock,rsize=1024 192.168.1.10:/home/lars/work/linux-cortexm-1.11.0/projects /mnt
The mount directory needs to be added to the ramfs table, so add to rculinux.initramfs:
dir /mnt 755 0 0
After this is done, the image has to be recompiled and loaded to the board.
Known Problems
- In Libero, the path for the u-boot flash image is hard-linked, so if you are trying to run any of the project in the first section of this page, Libero might tell you that it did not find the flash file. If this should occur, it is needed to redefine the path to the image.
- 11.1 -- Go to the MSS configurator tab and double-click the eNVM part, in the configuration window for the eNVM, change to the correct path.
- 11.2 -- In Design Flow tab: Configure Security and Programming Options --> Update eNVM Memory Content.