ESP8266--Helloworld固件源码详解

本文介绍了ESP8266的 HelloWorld 固件源码,重点解析了程序入口user_init函数及system_done()函数,通过设置定时器实现周期性显示HelloWorld信息。
摘要由CSDN通过智能技术生成

1.下载程序,查看效果

https://blog.csdn.net/yichu5074/article/details/81096029

 

 

 

2.源码详解

程序入口在文件的user_main.c文件中的user_init函数中

/*
 * ESPRSSIF MIT License
 *
 * Copyright (c) 2016 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
 *
 * Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
 * it is free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the Soft
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
为搭建ESP8266-IDF的helloworld环境,需要进行以下步骤: 1. 安装Ubuntu系统,并安装所需的基本软件,如Python、Git等。 2. 下载ESP8266-IDF源代码,并将其放置在合适的目录下。 3. 配置ESP8266编译环境,包括设置环境变量、安装交叉编译工具链等。 4. 创建一个新的ESP8266项目,并编写helloworld程序。 5. 编译并烧录程序到ESP8266开发板上。 下面是具体的步骤: 1. 安装Ubuntu系统,并安装所需的基本软件,如Python、Git等。可以使用以下命令安装所需软件: ```shell sudo apt-get update sudo apt-get install git wget make libncurses-dev flex bison gperf python python-serial ``` 2. 下载ESP8266-IDF源代码,并将其放置在合适的目录下。可以使用以下命令下载ESP8266-IDF源代码: ```shell git clone --recursive https://github.com/espressif/esp8266-idf.git ``` 3. 配置ESP8266编译环境,包括设置环境变量、安装交叉编译工具链等。可以使用以下命令配置ESP8266编译环境: ```shell cd esp8266-idf ./install.sh ``` 4. 创建一个新的ESP8266项目,并编写helloworld程序。可以使用以下命令创建一个新的ESP8266项目: ```shell cd ~/esp8266 cp -r $IDF_PATH/examples/get-started/hello_world . cd hello_world ``` 然后,可以使用任何文本编辑器编写helloworld程序,例如: ```c #include <stdio.h> void app_main() { printf("Hello, world!\n"); } ``` 5. 编译并烧录程序到ESP8266开发板上。可以使用以下命令编译并烧录程序: ```shell make menuconfig # 配置编译选项 make all # 编译程序 make flash # 烧录程序到ESP8266开发板 ``` 至此,ESP8266-IDF的helloworld环境搭建完成。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值