{"id":31754619,"url":"https://github.com/entron/try_stm32_arduino","last_synced_at":"2026-05-08T06:48:15.675Z","repository":{"id":316644925,"uuid":"1050263610","full_name":"entron/try_stm32_arduino","owner":"entron","description":"Trying out SimpleFOC BLDC control on STM32","archived":false,"fork":false,"pushed_at":"2025-09-26T20:10:12.000Z","size":641,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-26T21:28:00.357Z","etag":null,"topics":["arduino-library","bldc","bluepill","foc","hc-sr04","platformio","robotics","simplefoc","stm32"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/entron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-04T07:20:45.000Z","updated_at":"2025-09-26T20:10:15.000Z","dependencies_parsed_at":"2025-09-26T21:28:05.120Z","dependency_job_id":null,"html_url":"https://github.com/entron/try_stm32_arduino","commit_stats":null,"previous_names":["entron/learn_arduino_stm32","entron/try_stm32_arduino"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/entron/try_stm32_arduino","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entron%2Ftry_stm32_arduino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entron%2Ftry_stm32_arduino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entron%2Ftry_stm32_arduino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entron%2Ftry_stm32_arduino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/entron","download_url":"https://codeload.github.com/entron/try_stm32_arduino/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entron%2Ftry_stm32_arduino/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001943,"owners_count":26083226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino-library","bldc","bluepill","foc","hc-sr04","platformio","robotics","simplefoc","stm32"],"created_at":"2025-10-09T18:21:48.797Z","updated_at":"2025-10-09T18:21:49.819Z","avatar_url":"https://github.com/entron.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quick Arduino Library Testing on STM32 Blue Pill\n\nRapid prototyping repository for testing various modules using Arduino libraries on STM32 microcontrollers with PlatformIO. The STM32 Blue Pill provides an affordable ARM Cortex-M platform for quickly validating Arduino ecosystem libraries without the overhead of writing custom drivers.\n\nThis repo contains quick test implementations for various modules using existing Arduino libraries:\n\n## Quick Test Projects\n\n### 1. FOC Motor Control (`foc/`)\n**Arduino Library:** [SimpleFOC](https://simplefoc.com/) - Advanced motor control library\n**Purpose:** Rapidly test BLDC motor control using existing Arduino FOC library instead of writing custom STM32 drivers\n**Quick Tests:**\n- Open-loop sensorless control\n- Encoder integration and pole pair detection  \n- Closed-loop FOC velocity control with PID\n\n**Hardware:** STM32 Blue Pill + SimpleFOC Mini driver + BLDC motor + MT6701 encoder\n\n### 2. Ultrasonic Distance Sensor (`hcsr04/`)\n**Arduino Library:** HC-SR04 ultrasonic sensor libraries\n**Purpose:** Quick distance sensing implementation using proven Arduino libraries\n**Quick Tests:**\n- Distance measurement and serial output\n- Timing-critical operations on STM32\n- 5V/3.3V level handling\n\n**Hardware:** STM32 Blue Pill + HC-SR04 sensor + 5V power supply\n\n## Repository Structure\n\n```\n├── foc/                    # SimpleFOC library quick test\n│   ├── main.cpp           # FOC motor control implementation\n│   └── README.md          # Setup and test results\n├── hcsr04/                # HC-SR04 ultrasonic sensor quick test\n│   ├── main.cpp           # Distance sensor implementation\n│   └── README.md          # Wiring and test results\n├── images/                # Setup photos and test results\n├── platformio.ini         # Multi-environment build config\n└── README.md              # This testing guide\n```\n\n## Getting Started\n\n### Prerequisites\n- **PlatformIO** (CLI and VS Code extension) - see Linux setup below\n- **STM32 Blue Pill** (STM32F103C8T6)\n- **ST-Link V2** programmer (or compatible)\n- Basic understanding of Arduino framework\n\n### Linux Development Environment Setup\n\nComplete setup guide for PlatformIO development on Linux:\n\n#### 1. Install PlatformIO Core\n\nDownload and install PlatformIO Core using the official installer:\n\n```bash\n# Download the PlatformIO installer\nwget -O get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py\n\n# Install PlatformIO Core\npython3 get-platformio.py\n```\n\n#### 2. Add PlatformIO to PATH\n\nCreate local bin directory and symlink PlatformIO executables:\n\n```bash\n# Create local bin directory\nmkdir -p ~/.local/bin/\n\n# Create symlinks for PlatformIO commands\nln -s ~/.platformio/penv/bin/platformio ~/.local/bin/platformio\nln -s ~/.platformio/penv/bin/pio ~/.local/bin/pio\nln -s ~/.platformio/penv/bin/piodebuggdb ~/.local/bin/piodebuggdb\n```\n\nEnsure `~/.local/bin` is in your PATH by adding this to your `~/.bashrc` or `~/.zshrc`:\n```bash\nexport PATH=\"$HOME/.local/bin:$PATH\"\n```\n\n#### 3. Configure USB Device Permissions\n\nInstall udev rules for STM32 programmers and add user to dialout group:\n\n```bash\n# Install PlatformIO udev rules\ncurl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/system/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules\n\n# Add current user to dialout group for USB device access\nsudo usermod -a -G dialout $USER\n\n# Reload udev rules\nsudo udevadm control --reload-rules\nsudo udevadm trigger\n```\n\n**Note:** Log out and log back in for group membership changes to take effect.\n\n#### 4. Install VS Code Extension\n\nInstall the PlatformIO IDE extension in VS Code:\n- Open VS Code\n- Go to Extensions (Ctrl+Shift+X)\n- Search for \"PlatformIO IDE\"\n- Install the official PlatformIO extension\n\n#### 5. Install Serial Communication Tools\n\nFor debugging and monitoring serial output:\n\n```bash\n# Install CuteCom - GUI serial terminal\nsudo apt install cutecom\n\n# Install SerialPlot - real-time data plotting\n# Download the latest .deb from: https://github.com/hyOzd/serialplot/releases\n# Then install with:\nsudo dpkg -i serialplot_*.deb\nsudo apt install -f  # Fix any dependency issues\n```\n\n#### 6. Verify Installation\n\nTest your setup:\n\n```bash\n# Check PlatformIO version\npio --version\n\n# List connected devices\npio device list\n\n# Test project compilation (from this repository)\npio run -e bluepill_foc\n```\n\n### Quick Test FOC Motor Control\n```bash\n# Build and upload FOC test\npio run -e bluepill_foc -t upload\n\n# Monitor motor control output\npio device monitor -e bluepill_foc\n```\n\n### Quick Test Ultrasonic Sensor\n```bash\n# Build and upload sensor test\npio run -e bluepill_hcsr04 -t upload\n\n# Monitor distance readings\npio device monitor -e bluepill_hcsr04\n```\n\n## Test Documentation\n\nEach project folder contains setup and test results:\n- `foc/README.md` - FOC motor control setup, wiring, and test results\n- `hcsr04/README.md` - Ultrasonic sensor wiring, configuration, and performance results\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fentron%2Ftry_stm32_arduino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fentron%2Ftry_stm32_arduino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fentron%2Ftry_stm32_arduino/lists"}