Monday, January 31, 2011

Jan.29 hg cMake set-up

Q:\Carolyn\hg4\forte\2010\forte1103WS\FORTE   last good autoconf workspace

Get forte source
  •  First check-out from hg 
    • http://fordiac.hg.sourceforge.net/hgweb/fordiac/forte/
Put forte source under eclipse
  • create WS directory
  • Import into Eclipse the hg clone directory as an existing project 
    • Check copy source into eclipse project (optional)
Copy built ecos under eclipse
  • create directories bin/lms and copy the ecos include and lib directories into it.
  • create bin/lms/src directory


Generate Makefiles using Cmake
  • Install cMake
  • Open cMake Gui 
  • For source directory enter the Eclipse project directory.
  • For build directory, enter the top level binary directory (usually pathto/bin)
  • Configure
    • Press configure button
    • From the dropdown for: Specify the generator for this project
      • Choose: UNIX Makefiles
    • For cross compiler use first 
      • choose toolchain  with UNIX makefiles and press configure

      • Operation System: eCos
      • Compilers for C:     arm-elf-gcc 
        • and for C++:  arm-elf-g++
          • Need to include path if not installed under cygwin
      • path to target  
        • Usually same as path to build binaries
        • This has to be changed when ever workspace / file location changes
    • then
      • clear cache (will not clear the toolchain default)
      • choose options and press configure.
    • enter the text file with the options like below and press configure
INCLUDE(CMakeForceCompiler)

# this one is important
SET(CMAKE_SYSTEM_NAME eCos)

# specify the cross compiler
CMAKE_FORCE_C_COMPILER(arm-elf-gcc GNU)
CMAKE_FORCE_CXX_COMPILER(arm-elf-g++ GNU)

# where is the target environment 
SET(CMAKE_FIND_ROOT_PATH  C:/Users/Carolyn/Desktop/DistCntl/lms/forte012811WS/FORTE/bin/lms)

# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)




    • Chose options wanted and press configure
      • Check LMS - (A system must be checked.)
      • Check FBDK, but uncheck IP
      • Check FBs needed (none in example)
      • Uncheck all 3 real data types (not available in LMS)
    • Press generate
    • In Eclipse make all
      • (Note: under cygwin in lms/bin dir - make forte also works)
    • Generate forte.bin separately or as part of flashing bat file
      • arm-elf-objcopy --gap-fill 0xFF -O binary forte.elf forte.bin
        • Notice now .elf  before no extension
    • Ready to flash and test on LMS