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


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开发板

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

3. 安装STM32CubeProgrammer

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

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

在这里只需要STM32CubeProgrammer初次设置好了是串口方式/DFU方式,之后就不需要用STM32CubeProgrammer了
在DFU模式中,如果需要重新下载程序,需要BOOT0为1,按reset复位,之后才可以烧录程序
其原理应该是BOOT0为1时,按reset后运行DFU程序,系统进行DFU模式,之后就可以用Arduino进行烧录
配置USB支持串口,则可以直接使用USB进行串口读取与发送

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

对了,在编译Marlin 2.0固件的时候,遇到报错:
Arduino IDE配置STM32开发环境和程序烧录

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打印机了

原创:https://www.panoramacn.com
源码网提供WordPress源码,帝国CMS源码discuz源码,微信小程序,小说源码,杰奇源码,thinkphp源码,ecshop模板源码,微擎模板源码,dede源码,织梦源码等。

专业搭建小说网站,小说程序,杰奇系列,微信小说系列,app系列小说

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

免责声明,若由于商用引起版权纠纷,一切责任均由使用者承担。

您必须遵守我们的协议,如果您下载了该资源行为将被视为对《免责声明》全部内容的认可-> 联系客服 投诉资源
www.panoramacn.com资源全部来自互联网收集,仅供用于学习和交流,请勿用于商业用途。如有侵权、不妥之处,请联系站长并出示版权证明以便删除。 敬请谅解! 侵权删帖/违法举报/投稿等事物联系邮箱:2640602276@qq.com
未经允许不得转载:书荒源码源码网每日更新网站源码模板! » Arduino IDE配置STM32开发环境和程序烧录
关注我们小说电影免费看
关注我们,获取更多的全网素材资源,有趣有料!
120000+人已关注
分享到:
赞(0) 打赏

评论抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

您的打赏就是我分享的动力!

支付宝扫一扫打赏

微信扫一扫打赏