01 ESPlane Developer Get Started

Step 1. Setup ESP-IDF Environment

  1. Get ESP-IDF :This project based on release / v3.3

     git clone -b release/v3.3 --recursive https://github.com/espressif/esp-idf.git
  2. Install the Required Python Packages

     python -m pip install --user -r $IDF_PATH/requirements.txt

Step 2. Get ESPlane2.0 Source Code

  git clone https://github.com/qljz1993/ESPlane2.git

Step 3. Configure ESP-IDF (Optional)

Note: The ESPlane2.0 code comes with components esp32 andfreertos, which already configured can cover the corresponding components of ESP-IDF.

These two components come from release / v3.3 and were recently updated to commit:6f9a7264ce20c6132fbd8309112630d0eb490fe4. If you use the same version ESP-IDF, you can ignore the following configuration process. The following configuration process is only referenced when the two components esp32 andfreertos are updated.

Purpose: Place variables with param orlog tags in the esplane firmware in a continuous address area

Find the drom0_0_seg section in the{IDF_PATH} / components / esp32 / ld / esp32.project.ld.in file and add the following:

    /* Parameters and log system datas >drom0_0_seg*/
    _param_start = .;
    KEEP(*(.param))
    KEEP(*(.param.*))
    _param_stop = .;
    . = ALIGN(4);
    _log_start = .;
    KEEP(*(.log))
    KEEP(*(.log.*))
    _log_stop = .;
    . = ALIGN(4);

It will look like this after changing:

  .flash.rodata :
  {
    _rodata_start = ABSOLUTE(.);

    *(.rodata_desc .rodata_desc.*)               /* Should be the first.  App version info.        DO NOT PUT ANYTHING BEFORE IT! */
    *(.rodata_custom_desc .rodata_custom_desc.*) /* Should be the second. Custom app version info. DO NOT PUT ANYTHING BEFORE IT! */

    mapping[flash_rodata]

    *(.irom1.text) /* catch stray ICACHE_RODATA_ATTR */
    *(.gnu.linkonce.r.*)
    *(.rodata1)
    __XT_EXCEPTION_TABLE_ = ABSOLUTE(.);
    *(.xt_except_table)
    *(.gcc_except_table .gcc_except_table.*)
    *(.gnu.linkonce.e.*)
    *(.gnu.version_r)
    . = (. + 3) & ~ 3;
    __eh_frame = ABSOLUTE(.);
    KEEP(*(.eh_frame))
    . = (. + 7) & ~ 3;
    /*  C++ constructor and destructor tables, properly ordered:  */
    __init_array_start = ABSOLUTE(.);
    KEEP (*crtbegin.*(.ctors))
    KEEP (*(EXCLUDE_FILE (*crtend.*) .ctors))
    KEEP (*(SORT(.ctors.*)))
    KEEP (*(.ctors))
    __init_array_end = ABSOLUTE(.);
    KEEP (*crtbegin.*(.dtors))
    KEEP (*(EXCLUDE_FILE (*crtend.*) .dtors))
    KEEP (*(SORT(.dtors.*)))
    KEEP (*(.dtors))
    /*  C++ exception handlers table:  */
    __XT_EXCEPTION_DESCS_ = ABSOLUTE(.);
    *(.xt_except_desc)
    *(.gnu.linkonce.h.*)
    __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
    *(.xt_except_desc_end)
    *(.dynamic)
    *(.gnu.version_d)
    /* Addresses of memory regions reserved via
       SOC_RESERVE_MEMORY_REGION() */
    soc_reserved_memory_region_start = ABSOLUTE(.);
    KEEP (*(.reserved_memory_address))
    soc_reserved_memory_region_end = ABSOLUTE(.);
    _rodata_end = ABSOLUTE(.);
    /* Literals are also RO data. */
    _lit4_start = ABSOLUTE(.);
    *(*.lit4)
    *(.lit4.*)
    *(.gnu.linkonce.lit4.*)
    _lit4_end = ABSOLUTE(.);
    . = ALIGN(4);
    _thread_local_start = ABSOLUTE(.);
    *(.tdata)
    *(.tdata.*)
    *(.tbss)
    *(.tbss.*)
    _thread_local_end = ABSOLUTE(.);
    . = ALIGN(4);
    /* Parameters and log system datas */
    _param_start = .;
    KEEP(*(.param))
    KEEP(*(.param.*))
    _param_stop = .;
    . = ALIGN(4);
    _log_start = .;
    KEEP(*(.log))
    KEEP(*(.log.*))
    _log_stop = .;
    . = ALIGN(4);

  } >drom0_0_seg

Improve PHY gain

  1. Enter:Component config>>PHY>>Max WiFi TX power (dBm)

  2. Set Max WiFi TX power value to 20

Config FreeRTOS

  1. Modify the followings in the FreeRTOSConfig.h:

    //change configMINIMAL_STACK_SIZE value to 2048,default 768
    #define configMINIMAL_STACK_SIZE        2048  
    
    //change INCLUDE_vTaskCleanUpResources value to 1,default 0
    #define INCLUDE_vTaskCleanUpResources        1  
    
    //Add the following macro define
    #define configUSE_APPLICATION_TASK_TAG  1  
    #define configENABLE_TASK_SNAPSHOT  1
  2. Change freertos tick rate use menuconfig:

Enter:Component config>>freertos>> Tick rate (Hz) Change Tick rate value to 1000

最后更新于