# STC8051-SDCC-Makefile **Repository Path**: linuxlife7380/stc8051-sdcc-makefile ## Basic Information - **Project Name**: STC8051-SDCC-Makefile - **Description**: STC 8051单片机在SDCC编译器下的工程模板 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-01-01 - **Last Updated**: 2025-10-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: sdcc, STC, mcs51, 8051, makefile ## README # STC8051-SDCC-Makefile #### 介绍 STC单片机在Linux下使用SDCC编译器的编译脚本和初始化文件 #### 使用说明 1. 下载到本地,如果为压缩包则解压 2. 复制并修改Makefile,在target后面输入工程名称,修改里面的代码文件位置并保存 3. 代码编写完成后,执行make命令开始编译,如果没有错误会出现bin文件 4. 如果需要一键烧录(make flash),先安装python环境,安装stcgal 5. 串口连接单片机开发板,执行make search_serial找到串口编号,然后修改Maekfile选项serial,最后执行make flash开始烧录 6. 由于SDCC的中断函数只能定义在main主函数所在的文件下,在startup-8051.c中,在对应中断函数添加你需要执行的中断函数; bsp_init用于外设初始化,app_main_task用于和硬件无关的主程序 7. 在startup-8051.c中,修改里面的putchar和getchar函数所使用的串口,以便使用C标准库的输入输出功能,如printf #### 参与贡献 1. PonyLinuxlife #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)