Coder Social home page Coder Social logo

macong04 / fmt-firmware Goto Github PK

View Code? Open in Web Editor NEW

This project forked from firmament-autopilot/fmt-firmware

0.0 0.0 0.0 40.14 MB

FMT Autopilot Embedded System

License: Apache License 2.0

Shell 0.30% C++ 0.73% Python 0.65% C 94.48% Assembly 3.03% Makefile 0.10% HTML 0.58% CMake 0.10% Batchfile 0.01% Yacc 0.01% Lex 0.01% M4 0.01% Dockerfile 0.01%

fmt-firmware's Introduction

FMT

GitHub license build status release version

中文页 |

Overview

Firmament (FMT) is an advanced autopilot system which is designed with Model-based design (MBD). It can be used to quickly and easily build the control system for autonomous vehicle, such as uav, car, ship, robot, etc.

The system is mainly composed of two parts.

  • FMT-Firmware: A stable and high performance embedded system designed with C/C++.
  • FMT-Model: A simulation framework with algorithm libraries designed with MATLAB/Simulink.

Feature

  • High development efficency achieved with model-based deisign and debug easier.
  • A stable and high performance embedded system designed with C/C++.
  • A powerful simulation framework with various algorithm library designed with MATLAB/Simulink.
  • Auto code generation from Simulink model adapted to different hardware platforms (ARM, AMD, Intel, etc).
  • Excellent real-time performance based on RT-Thread RTOS with active community and large number of third-party components.
  • Support with most widely used open-source hardware Pixhawk (Both FMUv2 and FMUv5 are supported).
  • Cross-platform toolchain support with Windows/Linux/Mac.
  • Support with Mavlink and QGroundcontrol.

Architecture

FMT Firmware's architecture is shown in the figure below.

Hardware

Current supported hardware:

The drone hardware equipped with FMT:

Documentation

User Guide

Quick Start

  1. Clone the project
git clone https://github.com/Firmament-Autopilot/FMT-Firmware.git --recursive --shallow-submodules
  1. Install the toolchian
  • Compiler: arm-none-eabi- toolchain: Version:7-2018-q2-update, other version are not well tested. When the compiler is installed, add a new environment variable RTT_EXEC_PATH with the value set to compiler's path. E.g, in the linux system:
export RTT_EXEC_PATH=$arm-none-eabi-7-2018-q2-update/bin
  • Construction Tool: Scons: You can use pip3 install SCons to install scons. The scons path should be added into Path environment variable after installation.
  • IDE: Visual Studio Code: Visual Studio Code is the recommend IDE. However you can use any other IDE that you are familar with.
  • USB Driver: STM32 USB Driver: Only required for Windows platform.
  1. Build the firmware

To build the firmware, change to a specific target directory and type command scons to start build process. The generated fmu firmware is located in the build folder, such as FMT-Firmware/target/pixhawk/fmu-v5/build.

cd FMT-Firmware/target/pixhawk/fmu-v5/
scons -j4

For some target, such as pixhawk and cuav v5+, there is a co-processor (AKA io processor) on board, so you need build io firmware as well.

cd FMT-Firmware/target/pixhawk/fmt-io/project
scons -j4
  1. Download the firmware

The download process relys on the on-board bootloader (PX4-Bootloader). If not, please flash the bootloader first.

Currently there are three methods to download the fmu firmware,:

  • Upload Script: Change directory to a specific target and type python uploader.py. Then connect your hardware to PC via a usb cable, the download shuold start automatically.
~/FMT-Firmware/target/pixhawk/fmu-v5$ python3 uploader.py 

If download is not started, unplug your usb cable then try it again.

  • QGoundControl: Go to Firmware Setup page,then connect your hardware to PC with a usb cable. In pop-up diaglog,select Advanced Settings->Custom firmware file with fmt_fmu.bin firmware.
  • JLink: Please refer to Debug section.

If download success, power on the board and the system banner should be printed on serial0 (serial0 is the default serial used by console). If you don't have a serial cable, you can also connect to console via QGroundControl Mavlink Console

   _____                               __ 
  / __(_)_____ _  ___ ___ _  ___ ___  / /_
 / _// / __/  ' \/ _ `/  ' \/ -_) _ \/ __/
/_/ /_/_/ /_/_/_/\_,_/_/_/_/\__/_//_/\__/ 
Firmware..................FMT FW v0.3.0-rc
Kernel....................RT-Thread v4.0.3
RAM.................................512 KB
Target............................CUAV V5+
Vehicle.........................Quadcopter
INS Model..................Base INS v0.2.1
FMS Model..................Base FMS v0.3.1
Control Model.......Base Controller v0.2.1
Task Initialize:
  comm..................................OK
  logger................................OK
  fmtio.................................OK
  status................................OK
  vehicle...............................OK

msh />

The next step is to upload the io firmware which is downloaded through the fmu. First copy the io firmware target/pixhawk/fmt-io/project/build/fmt_io.bin to the on board sd card. You can do that via QGroundControl ftp (version 3.5.6, the FTP function is removed on higher version) or a sd card reader. Then type the following command in fmt console to upload the firmware to io processor.

msh /usr>fmtio upload /usr/fmt_io.bin
[312785] I/Uploader: sync success
[312793] I/Uploader: found bootloader revision: 5
[312803] I/Uploader: io firmaware:/usr/fmt_io.bin
[312818] I/Uploader: erase...
[314151] I/Uploader: program...
[316275] I/Uploader: CRC check ok, received: 8a27ed4f, expected: 8a27ed4f

At the first time to download the io firmware, you should click the io reset button after typing fmtio upload to let io processor enter bootloader.

After the download is completed, type fmtio hello command. You should see the following message which sent from the io processor.

msh />fmtio hello
msh />[IO]:Hello, this is FMT IO!

Congratulation! Now you have FMT up and running. :)

License

Apache-2.0

fmt-firmware's People

Contributors

jczou avatar liuyangzys avatar luviewer avatar mooncakeg avatar wenzhicode avatar yangjion avatar

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.