Merge 'master' into feature/esp32s2beta_update

pull/4273/head
Angus Gratton 2019-08-20 13:22:16 +10:00 zatwierdzone przez Angus Gratton
commit 0a0bb09585
62 zmienionych plików z 160 dodań i 203 usunięć

Wyświetl plik

@ -343,7 +343,7 @@ esp_err_t ledc_timer_config(const ledc_timer_config_t* timer_conf)
ESP_LOGE(LEDC_TAG, "invalid timer #%u", timer_num);
return ESP_ERR_INVALID_ARG;
}
return ledc_set_timer_div(timer_num, timer_num, timer_conf->clk_cfg, freq_hz, duty_resolution);
return ledc_set_timer_div(speed_mode, timer_num, timer_conf->clk_cfg, freq_hz, duty_resolution);
}
esp_err_t ledc_set_pin(int gpio_num, ledc_mode_t speed_mode, ledc_channel_t ledc_channel)

Wyświetl plik

@ -57,7 +57,7 @@ static void produce_pulse(void)
.freq_hz = 1,
.clk_cfg = LEDC_AUTO_CLK,
};
ledc_timer_config(&ledc_timer);
ESP_ERROR_CHECK(ledc_timer_config(&ledc_timer));
ledc_channel_config_t ledc_channel = {
.speed_mode = LEDC_HIGH_SPEED_MODE,
@ -68,7 +68,7 @@ static void produce_pulse(void)
.duty = 100,
.hpoint = 0,
};
ledc_channel_config(&ledc_channel);
ESP_ERROR_CHECK(ledc_channel_config(&ledc_channel));
}
static void IRAM_ATTR pcnt_intr_handler(void *arg)

Wyświetl plik

@ -38,11 +38,6 @@
#include "esp_private/wifi_os_adapter.h"
#include "esp_private/wifi.h"
#include "esp_phy_init.h"
#include "crypto/md5.h"
#include "crypto/sha1.h"
#include "crypto/crypto.h"
#include "crypto/aes.h"
#include "crypto/dh_group5.h"
#include "driver/periph_ctrl.h"
#include "nvs.h"
#include "os.h"

Wyświetl plik

@ -38,20 +38,13 @@
#include "esp_private/wifi_os_adapter.h"
#include "esp_private/wifi.h"
#include "esp_phy_init.h"
#include "crypto/md5.h"
#include "crypto/sha1.h"
#include "crypto/crypto.h"
#include "crypto/aes.h"
#include "crypto/dh_group5.h"
#include "driver/periph_ctrl.h"
#include "nvs.h"
#include "os.h"
#include "esp_smartconfig.h"
#include "esp_coexist_internal.h"
#include "esp_coexist_adapter.h"
#if CONFIG_IDF_TARGET_ESP32S2BETA
#include "esp32s2beta/clk.h"
#endif
#define TAG "esp_adapter"
@ -583,9 +576,7 @@ wifi_osi_funcs_t g_wifi_osi_funcs = {
._get_random = os_get_random,
._get_time = get_time_wrapper,
._random = os_random,
#if CONFIG_IDF_TARGET_ESP32S2BETA
._slowclk_cal_get = esp_clk_slowclk_cal_get,
#endif
._log_write = esp_log_write,
._log_timestamp = esp_log_timestamp,
._malloc_internal = malloc_internal_wrapper,

Wyświetl plik

@ -9,7 +9,6 @@ else()
endif()
idf_component_register(SRCS "src/coexist.c"
"src/crypto_ops.c"
"src/lib_printf.c"
"src/mesh_event.c"
"src/phy_init.c"

@ -1 +1 @@
Subproject commit 57e1fd11f2f2e17c39ce9612e5fd87d687bcf133
Subproject commit 09ed80c2b047ae5bb41ddbfb9be44ec2bc71fedd

Wyświetl plik

@ -3,7 +3,6 @@ idf_component_register(SRCS "transport.c"
"transport_tcp.c"
"transport_ws.c"
"transport_utils.c"
"transport_strcasestr.c"
INCLUDE_DIRS "include"
PRIV_INCLUDE_DIRS "private_include"
REQUIRES lwip esp-tls)

Wyświetl plik

@ -1,57 +0,0 @@
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* The quadratic code is derived from software contributed to Berkeley by
* Chris Torek.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* Linear algorithm Copyright (C) 2008 Eric Blake
* Permission to use, copy, modify, and distribute the linear portion of
* software is freely granted, provided that this notice is preserved.
*/
#include "transport_strcasestr.h"
#include <string.h>
#include <ctype.h>
char *transport_strcasestr(const char *buffer, const char *key)
{
char c, sc;
size_t len;
if ((c = *key++) != 0) {
c = tolower((unsigned char)c);
len = strlen(key);
do {
do {
if ((sc = *buffer++) == 0)
return (NULL);
} while ((char)tolower((unsigned char)sc) != c);
} while (strncasecmp(buffer, key, len) != 0);
buffer--;
}
return ((char *)buffer);
}

Wyświetl plik

@ -1,38 +0,0 @@
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* The quadratic code is derived from software contributed to Berkeley by
* Chris Torek.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* Linear algorithm Copyright (C) 2008 Eric Blake
* Permission to use, copy, modify, and distribute the linear portion of
* software is freely granted, provided that this notice is preserved.
*/
char *transport_strcasestr(const char *buffer, const char *key);

Wyświetl plik

@ -8,7 +8,6 @@
#include "esp_transport_tcp.h"
#include "esp_transport_ws.h"
#include "esp_transport_utils.h"
#include "transport_strcasestr.h"
#include "mbedtls/base64.h"
#include "mbedtls/sha1.h"
@ -64,7 +63,7 @@ static char *trimwhitespace(const char *str)
static char *get_http_header(const char *buffer, const char *key)
{
char *found = transport_strcasestr(buffer, key);
char *found = strcasestr(buffer, key);
if (found) {
found += strlen(key);
char *found_end = strstr(found, "\r\n");

Wyświetl plik

@ -12,6 +12,7 @@ set(srcs "port/os_xtensa.c"
"src/crypto/aes-wrap.c"
"src/crypto/bignum.c"
"src/crypto/crypto_mbedtls.c"
"src/crypto/crypto_ops.c"
"src/crypto/crypto_internal-cipher.c"
"src/crypto/crypto_internal-modexp.c"
"src/crypto/crypto_internal-rsa.c"

Wyświetl plik

@ -1,10 +0,0 @@
#ifndef WEPKEY_H
#define WEPKEY_H
#define WEPKEY_64_BYTES 5
#define WePKEY_128_BYTES 13
unsigned int wepkey_64(uint8_t *out, unsigned int size, const char *in, int n);
unsigned int wepkey_128(uint8_t *out, unsigned int size, const char *in, int n);
#endif /* WEPKEY_H */

Wyświetl plik

@ -40,7 +40,10 @@ extern "C" {
/** @addtogroup WPA_APIs
* @{
*/
/* Crypto callback functions */
const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs;
/* Mesh crypto callback functions */
const mesh_crypto_funcs_t g_wifi_default_mesh_crypto_funcs;
/**
* @brief Supplicant initialization

Wyświetl plik

@ -10,7 +10,6 @@
#include "utils/common.h"
#include "crypto/crypto.h"
#include "crypto/random.h"
#include "common/ieee802_11_defs.h"
#include "hostapd.h"
#include "ap/sta_info.h"

Wyświetl plik

@ -31,8 +31,8 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/aes.h"
#include "crypto/aes_wrap.h"
#include "aes.h"
#include "aes_wrap.h"
#ifdef USE_MBEDTLS_CRYPTO
#include "mbedtls/aes.h"

Wyświetl plik

@ -24,8 +24,8 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/crypto.h"
#include "crypto/aes_i.h"
#include "crypto.h"
#include "aes_i.h"

Wyświetl plik

@ -23,8 +23,8 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/crypto.h"
#include "crypto/aes_i.h"
#include "crypto.h"
#include "aes_i.h"
#include "os.h"

Wyświetl plik

@ -24,8 +24,8 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/crypto.h"
#include "crypto/aes_i.h"
#include "crypto.h"
#include "aes_i.h"
/*
* rijndael-alg-fst.c

Wyświetl plik

@ -34,8 +34,8 @@
#ifdef USE_MBEDTLS_CRYPTO
#include "mbedtls/aes.h"
#else /* USE_MBEDTLS_CRYPTO */
#include "crypto/aes.h"
#include "crypto/aes_wrap.h"
#include "aes.h"
#include "aes_wrap.h"
#endif /* USE_MBEDTLS_CRYPTO */
/**

Wyświetl plik

@ -25,8 +25,8 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/aes.h"
#include "crypto/aes_wrap.h"
#include "aes.h"
#include "aes_wrap.h"
#ifdef USE_MBEDTLS_CRYPTO
#include "mbedtls/aes.h"
#endif /* USE_MBEDTLS_CRYPTO */

Wyświetl plik

@ -15,7 +15,7 @@
#ifndef AES_I_H
#define AES_I_H
#include "crypto/aes.h"
#include "aes.h"
/* #define FULL_UNROLL */
#define AES_SMALL_TABLES

Wyświetl plik

@ -23,10 +23,10 @@
#include "utils/common.h"
#include "utils/includes.h"
#include "crypto/crypto.h"
#include "crypto/aes.h"
#include "crypto.h"
#include "aes.h"
#if defined(CONFIG_DES) || defined(CONFIG_DES3)
#include "crypto/des_i.h"
#include "des_i.h"
#endif
#ifdef USE_MBEDTLS_CRYPTO
#include "mbedtls/aes.h"

Wyświetl plik

@ -35,7 +35,7 @@
#else /* USE_MBEDTLS_CRYPTO */
#include "bignum.h"
#endif /* USE_MBEDTLS_CRYPTO */
#include "crypto/crypto.h"
#include "crypto.h"
#ifdef USE_MBEDTLS_CRYPTO
int

Wyświetl plik

@ -7,7 +7,7 @@
*/
#include "utils/common.h"
#include "crypto/crypto.h"
#include "crypto.h"
#include "utils/includes.h"
#include "utils/common.h"

Wyświetl plik

@ -23,9 +23,9 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/crypto.h"
#include "crypto/sha1_i.h"
#include "crypto/md5_i.h"
#include "crypto.h"
#include "sha1_i.h"
#include "md5_i.h"
#ifdef USE_MBEDTLS_CRYPTO
#include "mbedtls/sha256.h"
#endif

Wyświetl plik

@ -19,7 +19,7 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/crypto.h"
#include "crypto.h"
#include "mbedtls/ecp.h"
#include "mbedtls/entropy.h"

Wyświetl plik

@ -13,14 +13,14 @@
// limitations under the License.
#include "utils/common.h"
#include "crypto/aes_wrap.h"
#include "crypto/sha256.h"
#include "crypto/crypto.h"
#include "crypto/md5.h"
#include "crypto/sha1.h"
#include "crypto/aes.h"
#include "crypto/dh_group5.h"
#include "esp_wifi_crypto_types.h"
#include "aes_wrap.h"
#include "sha256.h"
#include "crypto.h"
#include "md5.h"
#include "sha1.h"
#include "aes.h"
#include "esp_wpa.h"
/*
* This structure is used to set the cyrpto callback function for station to connect when in security mode.
* These functions either call MbedTLS API's if USE_MBEDTLS_CRYPTO flag is set through Kconfig, or native

Wyświetl plik

@ -12,7 +12,7 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/crypto.h"
#include "crypto.h"
//#include "des_i.h"
/*

Wyświetl plik

@ -15,8 +15,8 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/dh_groups.h"
#include "crypto/dh_group5.h"
#include "dh_groups.h"
#include "dh_group5.h"
void *

Wyświetl plik

@ -15,9 +15,9 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/crypto.h"
#include "crypto/random.h"
#include "crypto/dh_groups.h"
#include "crypto.h"
#include "random.h"
#include "dh_groups.h"
#include "utils/wpabuf.h"
#include "utils/wpa_debug.h"
#include "esp_wifi_crypto_types.h"

Wyświetl plik

@ -6,7 +6,7 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/crypto.h"
#include "crypto.h"
#define MD4_BLOCK_LENGTH 64
#define MD4_DIGEST_LENGTH 16

Wyświetl plik

@ -15,9 +15,9 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/md5.h"
#include "crypto/md5_i.h"
#include "crypto/crypto.h"
#include "md5.h"
#include "md5_i.h"
#include "crypto.h"
static void MD5Transform(u32 buf[4], u32 const in[16]);

Wyświetl plik

@ -15,8 +15,8 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/md5.h"
#include "crypto/crypto.h"
#include "md5.h"
#include "crypto.h"
/**

Wyświetl plik

@ -10,9 +10,9 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/sha1.h"
#include "crypto/ms_funcs.h"
#include "crypto/crypto.h"
#include "sha1.h"
#include "ms_funcs.h"
#include "crypto.h"
/**
* utf8_to_ucs2 - Convert UTF-8 string to UCS-2 encoding

Wyświetl plik

@ -15,7 +15,7 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/crypto.h"
#include "crypto.h"
#define S_SWAP(a,b) do { u8 t = S[a]; S[a] = S[b]; S[b] = t; } while(0)

Wyświetl plik

@ -15,10 +15,10 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/sha1.h"
#include "crypto/sha1_i.h"
#include "crypto/md5.h"
#include "crypto/crypto.h"
#include "sha1.h"
#include "sha1_i.h"
#include "md5.h"
#include "crypto.h"
#ifdef USE_MBEDTLS_CRYPTO
#include "mbedtls/sha1.h"

Wyświetl plik

@ -14,9 +14,9 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/sha1.h"
#include "crypto/md5.h"
#include "crypto/crypto.h"
#include "sha1.h"
#include "md5.h"
#include "crypto.h"
#ifdef USE_MBEDTLS_CRYPTO
#include "mbedtls/pkcs5.h"

Wyświetl plik

@ -15,8 +15,8 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/sha1.h"
#include "crypto/crypto.h"
#include "sha1.h"
#include "crypto.h"
/**

Wyświetl plik

@ -33,8 +33,8 @@
#ifdef USE_MBEDTLS_CRYPTO
#include "mbedtls/sha256.h"
#else /* USE_MBEDTLS_CRYPTO */
#include "crypto/sha256.h"
#include "crypto/crypto.h"
#include "sha256.h"
#include "crypto.h"
#endif /* USE_MBEDTLS_CRYPTO */
#ifdef USE_MBEDTLS_CRYPTO

Wyświetl plik

@ -30,8 +30,8 @@
#include "utils/includes.h"
#include "utils/common.h"
#include "crypto/sha256.h"
#include "crypto/crypto.h"
#include "sha256.h"
#include "crypto.h"
/**

Wyświetl plik

@ -10,7 +10,6 @@
#ifdef EAP_TTLS
#include "utils/common.h"
#include "crypto/ms_funcs.h"
#include "crypto/sha1.h"
#include "tls/tls.h"
#include "eap_peer/eap.h"

Wyświetl plik

@ -29,7 +29,6 @@
#include "crypto/crypto.h"
#include "crypto/sha1.h"
#include "crypto/aes_wrap.h"
#include "crypto/wepkey.h"
#include "esp_wifi_driver.h"
#include "esp_private/wifi.h"

Wyświetl plik

@ -26,7 +26,6 @@
#include "crypto/crypto.h"
#include "crypto/sha1.h"
#include "crypto/aes_wrap.h"
#include "crypto/wepkey.h"
/**
* eapol_sm_notify_eap_success - Notification of external EAP success trigger

Wyświetl plik

@ -14,8 +14,6 @@
#include "utils/wpa_debug.h"
#include "common/ieee802_11_defs.h"
#include "crypto/dh_group5.h"
#include "wps/wps_i.h"
#include "wps/wps_dev_attr.h"

Wyświetl plik

@ -11,9 +11,9 @@
#include "crypto/aes_wrap.h"
#include "crypto/crypto.h"
#include "crypto/dh_group5.h"
#include "crypto/sha256.h"
#include "crypto/random.h"
#include "crypto/dh_group5.h"
#include "common/ieee802_11_defs.h"
#include "wps/wps_i.h"

Wyświetl plik

@ -12,9 +12,9 @@
#include "crypto/aes_wrap.h"
#include "crypto/crypto.h"
#include "crypto/dh_group5.h"
#include "crypto/sha1.h"
#include "crypto/sha256.h"
#include "crypto/dh_group5.h"
#include "crypto/random.h"
#include "wps/wps_i.h"

Wyświetl plik

@ -1,5 +1,6 @@
Bootloader
=====================
:link_to_translation:`zh_CN:[中文]`
Bootloader performs the following functions:

Wyświetl plik

@ -1 +1,59 @@
.. include:: ../../en/api-guides/bootloader.rst
引导加载程序Bootloader
==========================
:link_to_translation:`en:[English]`
引导加载程序Bootloader主要执行以下任务
1. 内部模块的最小化初始配置;
2. 根据分区表和 ota_data如果存在选择需要引导的应用程序app分区
3. 将此应用程序映像加载到 RAMIRAM 和 DRAM最后把控制权转交给应用程序。
引导加载程序位于 Flash 的 `0x1000` 偏移地址处。
恢复出厂设置
------------
用户可以编写一个基本的工作固件然后将其加载到工厂分区factory中。
接下来,通过 OTA空中升级更新固件更新后的固件会被保存到某个 OTA app 分区中OTA 数据分区也会做相应更新以指示从该分区引导应用程序。
如果你希望回滚到出厂固件并清除设置,则需要设置 :ref:`CONFIG_BOOTLOADER_FACTORY_RESET`
出厂重置机制允许将设备重置为出厂模式:
- 清除一个或多个数据分区。
- 从工厂分区启动。
:ref:`CONFIG_BOOTLOADER_DATA_FACTORY_RESET` - 允许用户选择在恢复出厂设置时需要删除的数据分区。可以通过逗号来分隔多个分区的名字,并适当增加空格以便阅读(例如 "nvs, phy_init, nvs_custom, ...")。请确保此处指定的名称和分区表中的名称相同,且不含有 “app” 类型的分区。
:ref:`CONFIG_BOOTLOADER_OTA_DATA_ERASE` - 恢复出厂模式后设备会从工厂分区启动OTA 数据分区会被清除。
:ref:`CONFIG_BOOTLOADER_NUM_PIN_FACTORY_RESET`- 设置用于触发出厂重置的 GPIO 编号,必须在芯片复位时将此 GPIO 拉低才能触发出厂重置事件。
:ref:`CONFIG_BOOTLOADER_HOLD_TIME_GPIO`- 设置进入重置或测试模式所需要的保持时间(默认为 5 秒。设备复位后GPIO 必须在这段时间内持续保持低电平,然后才会执行出厂重置或引导测试分区。
示例分区表如下::
# Name, Type, SubType, Offset, Size, Flags
# 注意,如果你增大了引导加载程序的大小,请确保更新偏移量,避免和其它分区发生重叠
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
factory, 0, 0, 0x10000, 1M
test, 0, test, , 512K
ota_0, 0, ota_0, , 512K
ota_1, 0, ota_1, , 512K
从测试固件启动
--------------
用户可以编写在生产环境中测试用的特殊固件,然后在需要的时候运行。此时需要在分区表中专门申请一块分区用于保存该测试固件(详情请参阅 :doc:`分区表 <partition-tables>`)。如果想要触发测试固件,还需要设置 :ref:`CONFIG_BOOTLOADER_APP_TEST`
:ref:`CONFIG_BOOTLOADER_NUM_PIN_APP_TEST` - 设置引导测试分区的 GPIO 管脚编号,该 GPIO 会被配置为输入模式,并且会使能内部上拉电阻。若想触发测试固件,该 GPIO 必须在芯片复位时拉低。设备重启时如果该 GPIO 没有被激活(即处于高电平状态),那么会加载常规配置的应用程序(可能位于工厂分区或者 OTA 分区)。
:ref:`CONFIG_BOOTLOADER_HOLD_TIME_GPIO` - 设置进入重置或测试模式所需要的保持时间(默认为 5 秒。设备复位后GPIO 必须在这段时间内持续保持低电平,然后才会执行出厂重置或引导测试分区。
自定义引导程序
--------------
用户可以重写当前的引导加载程序,具体做法是,复制 `/esp-idf/components/bootloader` 文件夹到项目目录中,然后编辑 `/your_project/components/bootloader/subproject/ain/bootloader_main.c` 文件。
在引导加载程序的代码中,用户不可以使用驱动和其他组件提供的函数,如果确实需要,请将该功能的实现部分放在 bootloader 目录中(注意,这会增加引导程序的大小)。监视生成的引导程序的大小是有必要的,因为它可能会与内存中的分区表发生重叠而损坏固件。目前,引导程序被限制在了分区表之前的区域(分区表位于 `0x8000` 地址处)。

Wyświetl plik

@ -18,7 +18,7 @@ API 指南
Thread Local Storage <thread-local-storage>
High Level Interrupts <hlinterrupts>
JTAG 调试 <jtag-debugging/index>
Bootloader <bootloader>
引导加载程序 <bootloader>
分区表 <partition-tables>
Secure Boot <../security/secure-boot>
ULP 协处理器 <ulp>

Wyświetl plik

@ -30,8 +30,28 @@ function(__kconfig_init)
"on the PATH, or an MSYS2 version of gcc on the PATH to build mconf-idf. "
"Consult the setup docs for ESP-IDF on Windows.")
endif()
elseif(WINPTY)
set(MCONF "\"${WINPTY}\" \"${MCONF}\"")
else()
execute_process(COMMAND "${MCONF}" -v
RESULT_VARIABLE mconf_res
OUTPUT_VARIABLE mconf_out
ERROR_VARIABLE mconf_err)
if(${mconf_res})
message(WARNING "Failed to detect version of mconf-idf. Return code was ${mconf_res}.")
else()
string(STRIP "${mconf_out}" mconf_out)
set(mconf_expected_ver "mconf-v4.6.0.0-idf-20190628-win32")
if(NOT ${mconf_out} STREQUAL "mconf-idf version ${mconf_expected_ver}")
message(WARNING "Unexpected ${mconf_out}. Expected ${mconf_expected_ver}. "
"Please check the ESP-IDF Getting Started guide for version "
"${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}.${IDF_VERSION_PATCH} "
"to correct this issue")
else()
message(STATUS "${mconf_out}") # prints: mconf-idf version ....
endif()
endif()
if(WINPTY)
set(MCONF "\"${WINPTY}\" \"${MCONF}\"")
endif()
endif()
endif()

Wyświetl plik

@ -490,7 +490,7 @@ class Monitor(object):
item = self.cmd_queue.get_nowait()
except queue.Empty:
try:
item = self.event_queue.get(False, 0.001)
item = self.event_queue.get(True, 0.03)
except queue.Empty:
continue

Wyświetl plik

@ -74,12 +74,14 @@ def run_server(kconfig, sdkconfig, sdkconfig_rename, default_version=MAX_PROTOCO
sdkconfig_renames = [sdkconfig_rename] if sdkconfig_rename else []
sdkconfig_renames += os.environ.get("COMPONENT_SDKCONFIG_RENAMES", "").split()
deprecated_options = confgen.DeprecatedOptions(config.config_prefix, path_rename_files=sdkconfig_renames)
with tempfile.NamedTemporaryFile(mode='w+b') as f_o:
f_o = tempfile.NamedTemporaryFile(mode='w+b', delete=False)
try:
with open(sdkconfig, mode='rb') as f_i:
f_o.write(f_i.read())
f_o.flush()
f_o.seek(0)
f_o.close() # need to close as DeprecatedOptions will reopen, and Windows only allows one open file
deprecated_options.replace(sdkconfig_in=f_o.name, sdkconfig_out=sdkconfig)
finally:
os.unlink(f_o.name)
config.load_config(sdkconfig)
print("Server running, waiting for requests on stdin...", file=sys.stderr)