esp8266 rtos sdk示例工程

esp8266 rtos sdk示例工程

上一篇文章说明了使用ubuntu 14.04搭建esp8266编译环境,搭建成功后,在使用其sdk 用户示例工程partitions_singleapp工程编译测试成功,生成了三个主要的bin文件。

一.程序烧录

他们路径分别是:bootloader.bin,partitions_singleapp.bin,project_template.bin,其实还有些其他烧录文件,比如射频校准等,现在还没有研究,后面再说,先让开发板跑起来。
在这里插入图片描述
我们只有使用其烧写工具将其烧录进开发板中即可。

由于购买开发板商家提供的nonos相关文档信息,与rtos sdk烧写有些区别,通过百度搜索,查找有关资料,得知,需要将上面三个文件分别烧写到如下地址中,开发板就能启动。
在这里插入图片描述
此次因为没有找到开发板flash大小,就假设使用2m flash进行烧写测试的,好在暂时不影响使用,后面我回通过调用api接口获取其flash大小在做调整。

注意上面的烧写参数设置,在编译project_template工程之前,我们需要make menuconfig 设置烧写参数:
在这里插入图片描述

二.程序测试(project_template)

1.修改代码
我们修改程序中的下面代码:
在这里插入图片描述

/*
   This example code is in the Public Domain (or CC0 licensed, at your option.)

   Unless required by applicable law or agreed to in writing, this
   software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
   CONDITIONS OF ANY KIND, either express or implied.
*/

#include <stdio.h>

#include "esp_system.h"

#include "freertos/FreeRTOS.h"    //add cdb  2019-12-17
#include "freertos/task.h"    //add cdb  2019-12-17


/******************************************************************************
 * FunctionName : app_main
 * Description  : entry of user application, init user function here
 * Parameters   : none
 * Returns      : none
*******************************************************************************/
void app_main(void)
{
   //modify cdb 2019-12-17
   // printf("SDK version:%s\n", esp_get_idf_version());

	int i=0;

	for(i=0;i<5;i++)
	{
		vTaskDelay(1000 / portTICK_RATE_MS);
		printf("this is test mode %d\n",i);
	}
}


注意此工程是esp8266提供的示例,我们以后项目开发都要从这个入口进行相关功能的开发。

我对其代码做了上述修改,测试对rtos sdk ,程序烧录。

2.make clean

3.make

4.重新烧写project_template.bin 文件

5.给开发板reset
查看log(串口波特率78840):
在这里插入图片描述

至此,玩esp8266基本已经入门了,后面就可以在示例工程中做相应功能的开发了。

注意:本例中使用的rtos sdk版本为3.1.1
在这里插入图片描述

下载路径:https://github.com/espressif/ESP8266_RTOS_SDK/releases
在这里插入图片描述

发布了73 篇原创文章 · 获赞 6 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_38240926/article/details/103587101