我想编译 sketch使用 Arduino IDE,然后找到 bin 文件并使用另一个程序上传它。
如何为 Arduino 设计自定义 uploader (规范等)?
最佳答案
您已经可以使用 avrdude
做到这一点。如果您绝对不需要开发另一个程序,请尝试使用此程序。
如果您绝对必须实现自己的编程器,请查看 stk500 协议(protocol)。
- 可通过 this forum post 获取重要信息
- 规范直接链接:
示例用法:
/usr/local/bin/avrdude -V -F -C /etc/avrdude.conf -p atmega328p -P /dev/ttyACM0
-c stk500v1 -b 57600 -U flash:w:applet/helloworld.hex
多平台教程:
这是一个依赖 avrdude 的类似程序(用 C# 编写):
命令行示例:
The following is the command that should be used for uploading a program to an Arduino Duemilanove (with an ATmega168 chip).
avrdude -c arduino -p m168 -P usb -U flash:w:FILENAME
replace FILENAME with the hex file you wish to upload to the board. This assumes that you want to write a file to the flash memory. You can of course verify or read from different portions of memory depending on your chip but I’ll leave you to figure that out from the AVRdude manual.
关于c++ - 使用 C++ 上传草图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12694302/