RCU2 Software Development Firmware: Difference between revisions

From ift
No edit summary
No edit summary
Line 15: Line 15:
=== Boot Linux Image ===
=== 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.
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 [https://github.com/larks/rcu2linux/blob/master/rcu2linux.uImage?raw=true Github].
If you would like to quickly test the boot process, a Linux image can be fetched from [https://github.com/larks/rculinux/blob/master/rculinux.uImage?raw=true Github].


For now, the U-Boot enviroment has to be set manually.
For now, the U-Boot enviroment has to be set manually.
Line 23: Line 23:
  setenv ipaddr 123.234.345.29
  setenv ipaddr 123.234.345.29
  setenv serverip 123.234.345.12
  setenv serverip 123.234.345.12
  setenv image rcu2linux.uImage
  setenv image rculinux.uImage
  saveenv
  saveenv
To run the image over the network, reset the board and stop the autoboot sequence, then type
To run the image over the network, reset the board and stop the autoboot sequence, then type
Line 43: Line 43:
  New project created in /home/lars/work/linux-cortexm-1.11.0/projects/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/
  lars@borg-2:~/work/linux-cortexm-1.11.0/projects/developer$ cd ../test/
Or you can clone [https://github.com/larks/rcu2linux this] project from Github and copy it to the ''projects'' folder  
Or you can clone [https://github.com/larks/rculinux this] project from Github and copy it to the ''projects'' folder  
in your development enviroment.
in your development enviroment.



Revision as of 00:10, 29 November 2013

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:

  1. Open FlashPro software
  2. Select Open Project and find the file rcu2_linux_fw.pro
  3. Make sure the FlashPro programmer is inserted and that it has been selected by pressing View Programmers. If necessary, hit Refresh/Rescan for Programmers
  4. 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 123.234.345.29
setenv serverip 123.234.345.12
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.

  1. Extract linux-M2S-1.11.0.tar.bz2 to a preferred directory
  2. Extract GNU toolchain arm-2010q1-189-arm-uclinuxeabi-i686-pc-linux-gnu.tar.bz2 to directory ./linux-cortexm-1.11.0/tools
  3. Make sure that the information in ACTIVATE.sh is correct and that the file is executable.
  4. 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 172.17.1.20:/home/lars/work/linux-cortexm-1.11.0/projects /mnt

The mount directory needs to be added to the ramfs table, so add to test.initramfs:

dir /mnt 755 0 0

After this is done, the image has to be recompiled and loaded to the board.



References