GithubHelp home page GithubHelp logo

fx3-cmake's Introduction

fx3-cmake

Use CMake build system for Cypress FX3

To use this toolchain to develop for Cypress FX3 simple include it to CMakeLists.txt like

include(${CMAKE_SOURCE_DIR}/cmake/fx3.cmake)

You must do it BEFORE project declaration (project())

Complete sample for including:

cmake_minimum_required(VERSION 2.8.8)
set(FX3_SDK_DIR ${CMAKE_SOURCE_DIR}/sdk/1.3.3)
include(${CMAKE_SOURCE_DIR}/cmake/fx3.cmake)
project(Fx3Project)
...

After that you can use next new commands:

  • fx3_enable_cxx()
    enable C++ support for project. Disabled by default. You can check it via FX3_CXX variable.
  • fx3_disable_stdc_libs()
    disable linking with standard C and gcc libs. Enabled by default. Note, that you must provide some function implementations for correct linking. You can check it via FX3_USE_STDC_LIB variable.
  • fx3_enable_stdcxx_libs()
    enable linking with standard C++ library. Disabled by default (increase target size). Note, you must provide some implementation for needed function with disabled std c++ libs and enabled C++ support You can check it via FX3_USE_STDCXX_LIB variable.
  • fx3_add_target(target ARGS)
    add new target. Use it in same way to add_executable(). No known restrictions for me. This command configure new target to use SDK libs. Also, generator for img file is configured.

Next files expected to be present in CMAKE_SOURCE_DIRECTORY:

  • In all cases:
    • cyfx_gcc_startup.S - startup assembler, can be overriden via FX3_CORE_ASM_SRC varible before fx3.cmake including
    • make/fx3cpp.ld - linker script
  • Project with disabled C++:
    • cyfxtx.c - can be overriden via FX3_CORE_C_SRC variable
  • Project with enabled C++:
    • cyfxtx.cpp - can be overriden via FX3_CORE_CXX_SRC variable
    • cyfxcppsyscall.cpp - can be overriden via FX3_CORE_CXX_SRC variable

All files above can be found at the SDK installation directory: FX3_INSTALL_PATH/firmware/common and should be distributed with your project.

This script ask some enveropment variables to locate binaries. All of them must be configured during normal Cypress SDK installation:

  • ARMGCC_INSTALL_PATH - to locate compilator installation
  • ARMGCC_VERSION - to set conrete compilator version
  • FX3_INSTALL_PATH - to locate Cypress SDK path

SDK includes and libraries can be overriden by next variable, declared before fx3.cmake include:

FX3_SDK_DIR

for example:

  set(FX3_SDK_DIR ${CMAKE_SOURCE_DIR}/sdk/1.3.3)
  include(${CMAKE_SOURCE_DIR}/fx3.cmake)

Note, that elf2img tool searches at the PATH location only.

You can use you own make command on Windows. In this case you can pass option -DUSE_SDK_MAKE=Off to cmake and make command must be present in PATH or pointed via -DCMAKE_MAKE_PROGRAM=...

On Windows you must point generator "MinGW Makefiles" if SDK cs-make is used. Or other valid generator if your own make is used.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.