zoukankan      html  css  js  c++  java
  • ESP8266 SDK开发: 开发环境搭建(NONOS 2.2.0)

    前言

      最近发现有些用户使用的是NONOS版本的SDK

      考虑到只要是会使用RTOS版本的用户基本上都会使用NONOS版本

      而会使用NONOS的用户大部分都不会使用RTOS版本

      

      故后期的教程以NONOS版本为主,RTOS版本为辅

      整个文章按照NONOS版本为主线编写,最后说明和RTOS版本的区别

    导入工程

      咱们用NONOS 2.2.0版本

      导入NONOS 2.2.0版本

    1.按照上一节安装好软件以后

    把这个工程解压到

    2.File -> Import

     

      

     清理工程

      

     编译工程

    下载程序

    生成的bin文件位置

    咱现在不需要IAP升级程序,所以只刷上面四个

    eagle.flash.bin                             0x00000

    eagle.irom0text.bin                      0x10000

    esp_init_data_default_v08.bin    0x3FC000

    blank.bin                                      0x3FE000

    按下复位按钮 → 按下固件按钮 → 松开复位按钮 → 松开固件按钮

      按照上述步骤,ESP8266进入等待刷固件状态(刷程序状态)

        

     

    打开串口调试助手

      

      

     

    复位

     

       

    提示

    看uart.c的最后一行

    按照下面的修改

    /*test code*/
    void ICACHE_FLASH_ATTR
    uart_init_2(UartBautRate uart0_br, UartBautRate uart1_br)
    {
        // rom use 74880 baut_rate, here reinitialize
        UartDev.baut_rate = uart0_br;
    //    UartDev.exist_parity = STICK_PARITY_EN;
        UartDev.parity = NONE_BITS;//无奇偶校验
        UartDev.stop_bits = ONE_STOP_BIT;//1位停止位
        UartDev.data_bits = EIGHT_BITS;//8位数据
        
        uart_config(UART0);
        UartDev.baut_rate = uart1_br;
        uart_config(UART1);
        ETS_UART_INTR_ENABLE();
    
        // install uart1 putc callback
    //    os_install_putc1((void *)uart1_write_char);//printf使用串口1打印(GPIO2)
    
        os_install_putc1((void *)uart0_write_char);//printf使用串口0打印
    }

    如果不希望过多的调试信息使用串口0输出

    os_install_putc1((void *)uart1_write_char);//printf使用串口1打印(GPIO2)

    main函数包含 

    #include "driver/uart.h" //包含uart.h

     

    uart_init_2(BIT_RATE_115200,BIT_RATE_115200);

    Clear project    

    Building project

    再次下载打印

  • 相关阅读:
    ES6 函数的扩展2
    css3 UI元素状态伪类选择器
    HTML5 矩阵变换
    ES6 let和const命令(4)
    ES6 let和const命令(3)
    ES6 let和const命令(2)
    JVM的内存区域划分(一)
    MySQL的四种事务隔离级别
    快速排序
    Struts2与SpringMVC的区别
  • 原文地址:https://www.cnblogs.com/yangfengwu/p/12543832.html
Copyright © 2011-2022 走看看