Giter Club home page Giter Club logo

embedded's Introduction

Travis-CI

embedded

This is all the code for the embedded systems on the rover.

This code will run on STM32 chips, specifically the F103 or F303 series (preferably F303)

MOST OF THE FOLLOWING IS OUTDATED

Onboarding

  1. First, create a GitHub account and send the username to the Controls team lead.
  2. Install the required toolchain
  3. Follow the Onboarding Task.

Requirements

You need to have the following tools installed:

  • Oracle Virtualbox
  • Oracle Virtualbox Extension Pack
  • STlink Driver
  • Vagrant
  • VScode
  • Git
  • At least 4GB of storage space

Documentation

Windows

Install listed dependencies

It works by building a virtual machine via Vagrant that contains most of the required toolchain.

Getting started

  • First clone this repository to the machine you will work on.
git clone https://github.com/UofA-SPEAR/embedded
  • Navigate to the root directory of the embedded project via cmd terminal/bash.
  • Run vagrant up. The script will now setup the VM, this process may take a while. Ensure that you have internet access as it will download the VM.
  • Run vagrant ssh-config to retreive the ssh config for the VM.
  • Install the Remote - SSH extension for VScode. See the VSCode section below for more info.
  • In the command pallet (ctrl + shift + p) type remote-ssh: open configuration file and select the first option
  • Copy the output of vagrant ssh-config to the file that was opened.
  • In the command pallet (ctrl + shift + p) type remote-ssh: connect to host or click on the green icon in the bottom left corner of the VScode window.
  • Once connected, go find the c/c++ and cortex-debug extension in the VScode extension marketplace, and use the option 'install in spear-embedded-box' and reload the window once completed.
  • Go to terminal > run task > build and create c_cpp_properties in the reloaded window to generate VScode json.

Creating a project

Copy the example project, embedded/template_project as your own project folder.

Debugging/Flashing

UPDATE THIS

THIS MAY CHANGE SOON

To flash the firmware, simply run

make flash

with your programmer and device plugged in.

To debug, simply run:

make debug

This will launch an OpenOCD instance, with a GDB server running on port 3333. To actually debug, you will have to attach a GDB instance to it.

GDB

Once we have the OpenOCD server running, we can run GDB with these commands.

arm-none-eabi-gdb build/<project_name>.elf
(gdb) target remote localhost:3333
(gdb) monitor reset halt
(gdb) load

Now we can debug as we normally would with GDB.

Eclipse

Install Eclipse CDT, and the GNU MCU Eclipse plugin on the Eclipse marketplace. The bare minimum is fine.

Then, create a new debug configuration, with the GDB Hardware Debugging template. Select build/<project_name>.elf as your source, and change the remote target to use localhost port 3333 instead of 10000.

VSCode

You need to install the following VSCode plugins:

  • Cortex-Debug
  • C/C++

There will be a good config in the .vscode folder within the example project. Use that for reference.

If you're using a pure open-source version of vscode, then you'll need this workaround in order to access the marketplace: VSCodium/vscodium#418 (comment). Otherwise, you'll get an error like: "We cannot connect to the Extensions Marketplace at this time, please try again later". You may also need to do this workaround: https://docs.microsoft.com/en-us/visualstudio/liveshare/reference/linux#vs-code-oss-issues if you get errors like "Command ... not found".

If you are using Arch, there is a AUR package to do this patching automatically: https://aur.archlinux.org/packages/code-marketplace/

If you continue to run into issues with the open-source version, you may need to switch to the microsoft version of vscode.

UPDATE THIS

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.