Arduino IDE配置STM32开发环境和程序烧录

2023-05-16

Arduino IDE配置STM32开发环境和烧录

前言:最近在制作3D打印机,自己画了一块STM32F446的3D打印机板子(RUMBA32),但是在Arduino编译Marlin固件的时候,一直报错,显示定时器中断有问题。
怀疑可能是由于Arduino IDE编译环境的问题,因此花了一点时间配置Arduino IDE,并成功实现使用串口/DFU进行程序烧录,实现了最简单的LED闪烁和串口显示。
下面对整个步骤进行介绍:

1. 下载Arduino IDE并安装

方式1:官网下载地址:https://www.arduino.cc/en/Main/Software,下载后安装
方式2:Microsoft store:直接搜索Arduino进行下载并安装

2. 在Arduino中安装STM32开发板

  1. Arduino IDE中打开“文件 -> 首选项”,在“附加开发板管理器地址”中输入:https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json
    开发板管理器网址
  1. Arduino IDE中打开“工具 -> 开发板 -> 开发板管理器”,滑倒最下面可以看到:
    开发板管理器
    安装最新的即可,我的版本是1.9.0
  1. Arduino IDE中打开“工具 -> 开发板”,选择合适的开发板类型,例如最简单的STM32板子。我选择的是RUMBA32板子
    开发板选择

3. 安装STM32CubeProgrammer

  1. STM32CubeProgrammer可以让计算机更方便地烧录程序到STM32中,其支持4种方式连接STM32单片机,分别为STLink、UART(串口)、USB和OTA。其中USB连接方式肯定是最简单的,但STM32芯片需要引出USB引脚上。在这里我选择USB,并使用USB线连接电脑和STM32板子。4种连接方式
  1. 按一下板子的RESET(如果不行,请将BOOT0置1试一下),即可点击STM32CubeProgrammer上的Connect按钮,成功连接即可。

4. 添加STM32CubeProgrammer中的bin文件夹的路径到系统路径中

  1. 添加到系统路径中,其他程序就也可以通过STM32CubeProgrammer将程序烧录至STM32中了。在电脑左下角搜索“高级系统设置”,打开后点击“环境变量”。
    高级系统设置
    环境变量
  1. 选择PATH,并点击“编辑”
    编辑
  1. 添加bin路径到环境变量中即可。
    添加bin路径

至此,你的Arduino已经可以使用USB烧录程序到STM32中了。

5. 配合好BOOT0,使用串口/DFU(USB)进行烧录

烧录之前,需要将BOOT0置为1,按reset复位,之后才可以烧录程序
其原理应该是BOOT0为1时,按reset后运行DFU程序,系统进行DFU模式,之后就可以用Arduino进行烧录
配置USB支持串口,则可以直接使用USB进行串口读取与发送

最后配一张自己制作的RUMBA32开发板图:。
RUMBA32
之后制作成功3D打印机后,将会和大家分享一下制作3D打印机的过程,并分享一些资料

对了,在编译Marlin 2.0固件的时候,遇到报错:
编译报错

sketch\src\HAL\STM32\timers.cpp: In function 'void HAL_timer_enable_interrupt(uint8_t)':
sketch\src\HAL\STM32\timers.cpp:178:62: error: no matching function for call to 'HardwareTimer::attachInterrupt(void (&)(HardwareTimer*))'
  178 |       timer_instance[timer_num]->attachInterrupt(Step_Handler);
      |                                                              ^
In file included from C:\Users\ASUS\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/analog.h:45,
                 from C:\Users\ASUS\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/board.h:8,
                 from C:\Users\ASUS\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/wiring.h:41,
                 from C:\Users\ASUS\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/Arduino.h:36,
                 from c:\users\asus\appdata\local\temp\arduino_build_611183\sketch\src\hal\shared\marduino.h:36,
                 from c:\users\asus\appdata\local\temp\arduino_build_611183\sketch\src\hal\stm32\hal.h:28,
                 from c:\users\asus\appdata\local\temp\arduino_build_611183\sketch\src\hal\hal.h:26,
                 from c:\users\asus\appdata\local\temp\arduino_build_611183\sketch\src\inc\marlinconfig.h:30,
                 from sketch\src\HAL\STM32\timers.cpp:24:
C:\Users\ASUS\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/HardwareTimer.h:134:10: note: candidate: 'void HardwareTimer::attachInterrupt(callback_function_t)'
  134 |     void attachInterrupt(callback_function_t callback); // Attach interrupt callback which will be called upon update event (timer rollover)
      |          ^~~~~~~~~~~~~~~
C:\Users\ASUS\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/HardwareTimer.h:134:46: note:   no known conversion for argument 1 from 'void(HardwareTimer*)' to 'callback_function_t' {aka 'std::function<void()>'}
  134 |     void attachInterrupt(callback_function_t callback); // Attach interrupt callback which will be called upon update event (timer rollover)
      |                          ~~~~~~~~~~~~~~~~~~~~^~~~~~~~
C:\Users\ASUS\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/HardwareTimer.h:138:10: note: candidate: 'void HardwareTimer::attachInterrupt(uint32_t, callback_function_t)'
  138 |     void attachInterrupt(uint32_t channel, callback_function_t callback); // Attach interrupt callback which will be called upon compare match event of specified channel
      |          ^~~~~~~~~~~~~~~
C:\Users\ASUS\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/HardwareTimer.h:138:10: note:   candidate expects 2 arguments, 1 provided
sketch\src\HAL\STM32\timers.cpp:181:62: error: no matching function for call to 'HardwareTimer::attachInterrupt(void (&)(HardwareTimer*))'
  181 |       timer_instance[timer_num]->attachInterrupt(Temp_Handler);
      |                                                              ^
In file included from C:\Users\ASUS\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/analog.h:45,
                 from C:\Users\ASUS\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/board.h:8,
                 from C:\Users\ASUS\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/wiring.h:41,
                 from C:\Users\ASUS\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/Arduino.h:36,
                 from c:\users\asus\appdata\local\temp\arduino_build_611183\sketch\src\hal\shared\marduino.h:36,
                 from c:\users\asus\appdata\local\temp\arduino_build_611183\sketch\src\hal\stm32\hal.h:28,
                 from c:\users\asus\appdata\local\temp\arduino_build_611183\sketch\src\hal\hal.h:26,
                 from c:\users\asus\appdata\local\temp\arduino_build_611183\sketch\src\inc\marlinconfig.h:30,
                 from sketch\src\HAL\STM32\timers.cpp:24:
C:\Users\ASUS\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/HardwareTimer.h:134:10: note: candidate: 'void HardwareTimer::attachInterrupt(callback_function_t)'
  134 |     void attachInterrupt(callback_function_t callback); // Attach interrupt callback which will be called upon update event (timer rollover)
      |          ^~~~~~~~~~~~~~~
C:\Users\ASUS\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/HardwareTimer.h:134:46: note:   no known conversion for argument 1 from 'void(HardwareTimer*)' to 'callback_function_t' {aka 'std::function<void()>'}
  134 |     void attachInterrupt(callback_function_t callback); // Attach interrupt callback which will be called upon update event (timer rollover)
      |                          ~~~~~~~~~~~~~~~~~~~~^~~~~~~~
C:\Users\ASUS\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/HardwareTimer.h:138:10: note: candidate: 'void HardwareTimer::attachInterrupt(uint32_t, callback_function_t)'
  138 |     void attachInterrupt(uint32_t channel, callback_function_t callback); // Attach interrupt callback which will be called upon compare match event of specified channel
      |          ^~~~~~~~~~~~~~~
C:\Users\ASUS\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/HardwareTimer.h:138:10: note:   candidate expects 2 arguments, 1 provided
exit status 1
为开发板 3D printer boards 编译时出错。
下载 https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json 时出错
下载 https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json 时出错

暂时没有得到解决,望知道的小伙伴解答!

上述的内容我还会再细化补充内容,如果对你有帮助,希望可以点赞以支持,同时也可以在评论区说出自己遇到的问题!

2020年8月21日:问题已解决,根据rumba32的wiki,需要使用VScode进行编译烧录。等之后材料到齐了,就可以制作3D打印机了

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Arduino IDE配置STM32开发环境和程序烧录 的相关文章

  • 现代控制理论2——状态空间分析法

    注 xff1a 本文是在MOOC平台上学习西北工业大学 现代控制理论基础 xff08 郭建国 赵斌 郭宗易 xff09 的课程进行随笔记录与整理 一 状态空间描述的相关概念 1 系统模型包括 xff1a 内部结构 xff0c 以及内部结构反
  • 输出调节——内模原理(1)

    浏览了百度和部分文献 xff08 主要为 xff1a 调节问题系统综述 xff0c 线性系统的内模原理 xff09 xff0c 在此尝试进行一些归纳 一 问题描述 输出调节问题 xff1a output regulation problem
  • RGB-D相机建图——2、openvins安装、测试与连接自己设备

    基础内容贴推荐 xff1a https zhuanlan zhihu com p 93814423 https blog csdn net weixin 39752599 article details 105906652 https zh
  • RGB-D相机建图——3、使用kalibr进行相机标定

    Kalibr 视觉惯性校准工具箱 官方网站 xff1a https github com ethz asl kalibr Kalibr是一个工具箱 xff0c 可以解决以下校准问题 xff1a 多摄像机校准 xff1a 具有非全局共享重叠视
  • 02.构建项目流程梳理及总结

    02 构建项目流程梳理及总结
  • Nuttx学习入门

    Nuttx学习 NuttX 是一个实时操作系统 RTOS xff0c 强调标准合规性和占用空间小 可从 8 位扩展到 64 位微控制器环境 xff0c NuttX 中的主要管理标准是 POSIX 和 ANSI 标准 NuttX 的主要环境依
  • 软件测试之如何介绍自己的项目

    测试人员在找工作的过程中 xff0c 通常有一个问题是很难绕开的 就是要如何向别人介绍自己之前做过的项目 要解决这个问题 xff0c 大致可以分为如下几个步骤 xff1a 1 对项目进行基本介绍 2 说明自己负责测试的模块 3 针对部分模块
  • FreeRTOS多任务管理

    文章目录 1 任务1 1 任务简介1 2 任务调度1 3 任务的状态 就绪态 运行态 阻塞态 挂起态 1 4 空闲任务 2 动态创建两个任务2 1 定义动态内存空间的堆2 2 定义任务函数2 3 定义 任务控制块 指针2 4 动态创建任务
  • 计算机类期刊投稿心得 [ 添加中...现35种 ]

    1 杂志名称 计算机应用研究 杂志文章包含专业 建模 xff0c 仿真 xff0c 网络 xff0c 人工智能 xff0c 比较杂 投稿联系方式 http www arocmag com 注册在线投稿审稿 投稿费用 250元 页 杂志级别
  • Minix下的汇编

    Minix下的汇编 大多数的编译器 xff0c 如Turbo C C 43 43 xff0c Borland C C 43 43 xff0c M C C 43 43 xff0c GCC xff0c VC 43 xff0c 编译过程都是 xf
  • 解决Xshell 7 报错 “要继续使用此程序,您必须应用最新的更新或使用新版本”

    1 先创建一个文本文档 xff0c 同时把该文档名称和后缀改为xshell7 bat xff1b 2 打开编辑这个xshell7 bat文件 xff0c 并且把以下文字复制进去 xff0c 注意set XSHELL 61 这一项需要改成你自
  • 多任务操作系统的任务切换

    在学习OS时 xff0c 对于多任务操作系统的任务切换 xff0c 一直不能理解 xff1a 控制权是怎么么回到调度程序上的 xff1f 记得在描述任务切换时 xff0c 一般都是这么描述的 xff1a 在每一个时钟滴答 xff0c 都将检
  • Minix下的汇编2

    似乎minix平台并没有带一个真正的汇编编译器 xff0c 看看makefile xff0c 几乎都是清一色的用cc来编译汇编代码的 而且 xff0c 即使是一个最简单功能的汇编程序 xff0c 也少不了一个 main 标签 在minix的
  • 原来在/var/spool/mail中

    fetchmail会把从mail server收到的邮件投递到 var spool mail 中去 而mutt也会自动地到 var spool mail里取信 xff0c 解码 xff0c 并显示 但 xff0c fetchmail的速度不
  • 汉字编码标准与识别(一)代码页(Code Page)初识

    BBS水木清华站 精华区 发信人 yanglc 魂归燕园 别理我 xff0c 烦着呢 信区 Linux 标 题 汉字编码标准与识别 一 发信站 BBS 水木清华站 Sat Apr 29 17 19 05 2000 http www linu
  • 让xpdf支持中文(C++primer中文版)

    首先到http www linuxfans org nuke modules php name 61 Site Downloads amp op 61 geninfo amp did 61 2385下载一个打了补丁的xpdf 安装 xff0
  • Xpdf-3 for MDK

    http www linuxfans org nuke modules php name 61 Site Downloads amp op 61 geninfo amp did 61 2385 Xpdf 3 for MDK 类别 其它软件
  • 不同公司的牛

    本文转自 C 43 43 Builder 研究 http www ccrun com other go asp i 61 264 amp d 61 sgz5id 传统公司 xff1a 你有两头母牛 你卖掉一头 xff0c 买了一头公牛 你的
  • 从词法分析开始

    刚开始时 xff0c 用lex的确是很方便 xff0c 但是这样却不能将词法分析的思想实践出来 最好的方法还是自己写一个lex 当然龙书上写得很详细了 xff0c 但是写得再详细 xff0c 把它实现出来还是很难的 我的计划是 xff1a
  • Python 获取当前路径几种方法

    Python 获取当前路径的几种方法 绝对路径 1 os path 方法 span class token comment coding utf 8 span span class token comment usr bin python

随机推荐