Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

At a Glance

Table of Contents
excludeAt a Glance

Prerequisites

...

If you aren't sure where to get a Discovery board or UART adapter, ask a lead! We have a few in the bay.

...

Goal

In this module you'll be making a simple hello world application. You can either run this application on your virtual machine, or on a micro-controller. Running in a micro0controller requires hardware.

Prerequisites

Hello World

With our development environment set up, let's make a basic project!

Hardware (Optional)

For now, we'll be using STM32 Discovery boards. If you've heard of an Arduino, the Discovery boards are very similar in intention. They're just plug-and-play, no setup required.

To use a Discovery board, just connect the mini-USB cable to the header marked "USB ST-LINK" on the Discovery board and plug the other end into your computer.

For the UART to USB adapter, plug each wire of the adapter into its corresponding pin on the Discovery board.

...

First we need to ssh into our virtual machine!

Feature Branches - Git

Code Block
# Double check - make sure you're in vagrant
vagrant ssh

To check if we're in the virtual machine, run whoami.

Code Block
# Should say "vagrant"
$ whoami

vagrant

Now we navigate to the firmware repository and create a new branch for our getting_started project.

Code Block
cd ~/shared/firmware
# Create a new branch off of master
git checkout master
git checkout -b wip_getting_started

...

By convention, we use lower snake case for most of our naming schemes. For example, these documents were created under elec_281_add_basic_docs. This lets us keep our work organized. See our Git Workflow for more information.


Hardware Requirements

Info

If you aren't sure where to get a Discovery board or UART adapter, ask a lead! We have a few in the bay.

Otherwise, feel free to just skip the parts that involve UART or STM32. 

Hardware (Optional)

For now, we'll be using STM32 Discovery boards. If you've heard of an Arduino, the Discovery boards are very similar in intention. They're just plug-and-play, no setup required.

To use a Discovery board, just connect the mini-USB cable to the header marked "USB ST-LINK" on the Discovery board and plug the other end into your computer.

For the UART to USB adapter, plug each wire of the adapter into its corresponding pin on the Discovery board.

UART AdapterDiscovery Board
RX (Yellow)PB6 (TX)
TX (Orange)PB7 (RX)
GND (Black)GND

New Project - Hello World

...

With your code workring, we want to make sure your code matches our Coding Standards. We use two tools for that:

...