如何做国外网站的镜像,平面设计行业市场分析,企业软件,友情链接平台网站周三是我们的篮球日#xff0c;打篮球后总是会有些兴奋#xff0c;然后就容易睡不着#xff0c;额#xff0c;睡不着就拿我的ESP8266开发板出来捣鼓一下。先下载编译工具链https://github.com/espressif/ESP8266_RTOS_SDK下载sdkgit clone https://github.com/espressif/ES…周三是我们的篮球日打篮球后总是会有些兴奋然后就容易睡不着额睡不着就拿我的ESP8266开发板出来捣鼓一下。先下载编译工具链https://github.com/espressif/ESP8266_RTOS_SDK下载sdkgit clone https://github.com/espressif/ESP8266_RTOS_SDK.git 配置编译链环境变量下面的目录路径根据自己的实际情况设定PATH$PATH:/System/Volumes/Data/Users/crisqifawei/Documents/work/ESP8226/Toolchain/xtensa-lx106-elf/bin配置sdk的环境变量下面的目录路径根据自己的实际情况设定export IDF_PATH/System/Volumes/Data/Users/crisqifawei/Documents/work/ESP8226/ESP8266_RTOS_SDK如果想上面修改重启后依然生效就需要修改vim ~/.bash_profile
source ~/.bash_profilemenuconfig配置开发板信息cd /System/Volumes/Data/Users/crisqifawei/Documents/work/ESP8226/ESP8266_RTOS_SDK/examples/get-started/hello_world
make menuconfig注意串口号在Macbook上不一样需要在config里面修改下1、修改烧录串口设备名字是你用usb连接板子后在设备文件里面会看到的2、修改printf 输出串口配置这里需要把串口的波特率修改成115200要不然printf当然了你也可以不修改我这里是为了让我的输出波特率和串口下载的波特率一致。Component config ---Common ESP-related ---(115200) UART console baud rate编译make all 会全部编译一次但是你要烧录到时候执行make flash的时候它还会编译一次所以如果你板子拿到了直接来一次make flash也不是不可以编译过程中出错了按照提示安装需求的依赖就可以/Users/crisqifawei/opt/miniconda3/bin/python -m pip install --user -r /System/Volumes/Data/Users/crisqifawei/Documents/work/ESP8226/ESP8266_RTOS_SDK/requirements.txt程序代码代码路径ESP8266_RTOS_SDK/examples/get-started/hello_world/* Hello World ExampleThis example code is in the Public Domain (or CC0 licensed, at your option.)Unless required by applicable law or agreed to in writing, thissoftware is distributed on an AS IS BASIS, WITHOUT WARRANTIES ORCONDITIONS OF ANY KIND, either express or implied.
*/
#include stdio.h
#include freertos/FreeRTOS.h
#include freertos/task.h
#include esp_system.h
#include esp_spi_flash.hvoid app_main()
{printf(Hello world!\n);/* Print chip information */esp_chip_info_t chip_info;esp_chip_info(chip_info);printf(This is ESP8266 chip with %d CPU cores, WiFi, ,chip_info.cores);printf(silicon revision %d, , chip_info.revision);printf(%dMB %s flash\n, spi_flash_get_chip_size() / (1024 * 1024),(chip_info.features CHIP_FEATURE_EMB_FLASH) ? embedded : external);for (int i 100000; i 0; i--) {printf(Restarting in %d seconds...\n, i);vTaskDelay(1000 / portTICK_PERIOD_MS);}printf(Restarting now.\n);fflush(stdout);esp_restart();
}串口输出