1. 安装文本编辑器 vim/emacs
sudo zypper in emacs
2. 安装编译器 sdcc
sudo zypper in sdcc
3. 下载 python 脚本 sdcflash
wget https://github.com/laborer/stcflash/raw/master/stcflash.py
you may need to install python-serial
sudo zypper in python-serial
4. 编写你的code
5. 使用sdcc进行编译
sdcc hello.c
6. 更改文件格式
pacihx hello.ihx > hello.hex
objcopy -I ihex -O binary hello.hex hello.bin
7. 上传 hello.hex/hello.bin,刷机完成
sudo python sdcflash.py -l 9600

本指南详细介绍了使用vim/emacs作为文本编辑器,sdcc作为编译器,在51单片机上进行编程的步骤。从安装必要的软件到下载python脚本sdcflash,再到编译和上传代码,提供了完整的操作流程。适合初学者快速上手。
679

被折叠的 条评论
为什么被折叠?



