ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

PlatformIO 开发STM32 (Arduino框架)

2022-03-28 18:34:21  阅读:290  来源: 互联网

标签:platformio Arduino extra STM32 PlatformIO ledPin options


PlatformIO 开发STM32 (Arduino框架)

创建项目

BoardSTM32F103C8(20k RAM.64k Flash)(Generic)

硬件接线及跳线

跳线

使用Jlink无需配置boot引脚

建议都默认为0boot启动模式参考文档

硬件接线

JLINK STM32 Board
(Reset) (R)
(3.3v) (3.3v)
(SWCLK) (DCLK)
(SWDIO) (DIO)
(GND) (GND)

测试代码

platformio.ini
; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

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

; board_build.f_cpu = 72000000L

upload_protocol = jlink
main.cpp
/*
 * @Author: Dapenson
 * @Date: 2022-03-28 15:20:38
 * @LastEditors: Dapenson
 * @LastEditTime: 2022-03-28 16:36:05
 * @FilePath: \F103EnvTest\src\main.cpp
 * @Description:
 *
 * Copyright (c) 2022 by Dapenson, All Rights Reserved.
 */
#include <Arduino.h>

const int ledPin = PC13;

void setup()
{
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
}

void loop()
{
  digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
  delay(1000);                // wait for a second
  digitalWrite(ledPin, LOW);  // turn the LED off by making the voltage LOW
  delay(1000);                // wait for a second
  Serial.println("Done!");
}

参考教程

stm32开发新方式-platformio的IDE (smslit.cn)

PlatformIO IDE(VSCode) - stm32cube 框架的工程 - 知乎 (zhihu.com)

stm32开发新方式-platformio (smslit.cn)

标签:platformio,Arduino,extra,STM32,PlatformIO,ledPin,options
来源: https://www.cnblogs.com/dapenson/p/16068456.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有