1. Announcements

  • Project 2 will be another "everybody does the same thing"

    • Demonstrate making your STM32 board blink an LED under your control.

  • We need a way to handle logistics for Project >=3

    • hardware acquisition time

    • set scope, timeframe, and deliverables for each project

1.1. Project 2 specification

1.2. Project3 Proposal process

[ this is a DRAFT ]

2. Class time

2.1. PIO and stm32

VSCode, Extensions -> PlatformIO

^^^ adds tools for embedded development and debugging

Specific platform for the STM32: https://github.com/platformio/platform-ststm32

Bare setup:

When this finally finishes, you will have a blank Project. Open platformio.ini (maybe is already)

[env:disco_f303vc]
platform = ststm32
board = disco_f303vc
framework = arduino

Platform, board, and framework configuration. You can write this file yourself since it is just text. The format is "INI" which is easy to read. Sections by [sectionA] and key = value pairs. Need this sort of config capability for some custom thing you have? -> use this format and you’re likely to find a library to help you read and write the information!

From the Explorer on the left side, open .vscode/c_cpp_properties.json.

.json for JSON formatted file. It is a ubiquitous format and heavily associated with web things. "Everyone uses it", including you. The format is simple.

Notice includePath for all the places where your #include statements will see.

Fold the lists using VS Code.

Notice defines. These are #define already and you can use them to #ifdef decide what platform and options your code is being compiled with.

Look at the other files that were created in the folder structure. Read (skim) the README files.

main.cpp:

  • Notice the #include <Arduino.h>. This is automatically included (if not already present) when using the classic ArduinoIDE.

  • …​ the familiar setup() and loop()

  • Write your own Blink example. (steal it from ArduinoIDE !)

…​

Bottom row -> Checkmark Build button

Connect your board and "->" Upload button.

2.2. Deep into msp430.h

Find the 16-bit hex values that are eventually resolved from the following symbols:

  • P1OUT

  • P1REN

  • WDTCTL

Use CCS features to open msp430.h and keep going! all-the-way to something like being able to replace

P1OUT = 0xab;

with

*(volatile unsigned int 0xWXYZ) = 0xab;

(Write 0xab to this exact memory address)

3. Special Project Ideas

A place to pitch some potential projects for interested parties.

3.1. Save BLE packets to microSD card

This is a long-running project using ESP32 devboards. Each unit:

  • Sniffs Bluetooth LE packets from other devices in the vicinity

  • Adds a timestamp

  • Sends the BLE packet data and metadata to a database

esp32 devboard

The current version requires a 24/7 WiFi connection.

In order to enable other research projects in conjunction with Civil Engineering - Transportation, the system needs to also log packets without an active network connection.

These devboards have a microSD card connector that is perfect for saving lots of data.

esp32 cam devboard

Your task is to take the existing code and modify it to log packets to microSD card. It must do this logging whether or not there is or has ever been an active WiFi connection.

The existing code does connect to the microSD card but the feature is disabled because it conflicts with blinking the on-board LED that blinks once for each packet.