添加板包
选择文件->首选项,在附加开发板管理器中填入以下网址:
http://mcu.lvjianze.cn/study/stm32/package_stmicroelectronics_index.json
配置完可能需要重启
连接开发板
选择板子和端口
也可以在Tools菜单栏中选择
对于STM32可能还需要选择以下参数
案例
新建一个项目,点击上传
点击如果打印以下信息说明安装成功
ketch uses 11960 bytes (2%) of program storage space. Maximum is 524288 bytes.
Global variables use 836 bytes (0%) of dynamic memory, leaving 195772 bytes for local variables. Maximum is 196608 bytes.
--------------------------
Compilation complete.
-------------------------------------------------------------------
STM32CubeProgrammer v2.9.0
-------------------------------------------------------------------
ST-LINK SN : 066BFF393738425043083432
ST-LINK FW : V2J33M25
Board : P-NUCLEO-WB55
Voltage : 3.25V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x495
Revision ID : Rev Y
Device name : STM32WB5x
Flash size : 1 MBytes
Device type : MCU
Device CPU : Cortex-M4
BL Version : 0xd5
Debug in Low Power mode enabled
Memory Programming ...
Opening and parsing file: sketch_feb22a.ino.bin
File : sketch_feb22a.ino.bin
Size : 12300 Bytes
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 3]
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:01.015
RUNNING Program ...
Address: : 0x8000000
Application is running, Please Hold on...
Start operation achieved successfully
--------------------------
upload complete.
问题
stm32: Error during Upload: Property 'upload.tool.serial' is undefined
解决
stm32: Error during Upload: Property ‘upload.tool.serial’ is undefined · Issue #1444 · arduino/arduino-cli (github.com)
fix: arduino-cli upload failed (version started from 0.19.0 to 0.21.0),arduino-cli 0.19.0-0.21.0版本会出现以上问题,需要更新arduino-cli版本
arduino-cli.exe 位置 --Arduino安装目录–\resources\app\node_modules\arduino-ide-extension\build
Installation - Arduino CLI
将下载的arduino-cli 替换掉之前的 arduino-cli即可
Sketch uses 11960 bytes (2%) of program storage space. Maximum is 524288 bytes.
Global variables use 836 bytes (0%) of dynamic memory, leaving 195772 bytes for local variables. Maximum is 196608 bytes.
--------------------------
Compilation complete.
STM32CubeProgrammer not found (STM32_Programmer_CLI.exe).
Please install it or add '<STM32CubeProgrammer path>\bin' to your PATH environment:
https://www.st.com/en/development-tools/stm32cubeprog.html
Aborting!
C:/Users/eG/AppData/Local/Arduino15/packages/STMicroelectronics/tools/STM32Tools/2.1.1/stm32CubeProg.sh: line 141: STM32_Programmer_CLI.exe: not found
Upload error: Failed uploading: uploading error: exit status 127
解决
下载STM32CubeProgrammer
安装后将bin配置成到环境变量中
|