Skip to content

PierreBizouard/cypress-fx3-sdk-linux

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cypress-fx3-sdk-linux

##1. Install Eclipse & Eclipse C/C++ Development Tools $ sudo apt-get install eclipse eclipse-cdt

##2. Install GNU ARM Eclipse Plug-in The recommended way to install this plug-in is to use the Eclipse standard install/update mechanism:

  1. Start Eclipse (from Terminal):
    $ eclipse &
  2. Eclipse menu: Help->Install New Software
  3. In the Install window, click the "Add..." button (for future updates, you will be able to select the URL from the dropdown)
  4. Fill in Location: http://gnuarmeclipse.sourceforge.net/updates
  5. Click the "OK" button
  6. Normally the main window should list a group named "GNU ARM C/C++ Cross Development Tools" - expand it.
  7. Select "GNU ARM C/C++ Development Support"
  8. Click the Next button
  9. Accept the unsigned plug-in and install

Note: As we saved the update site URL in Step 3, further updates are greatly simplified via: Help->Check For Updates

##3. Setup Eclipse

  1. Add the following lines to the end of ~/.bashrc using a text editor (so Eclipse knows where our project and toolchain will be located):
    export FX3_INSTALL_PATH=$HOME/workspace/cypress-fx3-sdk-linux
    export PATH="$PATH:$FX3_INSTALL_PATH/util/arm-2011.03/bin"
    export ARMGCC_INSTALL_PATH=$FX3_INSTALL_PATH/util/arm-2011.03
    export ARMGCC_VERSION=4.5.2
  2. Start Eclipse (from a fresh instance of Terminal):
    $ eclipse &
  3. Use the default workspace path when prompted (i.e. ~/workspace)
  4. Clone this repository to the Eclipse workspace folder:
    $ cd ~/workspace
    $ git clone https://github.com/nickdademo/cypress-fx3-sdk-linux.git
  5. Compile the included elf2img tool:
    $ cd ~/workspace/cypress-fx3-sdk-linux/util/elf2img
    $ gcc elf2img.c -o elf2img -Wall
  6. Import the projects you require into Eclipse: File->Import->General->Existing Project into Workspace - select cypress-fx3-sdk-linux/firmware as the root directory.
    Note 1: Ensure you DO NOT import the cyu3lpp project.
    Note 2: Import CyStorBootWriter if you will be writing firmware to FX3S Storage Port 0.
  7. Also import the following TWO (2) projects located in the "FX3_SDK_1_3_1_SRC" folder in the top-level directory:
    boot_fw
    sdk
  8. Build the entire project workspace: Project->Build All

##4. Flashing ###A. Flashing the Device (using CyUSB Suite for Linux)

  1. Install dependencies:
    $ sudo apt-get install libqt4-dev qt4-qmake libusb-1.0-0-dev
  2. Compile and install CyUSB Suite and Cypress USB library:
    $ cd ~/workspace/cypress-fx3-sdk-linux/util/cyusb_linux_1.0.4/
    $ sudo ./install.sh
  3. Restart system
  4. Run CyUSB Suite for Linux with the following command in Terminal:
    $ cyusb_linux

###B. Flashing the Device (using Cypress command line tools through Eclipse)

  1. Install dependencies:
    $ sudo apt-get install libusb-1.0-0-dev g++
  2. Compile and install Cypress USB library (if not already installed in Step 4A):
    $ cd ~/workspace/cypress-fx3-sdk-linux/util/cyusb_linux_1.0.4/
    $ sudo ./install_lib.sh
  3. Compile cyusb_linux_1.0.4 command-line tools:
    $ cd ~/workspace/cypress-fx3-sdk-linux/util/cyusb_linux_1.0.4/src/
    $ make
  4. Compile cyfwstorprog tool (for flashing to SD/eMMC):
    $ cd ~/workspace/cypress-fx3-sdk-linux/util/cyfwstorprog_linux/
    $ make
  5. Make cyfwstorprog tool run WITHOUT a sudo password prompt in Eclipse:
    $ sudo gedit /etc/sudoers
    Add the following to the end of the sudoers file (replace YOUR_USERNAME with your own and ensure the path to the tool is correct):
    YOUR_USERNAME ALL = (ALL) ALL
    YOUR_USERNAME ALL = (root) NOPASSWD: /home/YOUR_USERNAME/workspace/cypress-fx3-sdk-linux/util/cyfwstorprog_linux/cyfwstorprog
  6. Create a .launches directory in the Eclipse workspace:
    $ mkdir -p ~/workspace/.metadata/.plugins/org.eclipse.debug.core/.launches
  7. Copy Eclipse launch files to appropriate folder:
    $ cp ~/workspace/cypress-fx3-sdk-linux/util/eclipse_launches/*.launch ~/workspace/.metadata/.plugins/org.eclipse.debug.core/.launches/
  8. Restart system
  9. Start Eclipse and program the FX3 using the External Tools menu! (Note: You may have to add the launches as favourites via "Organize Favourites" to make them visible).

IMPORTANT: The CyStorBootWriter project must be compiled and flashed to the FX3S RAM before attempting to use the cyfwstorprog tool to write firmware to the SD/eMMC.

The source for the cyfwstorprog tool can be found at https://github.com/nickdademo/cyfwstorprog_linux

##Notes

Eclipse Build Configurations

Fx3BootAppGcc:
Debug: Optimization level = OPTIMIZE MOST (O3)
Release: Optimization level = OPTIMIZE MORE (O2)

boot_fw:
Default: Optimization level = OPTIMIZE (O1)

sdk:
Debug: Optimization level = NONE (O0)
Release: Optimization level = OPTIMIZE (O1)

All other projects:
Debug: Optimization level = NONE (O0)
Release: Optimization level = OPTIMIZE MORE (O2)

Project Dependencies

In order for required libraries (.a files) to exist when they are required during building of certain projects, the build order of Eclipse projects is set via the "Project References" project option:
Fx3BootAppGcc: References "boot_fw"
boot_fw: No references
sdk: No references
All other projects: References "sdk"

About

Cypress FX3S SDK v1.3.1 configured to build from the firmware sources. Eclipse integration of device flashing also included.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 37.0%
  • C 32.6%
  • C++ 22.7%
  • Roff 6.1%
  • Objective-C 0.6%
  • Assembly 0.4%
  • Other 0.6%