學(xué)校網(wǎng)站建設(shè)發(fā)展概況分析seo關(guān)鍵詞排名優(yōu)化怎么收費
周三是我們的籃球日,打籃球后總是會有些興奮,然后就容易睡不著,額,睡不著就拿我的ESP8266開發(fā)板出來搗鼓一下。
先下載編譯工具鏈
https://github.com/espressif/ESP8266_RTOS_SDK

下載sdk
git clone https://github.com/espressif/ESP8266_RTOS_SDK.git
?配置編譯鏈環(huán)境變量
下面的目錄路徑根據(jù)自己的實際情況設(shè)定
PATH=$PATH:/System/Volumes/Data/Users/crisqifawei/Documents/work/ESP8226/Toolchain/xtensa-lx106-elf/bin
配置sdk的環(huán)境變量
下面的目錄路徑根據(jù)自己的實際情況設(shè)定
export IDF_PATH=/System/Volumes/Data/Users/crisqifawei/Documents/work/ESP8226/ESP8266_RTOS_SDK
如果想上面修改重啟后依然生效,就需要修改
vim?~/.bash_profile
source?~/.bash_profile
menuconfig配置開發(fā)板信息
cd?/System/Volumes/Data/Users/crisqifawei/Documents/work/ESP8226/ESP8266_RTOS_SDK/examples/get-started/hello_world
make?menuconfig
注意串口號在Macbook上不一樣,需要在config里面修改下
1、修改燒錄串口設(shè)備
名字是你用usb連接板子后,在設(shè)備文件里面會看到的


2、修改printf 輸出串口配置
這里需要把串口的波特率修改成115200,要不然printf,當(dāng)然了,你也可以不修改
我這里是為了讓我的輸出波特率和串口下載的波特率一致。
Component config --->
Common ESP-related --->
(115200) UART console baud rate
編譯
make all 會全部編譯一次
但是你要燒錄到時候,執(zhí)行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.h"void 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();
}