At a Glance
...
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
- STM32F072B Discovery board + mini-USB cable
- UART to USB adapter
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.
...
Creating a New Project
While being at the firmware
directory, run 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 |
...
You'll notice that make new
also created a rules.mk
. This file is what identifies the folder hello_world
as a project to our build system. Please refer to the projects readme for more information.
...
Now, it's time to build and run the project! First, let's try it on x86.
Code Block |
---|
# Build and run the project on x86 make run PROJECT=hello_world PLATFORM=x86 |
Neat! Hopefully, you saw "Hello World" appear in your terminal. Now, if you have the hardware set up, let's try it on STM32!
Hardware (Optional)
Requirements
- STM32F072B Discovery board + mini-USB cable
- UART to USB adapter
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
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 Adapter | Discovery Board |
---|---|
RX (Yellow) | PB6 (TX) |
TX (Orange) | PB7 (RX) |
GND (Black) | GND |
Running on STM32 - Hello World
...
Code Block |
---|
# If no device is found, try /dev/tty[tab] or /dev/serial/[tab] where [tab] represents pressing the tab key minicom -D /dev/seriattyUSB0 |
(Note that the minicom baud rate should be set to 115200)
...
With your code workring, we want to make sure your code matches our Coding Standards. We use two tools for that:
...