Skip to content

CPRT/embedded-smartPDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

embedded-smartPDB

A clean, no-nonsense STM32 project setup using PlatformIO, STM32Cube HAL, and FreeRTOS. Because life's too short for bad embedded setups.

CI Status

What You're Getting

  • STM32F103C8
  • PlatformIO
  • STM32Cube HAL
  • FreeRTOS

Quick Start

1. Prerequisites

You'll need:

  • VS Code
  • PlatformIO extension
  • ST-Link V2 (or compatible programmer)
  • A sense of whismy and adventure
# if you are on linux you might need this to give permissions to use the USB ports for flashing
sudo usermod -a -G dialout $USER
# Then logout/login

2. Clone & Setup

git clone git@github.com:CPRT/embedded-smartPDB.git
cd embedded-smartPDB
code .

VS Code will bug you about installing extensions. Click "Install All"

3. Build It

pio run

If it compiles, you're golden.

4. Flash It

# Upload to board
pio run -t upload

# Watch serial output (optional)
pio device monitor

Project Structure

.
├── include/              # Your headers go here
│   ├── FreeRTOSConfig.h # RTOS configuration
│   └── main.h           # Main header
├── src/                  # Your code lives here
│   ├── main.c           # Entry point
│   └── freertos.c       # RTOS tasks
├── lib/                  # Local libraries
│
├── platformio.ini       # Project config
└── .vscode/             # VS Code goodies

Common Tasks

Build

pio run
# Or in VS Code: Ctrl+Shift+B

Upload

pio run -t upload

Clean Build

pio run -t clean && pio run

Monitor Serial

pio device monitor
# Exit with Ctrl+C

Static Analysis

pio check

Memory Report

arm-none-eabi-size -A -d .pio/build/bluepill_f103c8/firmware.elf

Adding FreeRTOS Tasks

In src/freertos.c:

void MyTask(void *pvParameters) {
    while(1) {
        // Do stuff
        vTaskDelay(pdMS_TO_TICKS(1000));  // Delay 1 second
    }
}

// In main()
xTaskCreate(MyTask, "MyTask", 128, NULL, 1, NULL);
vTaskStartScheduler();

Debugging

Got an ST-Link? Time to debug properly.

Quick Debug

# In VS Code: F5
# Or: Run → Start Debugging

Uses the config in .vscode/launch.json (ST-Link by default).

Manual GDB Session

# Terminal 1: Start OpenOCD
openocd -f interface/stlink.cfg -f target/stm32f1x.cfg

# Terminal 2: GDB
arm-none-eabi-gdb .pio/build/bluepill_f103c8/firmware.elf
(gdb) target remote :3333
(gdb) monitor reset halt
(gdb) load
(gdb) continue

Resources

Documentation

Useful Commands

# List all tasks
pio run --list-targets

# Verbose build
pio run -v

# Clean everything
rm -rf .pio

# Check library dependencies
pio lib list

Contributing

  1. Don't break the build
  2. Test your changes
  3. Update this README if you add something cool
  4. Keep commits atomic and meaningful

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages