在树莓派上搭建51单片机开发环境,使用的是树莓派1代B+,操作系统为DietPi,单片机为国产STC89系列及12系列,均测试成功。安装python环境,下载工具为python脚本 sudo apt-get install python 安装SDCC编译环境sudo apt-get install sdcc 编译安装Hex2bin用来将hex文件转换成bin文件 使用STCflash下载工具 下载命令 python stcflash.py test.bin 可以使用 --protocol 指定使用哪个下载协议,89或12 python stcflash.py --protocol 89(12) test.bin 默认端口是 ttyUSB0,可以查看设备后自行指定 python stcflash.py --protocol 89(12) /dev/ttyUSBx test.bin 使用 -d 可以查看更多信息 python stcflash.py -d --protocol 89(12) test.bin 最后成功实现了51单片机在树莓派上的编译环境 附工具: |
196.19 KB , 下载次数: 85
19.12 KB , 下载次数: 103
算是文本式的吧,写好程序然后编译,再手动下载,这个方案在每个linux发行版应该都是可以的,我之前在ubuntu上没成功,这次在树莓派上一次就成功了。 |
你确定可以在树莓派上编译Hex2bin? hex2bin.o: In function `main': hex2bin.c:(.text.startup+0x5c): undefined reference to `ParseOptions' hex2bin.c:(.text.startup+0x70): undefined reference to `NoFailOpenInputFile' hex2bin.c:(.text.startup+0x7c): undefined reference to `PutExtension' hex2bin.c:(.text.startup+0x84): undefined reference to `NoFailOpenOutputFile' hex2bin.c:(.text.startup+0xd8): undefined reference to `GetLine' hex2bin.c:(.text.startup+0x1dc): undefined reference to `Allocate_Memory_And_Rewind' hex2bin.c:(.text.startup+0x200): undefined reference to `GetLine' hex2bin.c:(.text.startup+0x320): undefined reference to `VerifyChecksumValue' hex2bin.c:(.text.startup+0x398): undefined reference to `WriteMemory' hex2bin.c:(.text.startup+0x450): undefined reference to `VerifyChecksumValue' hex2bin.c:(.text.startup+0x7bc): undefined reference to `ReadDataBytes' hex2bin.c:(.text.startup+0x7f4): undefined reference to `VerifyChecksumValue' hex2bin.c:(.text.startup+0x824): undefined reference to `usage' collect2: error: ld returned 1 exit status |
把编译指令修改下可以编译了 |
只有小组成员才能发言,加入小组>>
5063个成员聚集在这个小组
加入小组6343 浏览 0 评论
14370 浏览 9 评论
7949 浏览 0 评论
基于Amazon Echo 和 Raspberry Pi 的自动窗帘控制
7294 浏览 1 评论
【下载】《Linux+树莓派玩转智能家居》——亲手进行树莓派应用制作
163136 浏览 374 评论
电子发烧友网
电子发烧友开云(中国)官方