...
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
- Our development environment
- some basic knowledge of git
...
Code Block |
---|
cd ~/shared/firmware_xiv
# Create a new branch off of master
git checkout master
git checkout -b wip_getting_started |
...
While being at the firmware
directory, run make new the following command:
Code Block |
---|
# Initialize the directory structure for a new project named "hello_world" # See projects/README.md for more information on how our projects work make new PROJECT=hello_world |
...
Depending on your operating system, you'll need to do different things:
- Mac OS: Before Catalina
- Windows & Mac OS: Catalina or newer
MacOS (Before Catalina)
Note: If your Mac's Operating System version is older than Catalina, you'll need to do this part. Otherwise, skip to the other section! If you don't know how to check your OS's version, google it! (come on really?)
On older versions of MacOS for some reason our programmer doesn't get passed into the virtualbox
image. To solve that problem, we wrote a script that installs the toolchain on your Mac and SSH's into your Mac every time you want to program a Micro-Controller.
...
Code Block |
---|
# ssh into your virtual machine
cd ~/box
vagrant ssh
# go to the firmware repo
cd shared/firmware_xiv/
# program the controller board with the "example" project
make program PROJECT=example |
...
Code Block |
---|
minicom -D /dev/tty.usbmodem143102
# trick: type the following, hit tab, then enter
minicom /dev/serial/by-id/ |
You should see something like this:
...
Now you should see "Hello World!" appear on your minicom
window! Yay!
Windows or MacOS (Catalina or newer)
Get in vagrant:
Code Block |
---|
vagrant ssh |
...
Code Block |
---|
cd shared/firmware_xiv/
# program the controller board with the "example" project
make program PROJECT=example |
...
Code Block |
---|
minicom -D /dev/tty.CMSIS-DAP # --> this should be what the last command showed you!!!! |
So now, you should see something like so:
Code Block |
---|
Welcome to minicom 2.7.1
OPTIONS:
Compiled on Sep 18 2017, 15:01:35.
Port /dev/tty.usbmodem143102, 19:59:33
Press Meta-Z for help on special keys |
Now your computer is listening on the UART port for all of the messages that get out of your Microcontroller Board! YAY! Now run your open another Git bash window, ssh into vagrant
, cd into the firmware
directory, and then run the application you just created: hello_world
program:
Code Block |
---|
make program PROJECT=hello_world |
...