Update ESP-IDF libs for 2.0.6 (#7570)

This commit is contained in:
Me No Dev 2022-12-10 03:55:38 +02:00 committed by GitHub
parent 5b61930bb7
commit deca15076f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
181 changed files with 6074 additions and 304 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -45,15 +45,23 @@
#define CONFIG_ESPTOOLPY_MONITOR_BAUD 115200
#define CONFIG_PARTITION_TABLE_SINGLE_APP 1
#define CONFIG_PARTITION_TABLE_CUSTOM_FILENAME "partitions.csv"
#define CONFIG_PARTITION_TABLE_FILENAME "partitions_singleapp.csv"
#define CONFIG_PARTITION_TABLE_FILENAME "partitions_singleapp_coredump.csv"
#define CONFIG_PARTITION_TABLE_OFFSET 0x8000
#define CONFIG_PARTITION_TABLE_MD5 1
#define CONFIG_LIB_BUILDER_FLASHMODE "dio"
#define CONFIG_LIB_BUILDER_FLASHFREQ "80m"
#define CONFIG_LIB_BUILDER_COMPILE 1
#define CONFIG_ESP_RMAKER_ASSISTED_CLAIM 1
#define CONFIG_ESP_RMAKER_CLAIM_TYPE 2
#define CONFIG_ESP_RMAKER_MQTT_HOST "a1p72mufdu6064-ats.iot.us-east-1.amazonaws.com"
#define CONFIG_ESP_RMAKER_MQTT_USE_BASIC_INGEST_TOPICS 1
#define CONFIG_ESP_RMAKER_MQTT_ENABLE_BUDGETING 1
#define CONFIG_ESP_RMAKER_MQTT_DEFAULT_BUDGET 100
#define CONFIG_ESP_RMAKER_MQTT_MAX_BUDGET 1024
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_PERIOD 5
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_COUNT 1
#define CONFIG_ESP_RMAKER_MAX_PARAM_DATA_SIZE 1024
#define CONFIG_ESP_RMAKER_USER_ID_CHECK 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM_0 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM 0
#define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1
@ -347,12 +355,17 @@
#define CONFIG_ESP32_WIFI_MGMT_SBUF_NUM 32
#define CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE 1
#define CONFIG_ESP_WIFI_SOFTAP_SUPPORT 1
#define CONFIG_ESP_COREDUMP_ENABLE_TO_NONE 1
#define CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH 1
#define CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF 1
#define CONFIG_ESP_COREDUMP_CHECKSUM_CRC32 1
#define CONFIG_ESP_COREDUMP_CHECK_BOOT 1
#define CONFIG_ESP_COREDUMP_ENABLE 1
#define CONFIG_ESP_COREDUMP_MAX_TASKS_NUM 64
#define CONFIG_FATFS_CODEPAGE_850 1
#define CONFIG_FATFS_CODEPAGE 850
#define CONFIG_FATFS_LFN_STACK 1
#define CONFIG_FATFS_MAX_LFN 255
#define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1
#define CONFIG_FATFS_API_ENCODING_UTF_8 1
#define CONFIG_FATFS_FS_LOCK 0
#define CONFIG_FATFS_TIMEOUT_MS 10000
#define CONFIG_FATFS_PER_FILE_CACHE 1
@ -393,7 +406,7 @@
#define CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS 1
#define CONFIG_FREERTOS_ASSERT_FAIL_ABORT 1
#define CONFIG_FREERTOS_IDLE_TASK_STACKSIZE 1024
#define CONFIG_FREERTOS_ISR_STACKSIZE 1536
#define CONFIG_FREERTOS_ISR_STACKSIZE 2096
#define CONFIG_FREERTOS_MAX_TASK_NAME_LEN 16
#define CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION 1
#define CONFIG_FREERTOS_TIMER_TASK_PRIORITY 1
@ -614,6 +627,25 @@
#define CONFIG_ESP_RMAKER_DEF_TIMEZONE "Asia/Shanghai"
#define CONFIG_ESP_RMAKER_SNTP_SERVER_NAME "pool.ntp.org"
#define CONFIG_ESP_RMAKER_MAX_COMMANDS 10
#define CONFIG_DIAG_LOG_MSG_ARG_FORMAT_TLV 1
#define CONFIG_DIAG_LOG_MSG_ARG_MAX_SIZE 64
#define CONFIG_DIAG_LOG_DROP_WIFI_LOGS 1
#define CONFIG_DIAG_ENABLE_METRICS 1
#define CONFIG_DIAG_METRICS_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_HEAP_METRICS 1
#define CONFIG_DIAG_ENABLE_WIFI_METRICS 1
#define CONFIG_DIAG_ENABLE_VARIABLES 1
#define CONFIG_DIAG_VARIABLES_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_NETWORK_VARIABLES 1
#define CONFIG_ESP_INSIGHTS_ENABLED 1
#define CONFIG_ESP_INSIGHTS_COREDUMP_ENABLE 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS_HOST "https://client.insights.espressif.com"
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MIN_INTERVAL_SEC 60
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MAX_INTERVAL_SEC 240
#define CONFIG_RTC_STORE_DATA_SIZE 3072
#define CONFIG_RTC_STORE_CRITICAL_DATA_SIZE 2048
#define CONFIG_RTC_STORE_REPORTING_WATERMARK_PERCENT 80
#define CONFIG_DSP_OPTIMIZATIONS_SUPPORTED 1
#define CONFIG_DSP_OPTIMIZED 1
#define CONFIG_DSP_OPTIMIZATION 1
@ -680,8 +712,11 @@
#define CONFIG_DUPLICATE_SCAN_CACHE_SIZE CONFIG_BTDM_SCAN_DUPL_CACHE_SIZE
#define CONFIG_ESP32S2_PANIC_PRINT_REBOOT CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT
#define CONFIG_ESP32_APPTRACE_DEST_NONE CONFIG_APPTRACE_DEST_NONE
#define CONFIG_ESP32_COREDUMP_CHECKSUM_CRC32 CONFIG_ESP_COREDUMP_CHECKSUM_CRC32
#define CONFIG_ESP32_COREDUMP_DATA_FORMAT_ELF CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF
#define CONFIG_ESP32_CORE_DUMP_MAX_TASKS_NUM CONFIG_ESP_COREDUMP_MAX_TASKS_NUM
#define CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY
#define CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE CONFIG_ESP_COREDUMP_ENABLE_TO_NONE
#define CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH
#define CONFIG_ESP32_PANIC_PRINT_REBOOT CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT
#define CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE
#define CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER CONFIG_ESP_PHY_MAX_WIFI_TX_POWER
@ -762,5 +797,5 @@
#define CONFIG_ULP_COPROC_ENABLED CONFIG_ESP32_ULP_COPROC_ENABLED
#define CONFIG_ULP_COPROC_RESERVE_MEM CONFIG_ESP32_ULP_COPROC_RESERVE_MEM
#define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS
#define CONFIG_ARDUINO_IDF_COMMIT ""
#define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4"
#define CONFIG_ARDUINO_IDF_COMMIT "6407ecb3f8"
#define CONFIG_ARDUINO_IDF_BRANCH "v4.4.3"

View file

@ -45,15 +45,23 @@
#define CONFIG_ESPTOOLPY_MONITOR_BAUD 115200
#define CONFIG_PARTITION_TABLE_SINGLE_APP 1
#define CONFIG_PARTITION_TABLE_CUSTOM_FILENAME "partitions.csv"
#define CONFIG_PARTITION_TABLE_FILENAME "partitions_singleapp.csv"
#define CONFIG_PARTITION_TABLE_FILENAME "partitions_singleapp_coredump.csv"
#define CONFIG_PARTITION_TABLE_OFFSET 0x8000
#define CONFIG_PARTITION_TABLE_MD5 1
#define CONFIG_LIB_BUILDER_FLASHMODE "dout"
#define CONFIG_LIB_BUILDER_FLASHFREQ "80m"
#define CONFIG_LIB_BUILDER_COMPILE 1
#define CONFIG_ESP_RMAKER_ASSISTED_CLAIM 1
#define CONFIG_ESP_RMAKER_CLAIM_TYPE 2
#define CONFIG_ESP_RMAKER_MQTT_HOST "a1p72mufdu6064-ats.iot.us-east-1.amazonaws.com"
#define CONFIG_ESP_RMAKER_MQTT_USE_BASIC_INGEST_TOPICS 1
#define CONFIG_ESP_RMAKER_MQTT_ENABLE_BUDGETING 1
#define CONFIG_ESP_RMAKER_MQTT_DEFAULT_BUDGET 100
#define CONFIG_ESP_RMAKER_MQTT_MAX_BUDGET 1024
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_PERIOD 5
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_COUNT 1
#define CONFIG_ESP_RMAKER_MAX_PARAM_DATA_SIZE 1024
#define CONFIG_ESP_RMAKER_USER_ID_CHECK 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM_0 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM 0
#define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1
@ -347,12 +355,17 @@
#define CONFIG_ESP32_WIFI_MGMT_SBUF_NUM 32
#define CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE 1
#define CONFIG_ESP_WIFI_SOFTAP_SUPPORT 1
#define CONFIG_ESP_COREDUMP_ENABLE_TO_NONE 1
#define CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH 1
#define CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF 1
#define CONFIG_ESP_COREDUMP_CHECKSUM_CRC32 1
#define CONFIG_ESP_COREDUMP_CHECK_BOOT 1
#define CONFIG_ESP_COREDUMP_ENABLE 1
#define CONFIG_ESP_COREDUMP_MAX_TASKS_NUM 64
#define CONFIG_FATFS_CODEPAGE_850 1
#define CONFIG_FATFS_CODEPAGE 850
#define CONFIG_FATFS_LFN_STACK 1
#define CONFIG_FATFS_MAX_LFN 255
#define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1
#define CONFIG_FATFS_API_ENCODING_UTF_8 1
#define CONFIG_FATFS_FS_LOCK 0
#define CONFIG_FATFS_TIMEOUT_MS 10000
#define CONFIG_FATFS_PER_FILE_CACHE 1
@ -393,7 +406,7 @@
#define CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS 1
#define CONFIG_FREERTOS_ASSERT_FAIL_ABORT 1
#define CONFIG_FREERTOS_IDLE_TASK_STACKSIZE 1024
#define CONFIG_FREERTOS_ISR_STACKSIZE 1536
#define CONFIG_FREERTOS_ISR_STACKSIZE 2096
#define CONFIG_FREERTOS_MAX_TASK_NAME_LEN 16
#define CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION 1
#define CONFIG_FREERTOS_TIMER_TASK_PRIORITY 1
@ -614,6 +627,25 @@
#define CONFIG_ESP_RMAKER_DEF_TIMEZONE "Asia/Shanghai"
#define CONFIG_ESP_RMAKER_SNTP_SERVER_NAME "pool.ntp.org"
#define CONFIG_ESP_RMAKER_MAX_COMMANDS 10
#define CONFIG_DIAG_LOG_MSG_ARG_FORMAT_TLV 1
#define CONFIG_DIAG_LOG_MSG_ARG_MAX_SIZE 64
#define CONFIG_DIAG_LOG_DROP_WIFI_LOGS 1
#define CONFIG_DIAG_ENABLE_METRICS 1
#define CONFIG_DIAG_METRICS_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_HEAP_METRICS 1
#define CONFIG_DIAG_ENABLE_WIFI_METRICS 1
#define CONFIG_DIAG_ENABLE_VARIABLES 1
#define CONFIG_DIAG_VARIABLES_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_NETWORK_VARIABLES 1
#define CONFIG_ESP_INSIGHTS_ENABLED 1
#define CONFIG_ESP_INSIGHTS_COREDUMP_ENABLE 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS_HOST "https://client.insights.espressif.com"
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MIN_INTERVAL_SEC 60
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MAX_INTERVAL_SEC 240
#define CONFIG_RTC_STORE_DATA_SIZE 3072
#define CONFIG_RTC_STORE_CRITICAL_DATA_SIZE 2048
#define CONFIG_RTC_STORE_REPORTING_WATERMARK_PERCENT 80
#define CONFIG_DSP_OPTIMIZATIONS_SUPPORTED 1
#define CONFIG_DSP_OPTIMIZED 1
#define CONFIG_DSP_OPTIMIZATION 1
@ -680,8 +712,11 @@
#define CONFIG_DUPLICATE_SCAN_CACHE_SIZE CONFIG_BTDM_SCAN_DUPL_CACHE_SIZE
#define CONFIG_ESP32S2_PANIC_PRINT_REBOOT CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT
#define CONFIG_ESP32_APPTRACE_DEST_NONE CONFIG_APPTRACE_DEST_NONE
#define CONFIG_ESP32_COREDUMP_CHECKSUM_CRC32 CONFIG_ESP_COREDUMP_CHECKSUM_CRC32
#define CONFIG_ESP32_COREDUMP_DATA_FORMAT_ELF CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF
#define CONFIG_ESP32_CORE_DUMP_MAX_TASKS_NUM CONFIG_ESP_COREDUMP_MAX_TASKS_NUM
#define CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY
#define CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE CONFIG_ESP_COREDUMP_ENABLE_TO_NONE
#define CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH
#define CONFIG_ESP32_PANIC_PRINT_REBOOT CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT
#define CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE
#define CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER CONFIG_ESP_PHY_MAX_WIFI_TX_POWER
@ -762,5 +797,5 @@
#define CONFIG_ULP_COPROC_ENABLED CONFIG_ESP32_ULP_COPROC_ENABLED
#define CONFIG_ULP_COPROC_RESERVE_MEM CONFIG_ESP32_ULP_COPROC_RESERVE_MEM
#define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS
#define CONFIG_ARDUINO_IDF_COMMIT ""
#define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4"
#define CONFIG_ARDUINO_IDF_COMMIT "6407ecb3f8"
#define CONFIG_ARDUINO_IDF_BRANCH "v4.4.3"

View file

@ -8,6 +8,7 @@
//SR: Speech Recognition
//afe_sr/AFE_SR: the audio front-end for speech recognition
//Set AFE_SR mode
typedef enum {
SR_MODE_LOW_COST = 0,
@ -34,6 +35,26 @@ typedef struct {
int sample_rate; // sample rate of audio
} afe_pcm_config_t;
/**
* @brief Function to get the debug audio data
*
* @param data The debug audio data which don't be modify. It should be copied away as soon as possible that avoid blocking for too long.
* @param data_size The number of bytes of data.
* @returns
*/
typedef void (*afe_debug_hook_callback_t)(const int16_t* data, int data_size);
typedef enum {
AFE_DEBUG_HOOK_MASE_TASK_IN = 0, // To get the input data of mase task
AFE_DEBUG_HOOK_FETCH_TASK_IN = 1, // To get the input data of fetch task
AFE_DEBUG_HOOK_MAX = 2
} afe_debug_hook_type_t;
typedef struct {
afe_debug_hook_type_t hook_type; // debug type of hook
afe_debug_hook_callback_t hook_callback; // callback function which transfer debug audio data
} afe_debug_hook_t;
typedef struct {
bool aec_init;
bool se_init;
@ -52,6 +73,8 @@ typedef struct {
afe_memory_alloc_mode_t memory_alloc_mode;
afe_mn_peak_agc_mode_t agc_mode; // The agc mode for ASR
afe_pcm_config_t pcm_config; // Config the channel num of original data which is fed to the afe feed function.
bool debug_init;
afe_debug_hook_t debug_hook[AFE_DEBUG_HOOK_MAX];
} afe_config_t;
@ -77,6 +100,8 @@ typedef struct {
.pcm_config.mic_num = 1, \
.pcm_config.ref_num = 1, \
.pcm_config.sample_rate = 16000, \
.debug_init = false, \
.debug_hook = {{AFE_DEBUG_HOOK_MASE_TASK_IN, NULL}, {AFE_DEBUG_HOOK_FETCH_TASK_IN, NULL}}, \
}
#elif CONFIG_IDF_TARGET_ESP32S3
#define AFE_CONFIG_DEFAULT() { \
@ -100,5 +125,7 @@ typedef struct {
.pcm_config.mic_num = 2, \
.pcm_config.ref_num = 1, \
.pcm_config.sample_rate = 16000, \
.debug_init = false, \
.debug_hook = {{AFE_DEBUG_HOOK_MASE_TASK_IN, NULL}, {AFE_DEBUG_HOOK_FETCH_TASK_IN, NULL}}, \
}
#endif

View file

@ -25,9 +25,9 @@ typedef struct afe_fetch_result_t
{
int16_t *data; // the data of audio.
int data_size; // the size of data. The unit is byte.
int wakeup_state; // the value is afe_wakeup_state_t
wakenet_state_t wakeup_state; // the value is wakenet_state_t
int wake_word_index; // if the wake word is detected. It will store the wake word index which start from 1.
int vad_state; // the value is afe_vad_state_t
afe_vad_state_t vad_state; // the value is afe_vad_state_t
int trigger_channel_id; // the channel index of output
int wake_word_length; // the length of wake word. It's unit is the number of samples.
int ret_value; // the return state of fetch function
@ -101,6 +101,14 @@ typedef int (*esp_afe_sr_iface_op_feed_t)(esp_afe_sr_data_t *afe, const int16_t*
*/
typedef afe_fetch_result_t* (*esp_afe_sr_iface_op_fetch_t)(esp_afe_sr_data_t *afe);
/**
* @brief reset ringbuf of AFE.
*
* @param afe The AFE_SR object to query
* @return -1: fail, 0: success
*/
typedef int (*esp_afe_sr_iface_op_reset_buffer_t)(esp_afe_sr_data_t *afe);
/**
* @brief Initial wakenet and wake words coefficient, or reset wakenet and wake words coefficient
* when wakenet has been initialized.
@ -174,6 +182,7 @@ typedef struct {
esp_afe_sr_iface_op_create_from_config_t create_from_config;
esp_afe_sr_iface_op_feed_t feed;
esp_afe_sr_iface_op_fetch_t fetch;
esp_afe_sr_iface_op_reset_buffer_t reset_buffer;
esp_afe_sr_iface_op_get_samp_chunksize_t get_feed_chunksize;
esp_afe_sr_iface_op_get_samp_chunksize_t get_fetch_chunksize;
esp_afe_sr_iface_op_get_total_channel_num_t get_total_channel_num;

View file

@ -0,0 +1,296 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <inttypes.h>
#include <stdbool.h>
#include <esp_err.h>
#include <esp_log.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Callback to write log to diagnostics storage
*/
typedef esp_err_t (*esp_diag_log_write_cb_t)(void *data, size_t len, void *priv_data);
/**
* @brief Diagnostics log configurations
*/
typedef struct {
esp_diag_log_write_cb_t write_cb; /*!< Callback function to write diagnostics data */
void *cb_arg; /*!< User data to pass in callback function */
} esp_diag_log_config_t;
/**
* @brief Supported log types in diagnostics
*/
typedef enum {
ESP_DIAG_LOG_TYPE_ERROR = 1 << 0, /*!< Diagnostics log type error */
ESP_DIAG_LOG_TYPE_WARNING = 1 << 1, /*!< Diagnostics log type warning */
ESP_DIAG_LOG_TYPE_EVENT = 1 << 2, /*!< Diagnostics log type event */
} esp_diag_log_type_t;
/**
* @brief Log argument data types
*/
typedef enum {
ARG_TYPE_CHAR, /*!< Argument type (char) */
ARG_TYPE_SHORT, /*!< Argument type (short) */
ARG_TYPE_INT, /*!< Argument type (int) */
ARG_TYPE_L, /*!< Argument type (long) */
ARG_TYPE_LL, /*!< Argument type (long long) */
ARG_TYPE_INTMAX, /*!< Argument type (intmax_t) */
ARG_TYPE_PTRDIFF, /*!< Argument type (ptrdiff_t) */
ARG_TYPE_UCHAR, /*!< Argument type (unsigned char) */
ARG_TYPE_USHORT, /*!< Argument type (unsigned short) */
ARG_TYPE_UINT, /*!< Argument type (unsigned int) */
ARG_TYPE_UL, /*!< Argument type (unsigned long) */
ARG_TYPE_ULL, /*!< Argument type (unsigned long long) */
ARG_TYPE_UINTMAX, /*!< Argument type (uintmax_t) */
ARG_TYPE_SIZE, /*!< Argument type (size_t) */
ARG_TYPE_DOUBLE, /*!< Argument type (double) */
ARG_TYPE_LDOUBLE, /*!< Argument type (long double) */
ARG_TYPE_STR, /*!< Argument type (char *) */
ARG_TYPE_INVALID, /*!< Argument type invalid */
} esp_diag_arg_type_t;
/**
* @brief Log argument data value
*/
typedef union {
char c; /*!< Value of type signed char */
short s; /*!< Value of type signed short */
int i; /*!< Value of type signed integer */
long l; /*!< Value of type signed long */
long long ll; /*!< Value of type signed long long */
intmax_t imx; /*!< Value of type intmax_t */
ptrdiff_t ptrdiff; /*!< Value of type ptrdiff_t */
unsigned char uc; /*!< Value of type unsigned char */
unsigned short us; /*!< Value of type unsigned short */
unsigned int u; /*!< Value of type unsigned integer */
unsigned long ul; /*!< Value of type unsigned long */
unsigned long long ull; /*!< Value of type unsigned long long */
uintmax_t umx; /*!< Value of type uintmax_t */
size_t sz; /*!< Value of type size_t */
double d; /*!< Value of type double */
long double ld; /*!< Value of type long double */
char *str; /*!< value of type string */
} esp_diag_arg_value_t;
/**
* @brief Diagnostics data point type
*/
typedef enum {
ESP_DIAG_DATA_PT_METRICS, /*!< Data point of type metrics */
ESP_DIAG_DATA_PT_VARIABLE, /*!< Data point of type variable */
} esp_diag_data_pt_type_t;
/**
* @brief Diagnostics data types
*/
typedef enum {
ESP_DIAG_DATA_TYPE_BOOL, /*!< Data type boolean */
ESP_DIAG_DATA_TYPE_INT, /*!< Data type integer */
ESP_DIAG_DATA_TYPE_UINT, /*!< Data type unsigned integer */
ESP_DIAG_DATA_TYPE_FLOAT, /*!< Data type float */
ESP_DIAG_DATA_TYPE_STR, /*!< Data type string */
ESP_DIAG_DATA_TYPE_IPv4, /*!< Data type IPv4 address */
ESP_DIAG_DATA_TYPE_MAC, /*!< Data type MAC address */
} esp_diag_data_type_t;
/**
* @brief Diagnostics log data structure
*/
typedef struct {
esp_diag_log_type_t type; /*!< Type of diagnostics log */
uint32_t pc; /*!< Program Counter */
uint64_t timestamp; /*!< If NTP sync enabled then POSIX time,
otherwise relative time since bootup in microseconds */
char tag[16]; /*!< Tag of log message */
void *msg_ptr; /*!< Address of err/warn/event message in rodata */
uint8_t msg_args[CONFIG_DIAG_LOG_MSG_ARG_MAX_SIZE]; /*!< Arguments of log message */
uint8_t msg_args_len; /*!< Length of argument */
char task_name[CONFIG_FREERTOS_MAX_TASK_NAME_LEN]; /*!< Task name */
} esp_diag_log_data_t;
/**
* @brief Device information structure
*/
typedef struct {
uint32_t chip_model; /*!< Chip model */
uint32_t chip_rev; /*!< Chip revision */
uint32_t reset_reason; /*!< Reset reason */
char app_version[32]; /*!< Application version */
char project_name[32]; /*!< Project name */
char app_elf_sha256[CONFIG_APP_RETRIEVE_LEN_ELF_SHA + 1]; /*!< SHA256 of application elf */
} esp_diag_device_info_t;
/**
* @brief Task backtrace structure
*/
typedef struct {
uint32_t bt[16]; /*!< Backtrace (array of PC) */
uint32_t depth; /*!< Number of backtrace entries */
bool corrupted; /*!< Status flag for backtrace is corrupt or not */
} esp_diag_task_bt_t;
/**
* @brief Task information structure
*/
typedef struct {
char name[CONFIG_FREERTOS_MAX_TASK_NAME_LEN]; /*!< Task name */
uint32_t state; /*!< Task state */
uint32_t high_watermark; /*!< Task high watermark */
#ifndef CONFIG_IDF_TARGET_ARCH_RISCV
esp_diag_task_bt_t bt_info; /*!< Backtrace of the task */
#endif /* !CONFIG_IDF_TARGET_ARCH_RISCV */
} esp_diag_task_info_t;
/**
* @brief Structure for diagnostics data point
*/
typedef struct {
uint16_t type; /*!< Metrics or Variable */
uint16_t data_type; /*!< Data type */
char key[16]; /*!< Key */
uint64_t ts; /*!< Timestamp */
union {
bool b; /*!< Value for boolean data type */
int32_t i; /*!< Value for integer data type */
uint32_t u; /*!< Value for unsigned integer data type */
float f; /*!< Value for float data type */
uint32_t ipv4; /*!< Value for the IPv4 address */
uint8_t mac[6]; /*!< Value for the MAC address */
} value;
} esp_diag_data_pt_t;
/**
* @brief Structure for string data type diagnostics data point
*/
typedef struct {
uint16_t type; /*!< Metrics or Variable */
uint16_t data_type; /*!< Data type */
char key[16]; /*!< Key */
uint64_t ts; /*!< Timestamp */
union {
char str[32]; /*!< Value for string data type */
} value;
} esp_diag_str_data_pt_t;
/**
* @brief Initialize diagnostics log hook
*
* @param[in] config Pointer to a config structure of type \ref esp_diag_log_config_t
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_log_hook_init(esp_diag_log_config_t *config);
/**
* @brief Enable the diagnostics log hook for provided log type
*
* @param[in] type Log type to enable, can be the bitwise OR of types from \ref esp_diag_log_type_t
*/
void esp_diag_log_hook_enable(uint32_t type);
/**
* @brief Disable the diagnostics log hook for provided log type
*
* @param[in] type Log type to disable, can be the bitwise OR of types from \ref esp_diag_log_type_t
*
*/
void esp_diag_log_hook_disable(uint32_t type);
/**
* @brief Add diagnostics event
*
* @param[in] tag The tag of message
* @param[in] format Message format
* @param[in] ... Variable arguments
*
* @return ESP_OK if successful, appropriate error code otherwise.
*
* @note This function is not intended to be used directly, Instead, use macro \ref ESP_DIAG_EVENT
*/
esp_err_t esp_diag_log_event(const char *tag, const char *format, ...) __attribute__ ((format (printf, 2, 3)));
/**
* @brief Macro to add the custom event
*
* @param[in] tag tag of the event
* @param[in] format format of the event
* @param[in] ... Variable arguments
*/
#define ESP_DIAG_EVENT(tag, format, ...) \
{ \
esp_diag_log_event(tag, "EV (%"PRIu32") %s: " format, esp_log_timestamp(), tag, ##__VA_ARGS__); \
ESP_LOGI(tag, format, ##__VA_ARGS__); \
}
/**
* @brief Get the device information for diagnostics
*
* @param[out] device_info Pointer to device_info structure of type \ref esp_diag_device_info_t
*
* @return ESP_OK on success
* @return ESP_ERR_INVALID_ARG if device_info is NULL
*/
esp_err_t esp_diag_device_info_get(esp_diag_device_info_t *device_info);
/**
* @brief Get the timestamp
*
* This function returns POSIX time if NTP sync is enabled
* otherwise returns time since bootup in microseconds
*
* @return timestamp
*/
uint64_t esp_diag_timestamp_get(void);
/**
* @brief Get backtrace and some more details of all tasks in system
*
* @note On device backtrace parsing not available on RISC-V boards (ESP32C3)
*
* @param[out] tasks Array to store task info
* @param[in] size Size of array, If size is less than the number of tasks in system,
* then info of size tasks is filled in array
*
* @return Number of task info filled in array
*
* @note Allocate enough memory to store all tasks,
* Use uxTaskGetNumberOfTasks() to get number of tasks in system
*/
uint32_t esp_diag_task_snapshot_get(esp_diag_task_info_t *tasks, size_t size);
/**
* @brief Dump backtrace and some more details of all tasks
* in system to console using \ref ESP_DIAG_EVENT
*/
void esp_diag_task_snapshot_dump(void);
/**
* @brief Get CRC of diagnostics metadata
*
* @return crc
*/
uint32_t esp_diag_meta_crc_get(void);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,209 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <stdbool.h>
#include <esp_err.h>
#include <esp_diagnostics.h>
#ifdef __cplusplus
extern "C"
{
#endif
#if CONFIG_DIAG_ENABLE_METRICS
/**
* @brief Callback to write metrics data
*
* @param[in] tag Tag for metrics
* @param[in] data Metrics data
* @param[in] len Length of metrics data
* @param[in] cb_arg User data to pass in write callback
*/
typedef esp_err_t (*esp_diag_metrics_write_cb_t)(const char *tag, void *data, size_t len, void *cb_arg);
/**
* @brief Diagnostics metrics config structure
*/
typedef struct {
esp_diag_metrics_write_cb_t write_cb; /*!< Callback function to write diagnostics data */
void *cb_arg; /*!< User data to pass in callback function */
} esp_diag_metrics_config_t;
/**
* @brief Structure for diagnostics metrics metadata
*/
typedef struct {
const char *tag; /*!< Tag of metrics */
const char *key; /*!< Unique key for the metrics */
const char *label; /*!< Label for the metrics */
const char *path; /*!< Hierarchical path for the key, must be separated by '.' for more than one level,
eg: "wifi", "heap.internal", "heap.external" */
esp_diag_data_type_t type; /*!< Data type of metrics */
} esp_diag_metrics_meta_t;
/**
* @brief Initialize the diagnostics metrics
*
* @param[in] config Pointer to a config structure of type \ref esp_diag_metrics_config_t
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_init(esp_diag_metrics_config_t *config);
/**
* @brief Deinitialize the diagnostics metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_deinit(void);
/**
* @brief Register a metrics
*
* @param[in] tag Tag of metrics
* @param[in] key Unique key for the metrics
* @param[in] label Label for the metrics
* @param[in] path Hierarchical path for key, must be separated by '.' for more than one level
* @param[in] type Data type of metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_register(const char *tag,
const char *key,
const char *label,
const char *path,
esp_diag_data_type_t type);
/**
* @brief Unregister a diagnostics metrics
*
* @param[in] key Key for the metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_unregister(const char *key);
/**
* @brief Unregister all previously registered metrics
*
* @return ESP_OK if successful, qppropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_unregister_all(void);
/**
* @brief Get metadata for all metrics
*
* @param[out] len Length of the metrics meta data array
*
* @return array Array of metrics meta data
*/
const esp_diag_metrics_meta_t *esp_diag_metrics_meta_get_all(uint32_t *len);
/**
* @brief Print metadata for all metrics
*/
void esp_diag_metrics_meta_print_all(void);
/**
* @brief Add metrics to storage
*
* @param[in] data_type Data type of metrics \ref esp_diag_data_type_t
* @param[in] key Key of metrics
* @param[in] val Value of metrics
* @param[in] val_sz Size of val
* @param[in] ts Timestamp in microseconds, this should be the value at the time of data gathering
*
* @return ESP_OK if successful, appropriate error code otherwise.
*
* @note \ref esp_diag_timestamp_get() API can be used to get timestamp in mircoseconds.
*/
esp_err_t esp_diag_metrics_add(esp_diag_data_type_t data_type,
const char *key, const void *val,
size_t val_sz, uint64_t ts);
/**
* @brief Add the metrics of data type boolean
*
* @param[in] key Key of the metrics
* @param[in] b Value of the metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_add_bool(const char *key, bool b);
/**
* @brief Add the metrics of data type integer
*
* @param[in] key Key of the metrics
* @param[in] i Value of the metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_add_int(const char *key, int32_t i);
/**
* @brief Add the metrics of data type unsigned integer
*
* @param[in] key Key of the metrics
* @param[in] u Value of the metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_add_uint(const char *key, uint32_t u);
/**
* @brief Add the metrics of data type float
*
* @param[in] key Key of the metrics
* @param[in] f Value of the metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_add_float(const char *key, float f);
/**
* @brief Add the IPv4 address metrics
*
* @param[in] key Key of the metrics
* @param[in] ip IPv4 address
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_add_ipv4(const char *key, uint32_t ip);
/**
* @brief Add the MAC address metrics
*
* @param[in] key Key of the metrics
* @param[in] mac Array of length 6 i.e 6 octets of mac address
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_add_mac(const char *key, uint8_t *mac);
/**
* @brief Add the metrics of data type string
*
* @param[in] key Key of the metrics
* @param[in] str Value of the metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_add_str(const char *key, const char *str);
#endif /* CONFIG_DIAG_ENABLE_METRICS */
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,41 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#ifdef __cplusplus
extern "C"
{
#endif
#if CONFIG_DIAG_ENABLE_NETWORK_VARIABLES
/**
* @brief Initialize the network variables
*
* Below listed Wi-Fi and IP parameters are collected and reported to cloud on change.
* Wi-Fi connection status, BSSID, SSID, channel, authentication mode,
* Wi-Fi disconnection reason, IP address, netmask, and gateway.
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_network_variables_init(void);
/**
* @brief Deinitialize the network variables
*/
esp_err_t esp_diag_network_variables_deinit(void);
#endif /* CONFIG_DIAG_ENABLE_NETWORK_VARIABLES */
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,105 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#ifdef __cplusplus
extern "C"
{
#endif
#if CONFIG_DIAG_ENABLE_HEAP_METRICS
/**
* @brief Initialize the heap metrics
*
* Free heap, largest free block, and all time minimum free heap values are collected periodically.
* Parameters are collected for RAM in internal memory and external memory (if device has PSRAM).
*
* Default periodic interval is 30 seconds and can be changed with esp_diag_heap_metrics_reset_interval().
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_heap_metrics_init(void);
/**
* @brief Deinitialize the heap metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_heap_metrics_deinit(void);
/**
* @brief Reset the periodic interval
*
* By default, heap metrics are collected every 30 seconds, this function can be used to change the interval.
* If the interval is set to 0, heap metrics collection disabled.
*
* @param[in] period Period interval in seconds
*/
void esp_diag_heap_metrics_reset_interval(uint32_t period);
/**
* @brief Dumps the heap metrics and prints them to the console.
*
* This API collects and reports metrics value at any give point in time.
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_heap_metrics_dump(void);
#endif /* CONFIG_DIAG_ENABLE_HEAP_METRICS */
#if CONFIG_DIAG_ENABLE_WIFI_METRICS
/**
* @brief Initialize the wifi metrics
*
* Wi-Fi RSSI and minimum ever Wi-Fi RSSI values are collected periodically.
* Default periodic interval is 30 seconds and can be changed with esp_diag_wifi_metrics_reset_interval().
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_wifi_metrics_init(void);
/**
* @brief Deinitialize the wifi metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_wifi_metrics_deinit(void);
/**
* @brief Dumps the wifi metrics and prints them to the console.
*
* This API can be used to collect wifi metrics at any given point in time.
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_wifi_metrics_dump(void);
/**
* @brief Reset the periodic interval
*
* By default, wifi metrics are collected every 30 seconds, this function can be used to change the interval.
* If the interval is set to 0, wifi metrics collection disabled.
*
* @param[in] period Period interval in seconds
*/
void esp_diag_wifi_metrics_reset_interval(uint32_t period);
#endif /* CONFIG_DIAG_ENABLE_WIFI_METRICS */
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,210 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <stdbool.h>
#include <esp_err.h>
#include <esp_diagnostics.h>
#ifdef __cplusplus
extern "C"
{
#endif
#if CONFIG_DIAG_ENABLE_VARIABLES
/**
* @brief Callback to write variable's data
*
* @param[in] tag Tag for variable
* @param[in] data Data for variable
* @param[in] len Length of variable
* @param[in] cb_arg User data to pass in write callback
*/
typedef esp_err_t (*esp_diag_variable_write_cb_t)(const char *tag, void *data, size_t len, void *cb_arg);
/**
* @brief Diagnostics variable config structure
*/
typedef struct {
esp_diag_variable_write_cb_t write_cb; /*!< Callback function to write diagnostics data */
void *cb_arg; /*!< User data to pass in callback function */
} esp_diag_variable_config_t;
/**
* @brief Structure for diagnostics variable metadata
*/
typedef struct {
const char *tag; /*!< Tag of variable */
const char *key; /*!< Unique key for the variable */
const char *label; /*!< Label for the variable */
const char *path; /*!< Hierarchical path for the key, must be separated by '.' for more than one level,
eg: "wifi", "heap.internal", "heap.external" */
esp_diag_data_type_t type; /*!< Data type of variables */
} esp_diag_variable_meta_t;
/**
* @brief Initialize the diagnostics variable
*
* @param[in] config Pointer to a config structure of type \ref esp_diag_variable_config_t
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_init(esp_diag_variable_config_t *config);
/**
* @brief Deinitialize the diagnostics variables
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variables_deinit(void);
/**
* @brief Register a diagnostics variable
*
* @param[in] tag Tag of variable
* @param[in] key Unique key for the variable
* @param[in] label Label for the variable
* @param[in] path Hierarchical path for key, must be separated by '.' for more than one level
* @param[in] type Data type of variable
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_register(const char *tag,
const char *key,
const char *label,
const char *path,
esp_diag_data_type_t type);
/**
* @brief Unregister a diagnostics variable
*
* @param[in] key Key for the variable
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_unregister(const char *key);
/**
* @brief Unregister all previously registered variables
*
* @return ESP_OK if successful, qppropriate error code otherwise.
*/
esp_err_t esp_diag_variable_unregister_all(void);
/**
* @brief Get metadata for all variables
*
* @param[out] len Length of the variables meta data array
*
* @return array Array of variables meta data
*/
const esp_diag_variable_meta_t *esp_diag_variable_meta_get_all(uint32_t *len);
/**
* @brief Print metadata for all variables
*/
void esp_diag_variable_meta_print_all(void);
/**
* @brief Add variable to storage
*
* @param[in] data_type Data type of variable \ref esp_diag_data_type_t
* @param[in] key Key of variable
* @param[in] val Value of variable
* @param[in] val_sz Size of val
* @param[in] ts Timestamp in microseconds, this should be the value at the time of data gathering
*
* @return ESP_OK if successful, appropriate error code otherwise.
*
* @note \ref esp_diag_timestamp_get() API can be used to get timestamp in mircoseconds.
*/
esp_err_t esp_diag_variable_add(esp_diag_data_type_t data_type,
const char *key, const void *val,
size_t val_sz, uint64_t ts);
/**
* @brief Add the variable of data type boolean
*
* @param[in] key Key of the variable
* @param[in] b Value of the variable
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_add_bool(const char *key, bool b);
/**
* @brief Add the variable of data type integer
*
* @param[in] key Key of the variable
* @param[in] i Value of the variable
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_add_int(const char *key, int32_t i);
/**
* @brief Add the variable of data type unsigned integer
*
* @param[in] key Key of the variable
* @param[in] u Value of the variable
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_add_uint(const char *key, uint32_t u);
/**
* @brief Add the variable of data type float
*
* @param[in] key Key of the variable
* @param[in] f Value of the variable
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_add_float(const char *key, float f);
/**
* @brief Add the IPv4 address variable
*
* @param[in] key Key of the variable
* @param[in] ip IPv4 address
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_add_ipv4(const char *key, uint32_t ip);
/**
* @brief Add the MAC address variable
*
* @param[in] key Key of the variable
* @param[in] mac Array of length 6 i.e 6 octets of mac address
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_add_mac(const char *key, uint8_t *mac);
/**
* @brief Add the variable of data type string
*
* @param[in] key Key of the variable
* @param[in] str Value of the variable
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_add_str(const char *key, const char *str);
#endif /* CONFIG_DIAG_ENABLE_VARIABLES */
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,169 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <stdint.h>
#include <esp_err.h>
#include <esp_event_base.h>
#include <esp_diagnostics.h>
#ifdef __cplusplus
extern "C"
{
#endif
/**
* @brief Insights event base
*/
ESP_EVENT_DECLARE_BASE(INSIGHTS_EVENT);
/**
* @brief ESP Insights configuration
*/
typedef struct {
/** Log types to enable, bitwise OR the values from \ref esp_diag_log_type_t */
uint32_t log_type;
/** Node id for insights. If NULL then insights agent uses MAC address as node id */
const char *node_id;
/** Authentication key, valid only for https transport */
const char *auth_key;
/** Try to allocate large buffers in External RAM */
bool alloc_ext_ram;
} esp_insights_config_t;
/**
* @brief Insights events
*
* Transport layer emits events using default event loop, every transport
* event has event data of type \ref esp_insights_transport_event_data_t;
*/
typedef enum {
/** Asynchronous data send succeded. Event data contains the msg_id of the data. */
INSIGHTS_EVENT_TRANSPORT_SEND_SUCCESS,
/** Asynchronous data send failed. Event data contains the msg_id of the data. */
INSIGHTS_EVENT_TRANSPORT_SEND_FAILED,
/** Data received. Event data contains received data and data_len. */
INSIGHTS_EVENT_TRANSPORT_RECV,
} esp_insights_event_t;
/**
* @brief Insights transport event data
*/
typedef struct {
uint8_t *data; /*!< Data associated with the event */
size_t data_len; /*!< Length of the data for the event */
int msg_id; /*!< Message id */
} esp_insights_transport_event_data_t;
/**
* @brief Insights transport init callback prototype
*
* @param[in] userdata User data
*
* @return ESP_OK on success, appropriate error code otherwise.
*/
typedef esp_err_t(*esp_insights_transport_init_t)(void *userdata);
/**
* @brief Insights transport deinit callback prototype
*/
typedef void(*esp_insights_transport_deinit_t)(void);
/**
* @brief Insights transport connect callback prototype
*
* @return ESP_OK on success, appropriate error code otherwise.
*/
typedef esp_err_t(*esp_insights_transport_connect_t)(void);
/**
* @brief Insights transport disconnect callback prototype
*/
typedef void(*esp_insights_transport_disconnect_t)(void);
/**
* @brief Insights transport data send callback prototype
*
* @param[in] data Data to send
* @param[in] len Length of data
*
* @return msg_id Message_id of the sent data.
* On failure, -1
* On success, 0 if data send happens synchronously.
* On success, message-id(positive integer) if data send happened asynchronously.
*
* @note If data send happened asynchronously then appropriate events in \ref esp_insights_event_t must be emitted.
*/
typedef int(*esp_insights_transport_data_send_t)(void *data, size_t len);
/**
* @brief Insights transport configurations
*/
typedef struct {
/** Insights transport callback functions */
struct {
/** Transport init function */
esp_insights_transport_init_t init;
/** Transport deinit function */
esp_insights_transport_deinit_t deinit;
/** Transport connect function */
esp_insights_transport_connect_t connect;
/** Transport disconnect function */
esp_insights_transport_disconnect_t disconnect;
/** Function to send data */
esp_insights_transport_data_send_t data_send;
} callbacks;
/** User data */
void *userdata;
} esp_insights_transport_config_t;
/**
* @brief Initialize ESP Insights
*
* @param[in] config Configuration for ESP Insights.
*
* @return ESP_OK on success, appropriate error code otherwise
*/
esp_err_t esp_insights_init(esp_insights_config_t *config);
/**
* @brief Deinitialize ESP Insights
*/
void esp_insights_deinit(void);
/**
* @brief Register insights transport
*
* @param[in] config Configurations of type \ref esp_insights_transport_config_t
*
* @return ESP_OK on success, appropriate error code otherwise
*/
esp_err_t esp_insights_transport_register(esp_insights_transport_config_t *config);
/**
* @brief Unregister insights transport
*/
void esp_insights_transport_unregister(void);
/**
* @brief Read insights data from buffers and send it to the cloud
*
* Call to this function is asynchronous, it may take some time to send the data.
*
* @return ESP_OK on success, appropriate error code otherwise
*/
esp_err_t esp_insights_send_data(void);
#ifdef __cplusplus
}
#endif

View file

@ -8,10 +8,10 @@
extern "C" {
#endif
#define ESP_LITTLEFS_VERSION_NUMBER "1.5.0"
#define ESP_LITTLEFS_VERSION_NUMBER "1.5.1"
#define ESP_LITTLEFS_VERSION_MAJOR 1
#define ESP_LITTLEFS_VERSION_MINOR 5
#define ESP_LITTLEFS_VERSION_PATCH 0
#define ESP_LITTLEFS_VERSION_PATCH 1
/**
*Configuration structure for esp_vfs_littlefs_register.

View file

@ -22,7 +22,7 @@ extern "C"
#endif
esp_rmaker_mqtt_conn_params_t *esp_rmaker_mqtt_get_conn_params(void);
/** Initialize ESP RainMaker MQTT
*
* @param[in] config The MQTT configuration data
@ -32,6 +32,12 @@ esp_rmaker_mqtt_conn_params_t *esp_rmaker_mqtt_get_conn_params(void);
*/
esp_err_t esp_rmaker_mqtt_init(esp_rmaker_mqtt_conn_params_t *conn_params);
/* Deinitialize ESP RainMaker MQTT
*
* Call this function after MQTT has disconnected.
*/
void esp_rmaker_mqtt_deinit(void);
/** MQTT Connect
*
* Starts the connection attempts to the MQTT broker as per the configuration
@ -85,6 +91,15 @@ esp_err_t esp_rmaker_mqtt_subscribe(const char *topic, esp_rmaker_mqtt_subscribe
*/
esp_err_t esp_rmaker_mqtt_unsubscribe(const char *topic);
esp_err_t esp_rmaker_mqtt_setup(esp_rmaker_mqtt_config_t mqtt_config);
/** Creates appropriate MQTT Topic String based on CONFIG_ESP_RMAKER_MQTT_USE_BASIC_INGEST_TOPICS
* @param[out] buf Buffer to hold topic string
* @param[in] buf_size Size of buffer
* @param[in] topic_suffix MQTT Topic suffix
* @param[in] rule Basic Ingests Rule Name
*/
void esp_rmaker_create_mqtt_topic(char *buf, size_t buf_size, const char *topic_suffix, const char *rule);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,163 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <esp_err.h>
#include <esp_event.h>
#ifdef __cplusplus
extern "C" {
#endif
/** @cond **/
/**
* @brief RTC store event base
*/
ESP_EVENT_DECLARE_BASE(RTC_STORE_EVENT);
/** @endcond **/
/**
* @brief RTC store events
*/
typedef enum {
RTC_STORE_EVENT_CRITICAL_DATA_LOW_MEM, /*!< Critical data configured threshold crossed */
RTC_STORE_EVENT_CRITICAL_DATA_WRITE_FAIL, /*!< Critical data write failed */
RTC_STORE_EVENT_NON_CRITICAL_DATA_LOW_MEM, /*!< Non critical data configured threshold crossed */
RTC_STORE_EVENT_NON_CRITICAL_DATA_WRITE_FAIL, /*!< Non critical data write failed */
} rtc_store_event_t;
/**
* @brief Non critical data header
*/
typedef struct {
const char *dg; /*!< Data group of non critical data eg: heap, wifi, ip */
uint32_t len; /*!< Length of data */
} rtc_store_non_critical_data_hdr_t;
/**
* @brief Write critical data to the RTC storage
*
* @param[in] data Pointer to the data
* @param[in] len Length of data
*
* @return ESP_OK on success, appropriate error code otherwise.
*/
esp_err_t rtc_store_critical_data_write(void *data, size_t len);
/**
* @brief Read critical data from the RTC storage
*
* @param[out] size Number of bytes read
*
* @return Pointer to the data on success, otherwise NULL
*
* @note It is mandatory to call \ref rtc_store_critical_data_release_and_unlock() if \ref rtc_store_critical_data_read_and_lock() is successful.
* @note Please avoid adding \ref ESP_DIAG_EVENT(), error/warning logs using esp_log module in between rtc_store_critical_data_read_and_lock() and rtc_store_critical_data_release_and_unlock() API calls. It may lead to a deadlock.
*/
const void *rtc_store_critical_data_read_and_lock(size_t *size);
/**
* @brief Release the utilized data read using \ref rtc_store_critical_data_read_and_lock()
*
* This API releases the utilized data read using \ref rtc_store_critical_data_read_and_lock().
* Utilization may involve encoding data, sending data to the cloud, post processing or printing on the console, etc.
*
* @param[in] size Number of bytes to free. If all the data is utilized then pass the size returned by \ref rtc_store_critical_data_read_and_lock() or 0 if no data is utilized (e.g. sending to cloud failed).
*
* @return ESP_OK on success, appropriate error code otherwise.
*
* @note Please avoid adding \ref ESP_DIAG_EVENT(), error/warning logs using esp_log module in between rtc_store_critical_data_read_and_lock() and rtc_store_critical_data_release_and_unlock() API calls. It may lead to a deadlock.
*/
esp_err_t rtc_store_critical_data_release_and_unlock(size_t size);
/**
* @brief Release the size bytes critical data from RTC storage
*
* This API can be used to remove data from buffer when data is sent asynchronously.
*
* Consider data is read using \ref rtc_store_critical_data_read_and_lock() and sent to cloud asynchronously.
* Since status of data send is unknown, call \ref rtc_store_critical_data_release_and_unlock() with zero length.
* When acknowledgement for data send is received use this API with appropriate size to remove the data from the buffer.
*
* @param[in] size Number of bytes to free.
*
* @return ESP_OK on success, appropriate error code otherwise.
*/
esp_err_t rtc_store_critical_data_release(size_t size);
/**
* @brief Write non critical data to the RTC storage
*
* This API overwrites the data if non critical storage is full
*
* @param[in] dg Data group of data eg: heap, wifi, ip(Must be the string stored in RODATA)
* @param[in] data Pointer to non critical data
* @param[in] len Length of non critical data
*
* @return ESP_OK on success, appropriate error code otherwise.
*
* @note Data is stored in Type-Length-Value format
* Type(Data group) - 4 byte - Pointer to the string in rodata
* Length - 4 byte - Length of data
* Value - Length byte - Data
*/
esp_err_t rtc_store_non_critical_data_write(const char *dg, void *data, size_t len);
/**
* @brief Read non critical data from the RTC storage
*
* @param[out] size Number of bytes read
*
* @return Pointer to the data on success, otherwise NULL
*
* @note It is mandatory to call \ref rtc_store_non_critical_data_release_and_unlock() if \ref rtc_store_non_critical_data_read_and_lock() is successful.
*/
const void *rtc_store_non_critical_data_read_and_lock(size_t *size);
/**
* @brief Release the utilized data read using \ref rtc_store_non_critical_data_read_and_lock()
*
* This API releases the utilized data read using \ref rtc_store_non_critical_data_read_and_lock().
* Utilization may involve encoding data, sending data to the cloud, post processing or printing on the console, etc.
*
* @param[in] size Number of bytes to free. If all the data is utilized then pass the size returned by \ref rtc_store_non_critical_data_read_and_lock() or 0 if no data is utilized (e.g. sending to cloud failed).
*
* @return ESP_OK on success, appropriate error code otherwise.
*
*/
esp_err_t rtc_store_non_critical_data_release_and_unlock(size_t size);
/**
* @brief Release the size bytes non critical data from RTC storage
*
* @param[in] size Number of bytes to free.
*
* @return ESP_OK on success, appropriate error code otherwise.
*/
esp_err_t rtc_store_non_critical_data_release(size_t size);
/**
* @brief Initializes the RTC storage
*
* @return ESP_OK on success, appropriate error code otherwise
*/
esp_err_t rtc_store_init(void);
/**
* @brief Deinitializes the RTC storage
*/
void rtc_store_deinit(void);
#ifdef __cplusplus
}
#endif

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -46,15 +46,23 @@
#define CONFIG_ESPTOOLPY_MONITOR_BAUD 115200
#define CONFIG_PARTITION_TABLE_SINGLE_APP 1
#define CONFIG_PARTITION_TABLE_CUSTOM_FILENAME "partitions.csv"
#define CONFIG_PARTITION_TABLE_FILENAME "partitions_singleapp.csv"
#define CONFIG_PARTITION_TABLE_FILENAME "partitions_singleapp_coredump.csv"
#define CONFIG_PARTITION_TABLE_OFFSET 0x8000
#define CONFIG_PARTITION_TABLE_MD5 1
#define CONFIG_LIB_BUILDER_FLASHMODE "qio"
#define CONFIG_LIB_BUILDER_FLASHFREQ "80m"
#define CONFIG_LIB_BUILDER_COMPILE 1
#define CONFIG_ESP_RMAKER_ASSISTED_CLAIM 1
#define CONFIG_ESP_RMAKER_CLAIM_TYPE 2
#define CONFIG_ESP_RMAKER_MQTT_HOST "a1p72mufdu6064-ats.iot.us-east-1.amazonaws.com"
#define CONFIG_ESP_RMAKER_MQTT_USE_BASIC_INGEST_TOPICS 1
#define CONFIG_ESP_RMAKER_MQTT_ENABLE_BUDGETING 1
#define CONFIG_ESP_RMAKER_MQTT_DEFAULT_BUDGET 100
#define CONFIG_ESP_RMAKER_MQTT_MAX_BUDGET 1024
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_PERIOD 5
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_COUNT 1
#define CONFIG_ESP_RMAKER_MAX_PARAM_DATA_SIZE 1024
#define CONFIG_ESP_RMAKER_USER_ID_CHECK 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM_0 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM 0
#define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1
@ -347,12 +355,17 @@
#define CONFIG_ESP32_WIFI_MGMT_SBUF_NUM 32
#define CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE 1
#define CONFIG_ESP_WIFI_SOFTAP_SUPPORT 1
#define CONFIG_ESP_COREDUMP_ENABLE_TO_NONE 1
#define CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH 1
#define CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF 1
#define CONFIG_ESP_COREDUMP_CHECKSUM_CRC32 1
#define CONFIG_ESP_COREDUMP_CHECK_BOOT 1
#define CONFIG_ESP_COREDUMP_ENABLE 1
#define CONFIG_ESP_COREDUMP_MAX_TASKS_NUM 64
#define CONFIG_FATFS_CODEPAGE_850 1
#define CONFIG_FATFS_CODEPAGE 850
#define CONFIG_FATFS_LFN_STACK 1
#define CONFIG_FATFS_MAX_LFN 255
#define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1
#define CONFIG_FATFS_API_ENCODING_UTF_8 1
#define CONFIG_FATFS_FS_LOCK 0
#define CONFIG_FATFS_TIMEOUT_MS 10000
#define CONFIG_FATFS_PER_FILE_CACHE 1
@ -393,7 +406,7 @@
#define CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS 1
#define CONFIG_FREERTOS_ASSERT_FAIL_ABORT 1
#define CONFIG_FREERTOS_IDLE_TASK_STACKSIZE 1024
#define CONFIG_FREERTOS_ISR_STACKSIZE 1536
#define CONFIG_FREERTOS_ISR_STACKSIZE 2096
#define CONFIG_FREERTOS_MAX_TASK_NAME_LEN 16
#define CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION 1
#define CONFIG_FREERTOS_TIMER_TASK_PRIORITY 1
@ -614,6 +627,25 @@
#define CONFIG_ESP_RMAKER_DEF_TIMEZONE "Asia/Shanghai"
#define CONFIG_ESP_RMAKER_SNTP_SERVER_NAME "pool.ntp.org"
#define CONFIG_ESP_RMAKER_MAX_COMMANDS 10
#define CONFIG_DIAG_LOG_MSG_ARG_FORMAT_TLV 1
#define CONFIG_DIAG_LOG_MSG_ARG_MAX_SIZE 64
#define CONFIG_DIAG_LOG_DROP_WIFI_LOGS 1
#define CONFIG_DIAG_ENABLE_METRICS 1
#define CONFIG_DIAG_METRICS_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_HEAP_METRICS 1
#define CONFIG_DIAG_ENABLE_WIFI_METRICS 1
#define CONFIG_DIAG_ENABLE_VARIABLES 1
#define CONFIG_DIAG_VARIABLES_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_NETWORK_VARIABLES 1
#define CONFIG_ESP_INSIGHTS_ENABLED 1
#define CONFIG_ESP_INSIGHTS_COREDUMP_ENABLE 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS_HOST "https://client.insights.espressif.com"
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MIN_INTERVAL_SEC 60
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MAX_INTERVAL_SEC 240
#define CONFIG_RTC_STORE_DATA_SIZE 3072
#define CONFIG_RTC_STORE_CRITICAL_DATA_SIZE 2048
#define CONFIG_RTC_STORE_REPORTING_WATERMARK_PERCENT 80
#define CONFIG_DSP_OPTIMIZATIONS_SUPPORTED 1
#define CONFIG_DSP_OPTIMIZED 1
#define CONFIG_DSP_OPTIMIZATION 1
@ -680,8 +712,11 @@
#define CONFIG_DUPLICATE_SCAN_CACHE_SIZE CONFIG_BTDM_SCAN_DUPL_CACHE_SIZE
#define CONFIG_ESP32S2_PANIC_PRINT_REBOOT CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT
#define CONFIG_ESP32_APPTRACE_DEST_NONE CONFIG_APPTRACE_DEST_NONE
#define CONFIG_ESP32_COREDUMP_CHECKSUM_CRC32 CONFIG_ESP_COREDUMP_CHECKSUM_CRC32
#define CONFIG_ESP32_COREDUMP_DATA_FORMAT_ELF CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF
#define CONFIG_ESP32_CORE_DUMP_MAX_TASKS_NUM CONFIG_ESP_COREDUMP_MAX_TASKS_NUM
#define CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY
#define CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE CONFIG_ESP_COREDUMP_ENABLE_TO_NONE
#define CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH
#define CONFIG_ESP32_PANIC_PRINT_REBOOT CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT
#define CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE
#define CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER CONFIG_ESP_PHY_MAX_WIFI_TX_POWER
@ -762,5 +797,5 @@
#define CONFIG_ULP_COPROC_ENABLED CONFIG_ESP32_ULP_COPROC_ENABLED
#define CONFIG_ULP_COPROC_RESERVE_MEM CONFIG_ESP32_ULP_COPROC_RESERVE_MEM
#define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS
#define CONFIG_ARDUINO_IDF_COMMIT ""
#define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4"
#define CONFIG_ARDUINO_IDF_COMMIT "6407ecb3f8"
#define CONFIG_ARDUINO_IDF_BRANCH "v4.4.3"

View file

@ -46,15 +46,23 @@
#define CONFIG_ESPTOOLPY_MONITOR_BAUD 115200
#define CONFIG_PARTITION_TABLE_SINGLE_APP 1
#define CONFIG_PARTITION_TABLE_CUSTOM_FILENAME "partitions.csv"
#define CONFIG_PARTITION_TABLE_FILENAME "partitions_singleapp.csv"
#define CONFIG_PARTITION_TABLE_FILENAME "partitions_singleapp_coredump.csv"
#define CONFIG_PARTITION_TABLE_OFFSET 0x8000
#define CONFIG_PARTITION_TABLE_MD5 1
#define CONFIG_LIB_BUILDER_FLASHMODE "qout"
#define CONFIG_LIB_BUILDER_FLASHFREQ "80m"
#define CONFIG_LIB_BUILDER_COMPILE 1
#define CONFIG_ESP_RMAKER_ASSISTED_CLAIM 1
#define CONFIG_ESP_RMAKER_CLAIM_TYPE 2
#define CONFIG_ESP_RMAKER_MQTT_HOST "a1p72mufdu6064-ats.iot.us-east-1.amazonaws.com"
#define CONFIG_ESP_RMAKER_MQTT_USE_BASIC_INGEST_TOPICS 1
#define CONFIG_ESP_RMAKER_MQTT_ENABLE_BUDGETING 1
#define CONFIG_ESP_RMAKER_MQTT_DEFAULT_BUDGET 100
#define CONFIG_ESP_RMAKER_MQTT_MAX_BUDGET 1024
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_PERIOD 5
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_COUNT 1
#define CONFIG_ESP_RMAKER_MAX_PARAM_DATA_SIZE 1024
#define CONFIG_ESP_RMAKER_USER_ID_CHECK 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM_0 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM 0
#define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1
@ -347,12 +355,17 @@
#define CONFIG_ESP32_WIFI_MGMT_SBUF_NUM 32
#define CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE 1
#define CONFIG_ESP_WIFI_SOFTAP_SUPPORT 1
#define CONFIG_ESP_COREDUMP_ENABLE_TO_NONE 1
#define CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH 1
#define CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF 1
#define CONFIG_ESP_COREDUMP_CHECKSUM_CRC32 1
#define CONFIG_ESP_COREDUMP_CHECK_BOOT 1
#define CONFIG_ESP_COREDUMP_ENABLE 1
#define CONFIG_ESP_COREDUMP_MAX_TASKS_NUM 64
#define CONFIG_FATFS_CODEPAGE_850 1
#define CONFIG_FATFS_CODEPAGE 850
#define CONFIG_FATFS_LFN_STACK 1
#define CONFIG_FATFS_MAX_LFN 255
#define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1
#define CONFIG_FATFS_API_ENCODING_UTF_8 1
#define CONFIG_FATFS_FS_LOCK 0
#define CONFIG_FATFS_TIMEOUT_MS 10000
#define CONFIG_FATFS_PER_FILE_CACHE 1
@ -393,7 +406,7 @@
#define CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS 1
#define CONFIG_FREERTOS_ASSERT_FAIL_ABORT 1
#define CONFIG_FREERTOS_IDLE_TASK_STACKSIZE 1024
#define CONFIG_FREERTOS_ISR_STACKSIZE 1536
#define CONFIG_FREERTOS_ISR_STACKSIZE 2096
#define CONFIG_FREERTOS_MAX_TASK_NAME_LEN 16
#define CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION 1
#define CONFIG_FREERTOS_TIMER_TASK_PRIORITY 1
@ -614,6 +627,25 @@
#define CONFIG_ESP_RMAKER_DEF_TIMEZONE "Asia/Shanghai"
#define CONFIG_ESP_RMAKER_SNTP_SERVER_NAME "pool.ntp.org"
#define CONFIG_ESP_RMAKER_MAX_COMMANDS 10
#define CONFIG_DIAG_LOG_MSG_ARG_FORMAT_TLV 1
#define CONFIG_DIAG_LOG_MSG_ARG_MAX_SIZE 64
#define CONFIG_DIAG_LOG_DROP_WIFI_LOGS 1
#define CONFIG_DIAG_ENABLE_METRICS 1
#define CONFIG_DIAG_METRICS_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_HEAP_METRICS 1
#define CONFIG_DIAG_ENABLE_WIFI_METRICS 1
#define CONFIG_DIAG_ENABLE_VARIABLES 1
#define CONFIG_DIAG_VARIABLES_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_NETWORK_VARIABLES 1
#define CONFIG_ESP_INSIGHTS_ENABLED 1
#define CONFIG_ESP_INSIGHTS_COREDUMP_ENABLE 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS_HOST "https://client.insights.espressif.com"
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MIN_INTERVAL_SEC 60
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MAX_INTERVAL_SEC 240
#define CONFIG_RTC_STORE_DATA_SIZE 3072
#define CONFIG_RTC_STORE_CRITICAL_DATA_SIZE 2048
#define CONFIG_RTC_STORE_REPORTING_WATERMARK_PERCENT 80
#define CONFIG_DSP_OPTIMIZATIONS_SUPPORTED 1
#define CONFIG_DSP_OPTIMIZED 1
#define CONFIG_DSP_OPTIMIZATION 1
@ -680,8 +712,11 @@
#define CONFIG_DUPLICATE_SCAN_CACHE_SIZE CONFIG_BTDM_SCAN_DUPL_CACHE_SIZE
#define CONFIG_ESP32S2_PANIC_PRINT_REBOOT CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT
#define CONFIG_ESP32_APPTRACE_DEST_NONE CONFIG_APPTRACE_DEST_NONE
#define CONFIG_ESP32_COREDUMP_CHECKSUM_CRC32 CONFIG_ESP_COREDUMP_CHECKSUM_CRC32
#define CONFIG_ESP32_COREDUMP_DATA_FORMAT_ELF CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF
#define CONFIG_ESP32_CORE_DUMP_MAX_TASKS_NUM CONFIG_ESP_COREDUMP_MAX_TASKS_NUM
#define CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY
#define CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE CONFIG_ESP_COREDUMP_ENABLE_TO_NONE
#define CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH
#define CONFIG_ESP32_PANIC_PRINT_REBOOT CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT
#define CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE
#define CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER CONFIG_ESP_PHY_MAX_WIFI_TX_POWER
@ -762,5 +797,5 @@
#define CONFIG_ULP_COPROC_ENABLED CONFIG_ESP32_ULP_COPROC_ENABLED
#define CONFIG_ULP_COPROC_RESERVE_MEM CONFIG_ESP32_ULP_COPROC_RESERVE_MEM
#define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS
#define CONFIG_ARDUINO_IDF_COMMIT ""
#define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4"
#define CONFIG_ARDUINO_IDF_COMMIT "6407ecb3f8"
#define CONFIG_ARDUINO_IDF_BRANCH "v4.4.3"

View file

@ -129,13 +129,14 @@ CONFIG_PARTITION_TABLE_SINGLE_APP=y
# CONFIG_PARTITION_TABLE_TWO_OTA is not set
# CONFIG_PARTITION_TABLE_CUSTOM is not set
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp_coredump.csv"
CONFIG_PARTITION_TABLE_OFFSET=0x8000
CONFIG_PARTITION_TABLE_MD5=y
# end of Partition Table
CONFIG_LIB_BUILDER_FLASHMODE="qio"
CONFIG_LIB_BUILDER_FLASHFREQ="80m"
CONFIG_LIB_BUILDER_COMPILE=y
#
# ESP RainMaker Config
@ -144,9 +145,15 @@ CONFIG_LIB_BUILDER_FLASHFREQ="80m"
CONFIG_ESP_RMAKER_ASSISTED_CLAIM=y
CONFIG_ESP_RMAKER_CLAIM_TYPE=2
CONFIG_ESP_RMAKER_MQTT_HOST="a1p72mufdu6064-ats.iot.us-east-1.amazonaws.com"
CONFIG_ESP_RMAKER_MQTT_USE_BASIC_INGEST_TOPICS=y
CONFIG_ESP_RMAKER_MQTT_ENABLE_BUDGETING=y
CONFIG_ESP_RMAKER_MQTT_DEFAULT_BUDGET=100
CONFIG_ESP_RMAKER_MQTT_MAX_BUDGET=1024
CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_PERIOD=5
CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_COUNT=1
CONFIG_ESP_RMAKER_MAX_PARAM_DATA_SIZE=1024
# CONFIG_ESP_RMAKER_DISABLE_USER_MAPPING_PROV is not set
# CONFIG_ESP_RMAKER_USER_ID_CHECK is not set
CONFIG_ESP_RMAKER_USER_ID_CHECK=y
# CONFIG_RMAKER_NAME_PARAM_CB is not set
# CONFIG_ESP_RMAKER_LOCAL_CTRL_ENABLE is not set
CONFIG_ESP_RMAKER_CONSOLE_UART_NUM_0=y
@ -161,6 +168,7 @@ CONFIG_ESP_RMAKER_OTA_AUTOFETCH=y
CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD=0
# CONFIG_ESP_RMAKER_SKIP_COMMON_NAME_CHECK is not set
CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK=y
# CONFIG_ESP_RMAKER_SKIP_SECURE_VERSION_CHECK is not set
# CONFIG_ESP_RMAKER_SKIP_PROJECT_NAME_CHECK is not set
CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE=1024
CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD=90
@ -999,9 +1007,16 @@ CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y
#
# Core dump
#
# CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set
CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH=y
# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set
CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y
# CONFIG_ESP_COREDUMP_ENABLE_TO_NONE is not set
# CONFIG_ESP_COREDUMP_DATA_FORMAT_BIN is not set
CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF=y
CONFIG_ESP_COREDUMP_CHECKSUM_CRC32=y
# CONFIG_ESP_COREDUMP_CHECKSUM_SHA256 is not set
CONFIG_ESP_COREDUMP_CHECK_BOOT=y
CONFIG_ESP_COREDUMP_ENABLE=y
CONFIG_ESP_COREDUMP_MAX_TASKS_NUM=64
# end of Core dump
#
@ -1034,9 +1049,9 @@ CONFIG_FATFS_CODEPAGE=850
# CONFIG_FATFS_LFN_HEAP is not set
CONFIG_FATFS_LFN_STACK=y
CONFIG_FATFS_MAX_LFN=255
CONFIG_FATFS_API_ENCODING_ANSI_OEM=y
# CONFIG_FATFS_API_ENCODING_ANSI_OEM is not set
# CONFIG_FATFS_API_ENCODING_UTF_16 is not set
# CONFIG_FATFS_API_ENCODING_UTF_8 is not set
CONFIG_FATFS_API_ENCODING_UTF_8=y
CONFIG_FATFS_FS_LOCK=0
CONFIG_FATFS_TIMEOUT_MS=10000
CONFIG_FATFS_PER_FILE_CACHE=y
@ -1099,7 +1114,7 @@ CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y
# CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE is not set
# CONFIG_FREERTOS_ASSERT_DISABLE is not set
CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1024
CONFIG_FREERTOS_ISR_STACKSIZE=1536
CONFIG_FREERTOS_ISR_STACKSIZE=2096
# CONFIG_FREERTOS_LEGACY_HOOKS is not set
CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16
CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y
@ -1716,6 +1731,44 @@ CONFIG_ESP_RMAKER_MAX_COMMANDS=10
# CONFIG_WS2812_LED_ENABLE is not set
# end of WS2812 RGB LED
#
# Diagnostics
#
CONFIG_DIAG_LOG_MSG_ARG_FORMAT_TLV=y
# CONFIG_DIAG_LOG_MSG_ARG_FORMAT_STRING is not set
CONFIG_DIAG_LOG_MSG_ARG_MAX_SIZE=64
CONFIG_DIAG_LOG_DROP_WIFI_LOGS=y
CONFIG_DIAG_ENABLE_METRICS=y
CONFIG_DIAG_METRICS_MAX_COUNT=20
CONFIG_DIAG_ENABLE_HEAP_METRICS=y
CONFIG_DIAG_ENABLE_WIFI_METRICS=y
CONFIG_DIAG_ENABLE_VARIABLES=y
CONFIG_DIAG_VARIABLES_MAX_COUNT=20
CONFIG_DIAG_ENABLE_NETWORK_VARIABLES=y
# end of Diagnostics
#
# ESP Insights
#
CONFIG_ESP_INSIGHTS_ENABLED=y
# CONFIG_ESP_INSIGHTS_DEBUG_ENABLED is not set
CONFIG_ESP_INSIGHTS_COREDUMP_ENABLE=y
# CONFIG_ESP_INSIGHTS_TRANSPORT_MQTT is not set
CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS=y
CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS_HOST="https://client.insights.espressif.com"
CONFIG_ESP_INSIGHTS_CLOUD_POST_MIN_INTERVAL_SEC=60
CONFIG_ESP_INSIGHTS_CLOUD_POST_MAX_INTERVAL_SEC=240
# end of ESP Insights
#
# RTC Store
#
CONFIG_RTC_STORE_DATA_SIZE=3072
CONFIG_RTC_STORE_CRITICAL_DATA_SIZE=2048
CONFIG_RTC_STORE_REPORTING_WATERMARK_PERCENT=80
# CONFIG_RTC_STORE_OVERWRITE_NON_CRITICAL_DATA is not set
# end of RTC Store
#
# DSP Library
#
@ -1944,9 +1997,15 @@ CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set
CONFIG_TIMER_TASK_STACK_SIZE=4096
CONFIG_SW_COEXIST_ENABLE=y
# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set
CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH=y
# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set
CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y
# CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE is not set
# CONFIG_ESP32_COREDUMP_DATA_FORMAT_BIN is not set
CONFIG_ESP32_COREDUMP_DATA_FORMAT_ELF=y
CONFIG_ESP32_COREDUMP_CHECKSUM_CRC32=y
# CONFIG_ESP32_COREDUMP_CHECKSUM_SHA256 is not set
CONFIG_ESP32_ENABLE_COREDUMP=y
CONFIG_ESP32_CORE_DUMP_MAX_TASKS_NUM=64
CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND=150
CONFIG_MB_MASTER_DELAY_MS_CONVERT=200
CONFIG_MB_QUEUE_LENGTH=20

View file

@ -53,11 +53,19 @@
#define CONFIG_PARTITION_TABLE_MD5 1
#define CONFIG_LIB_BUILDER_FLASHMODE "dio"
#define CONFIG_LIB_BUILDER_FLASHFREQ "80m"
#define CONFIG_LIB_BUILDER_COMPILE 1
#define CONFIG_ESP_RMAKER_SELF_CLAIM 1
#define CONFIG_ESP_RMAKER_CLAIM_TYPE 1
#define CONFIG_ESP_RMAKER_CLAIM_SERVICE_BASE_URL "https://esp-claiming.rainmaker.espressif.com"
#define CONFIG_ESP_RMAKER_MQTT_HOST "a1p72mufdu6064-ats.iot.us-east-1.amazonaws.com"
#define CONFIG_ESP_RMAKER_MQTT_USE_BASIC_INGEST_TOPICS 1
#define CONFIG_ESP_RMAKER_MQTT_ENABLE_BUDGETING 1
#define CONFIG_ESP_RMAKER_MQTT_DEFAULT_BUDGET 100
#define CONFIG_ESP_RMAKER_MQTT_MAX_BUDGET 1024
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_PERIOD 5
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_COUNT 1
#define CONFIG_ESP_RMAKER_MAX_PARAM_DATA_SIZE 1024
#define CONFIG_ESP_RMAKER_USER_ID_CHECK 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM_0 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM 0
#define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1
@ -339,7 +347,7 @@
#define CONFIG_FATFS_CODEPAGE 850
#define CONFIG_FATFS_LFN_STACK 1
#define CONFIG_FATFS_MAX_LFN 255
#define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1
#define CONFIG_FATFS_API_ENCODING_UTF_8 1
#define CONFIG_FATFS_FS_LOCK 0
#define CONFIG_FATFS_TIMEOUT_MS 10000
#define CONFIG_FATFS_PER_FILE_CACHE 1
@ -602,6 +610,23 @@
#define CONFIG_ESP_RMAKER_DEF_TIMEZONE "Asia/Shanghai"
#define CONFIG_ESP_RMAKER_SNTP_SERVER_NAME "pool.ntp.org"
#define CONFIG_ESP_RMAKER_MAX_COMMANDS 10
#define CONFIG_DIAG_LOG_MSG_ARG_FORMAT_TLV 1
#define CONFIG_DIAG_LOG_MSG_ARG_MAX_SIZE 64
#define CONFIG_DIAG_LOG_DROP_WIFI_LOGS 1
#define CONFIG_DIAG_ENABLE_METRICS 1
#define CONFIG_DIAG_METRICS_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_HEAP_METRICS 1
#define CONFIG_DIAG_ENABLE_WIFI_METRICS 1
#define CONFIG_DIAG_ENABLE_VARIABLES 1
#define CONFIG_DIAG_VARIABLES_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_NETWORK_VARIABLES 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS_HOST "https://client.insights.espressif.com"
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MIN_INTERVAL_SEC 60
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MAX_INTERVAL_SEC 240
#define CONFIG_RTC_STORE_DATA_SIZE 6144
#define CONFIG_RTC_STORE_CRITICAL_DATA_SIZE 4096
#define CONFIG_RTC_STORE_REPORTING_WATERMARK_PERCENT 80
#define CONFIG_DSP_ANSI 1
#define CONFIG_DSP_OPTIMIZATION 0
#define CONFIG_DSP_MAX_FFT_SIZE_4096 1
@ -746,5 +771,5 @@
#define CONFIG_TOOLPREFIX CONFIG_SDK_TOOLPREFIX
#define CONFIG_UDP_RECVMBOX_SIZE CONFIG_LWIP_UDP_RECVMBOX_SIZE
#define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS
#define CONFIG_ARDUINO_IDF_COMMIT ""
#define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4"
#define CONFIG_ARDUINO_IDF_COMMIT "6407ecb3f8"
#define CONFIG_ARDUINO_IDF_BRANCH "v4.4.3"

View file

@ -53,11 +53,19 @@
#define CONFIG_PARTITION_TABLE_MD5 1
#define CONFIG_LIB_BUILDER_FLASHMODE "dout"
#define CONFIG_LIB_BUILDER_FLASHFREQ "80m"
#define CONFIG_LIB_BUILDER_COMPILE 1
#define CONFIG_ESP_RMAKER_SELF_CLAIM 1
#define CONFIG_ESP_RMAKER_CLAIM_TYPE 1
#define CONFIG_ESP_RMAKER_CLAIM_SERVICE_BASE_URL "https://esp-claiming.rainmaker.espressif.com"
#define CONFIG_ESP_RMAKER_MQTT_HOST "a1p72mufdu6064-ats.iot.us-east-1.amazonaws.com"
#define CONFIG_ESP_RMAKER_MQTT_USE_BASIC_INGEST_TOPICS 1
#define CONFIG_ESP_RMAKER_MQTT_ENABLE_BUDGETING 1
#define CONFIG_ESP_RMAKER_MQTT_DEFAULT_BUDGET 100
#define CONFIG_ESP_RMAKER_MQTT_MAX_BUDGET 1024
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_PERIOD 5
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_COUNT 1
#define CONFIG_ESP_RMAKER_MAX_PARAM_DATA_SIZE 1024
#define CONFIG_ESP_RMAKER_USER_ID_CHECK 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM_0 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM 0
#define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1
@ -339,7 +347,7 @@
#define CONFIG_FATFS_CODEPAGE 850
#define CONFIG_FATFS_LFN_STACK 1
#define CONFIG_FATFS_MAX_LFN 255
#define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1
#define CONFIG_FATFS_API_ENCODING_UTF_8 1
#define CONFIG_FATFS_FS_LOCK 0
#define CONFIG_FATFS_TIMEOUT_MS 10000
#define CONFIG_FATFS_PER_FILE_CACHE 1
@ -602,6 +610,23 @@
#define CONFIG_ESP_RMAKER_DEF_TIMEZONE "Asia/Shanghai"
#define CONFIG_ESP_RMAKER_SNTP_SERVER_NAME "pool.ntp.org"
#define CONFIG_ESP_RMAKER_MAX_COMMANDS 10
#define CONFIG_DIAG_LOG_MSG_ARG_FORMAT_TLV 1
#define CONFIG_DIAG_LOG_MSG_ARG_MAX_SIZE 64
#define CONFIG_DIAG_LOG_DROP_WIFI_LOGS 1
#define CONFIG_DIAG_ENABLE_METRICS 1
#define CONFIG_DIAG_METRICS_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_HEAP_METRICS 1
#define CONFIG_DIAG_ENABLE_WIFI_METRICS 1
#define CONFIG_DIAG_ENABLE_VARIABLES 1
#define CONFIG_DIAG_VARIABLES_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_NETWORK_VARIABLES 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS_HOST "https://client.insights.espressif.com"
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MIN_INTERVAL_SEC 60
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MAX_INTERVAL_SEC 240
#define CONFIG_RTC_STORE_DATA_SIZE 6144
#define CONFIG_RTC_STORE_CRITICAL_DATA_SIZE 4096
#define CONFIG_RTC_STORE_REPORTING_WATERMARK_PERCENT 80
#define CONFIG_DSP_ANSI 1
#define CONFIG_DSP_OPTIMIZATION 0
#define CONFIG_DSP_MAX_FFT_SIZE_4096 1
@ -746,5 +771,5 @@
#define CONFIG_TOOLPREFIX CONFIG_SDK_TOOLPREFIX
#define CONFIG_UDP_RECVMBOX_SIZE CONFIG_LWIP_UDP_RECVMBOX_SIZE
#define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS
#define CONFIG_ARDUINO_IDF_COMMIT ""
#define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4"
#define CONFIG_ARDUINO_IDF_COMMIT "6407ecb3f8"
#define CONFIG_ARDUINO_IDF_BRANCH "v4.4.3"

View file

@ -0,0 +1,296 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <inttypes.h>
#include <stdbool.h>
#include <esp_err.h>
#include <esp_log.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Callback to write log to diagnostics storage
*/
typedef esp_err_t (*esp_diag_log_write_cb_t)(void *data, size_t len, void *priv_data);
/**
* @brief Diagnostics log configurations
*/
typedef struct {
esp_diag_log_write_cb_t write_cb; /*!< Callback function to write diagnostics data */
void *cb_arg; /*!< User data to pass in callback function */
} esp_diag_log_config_t;
/**
* @brief Supported log types in diagnostics
*/
typedef enum {
ESP_DIAG_LOG_TYPE_ERROR = 1 << 0, /*!< Diagnostics log type error */
ESP_DIAG_LOG_TYPE_WARNING = 1 << 1, /*!< Diagnostics log type warning */
ESP_DIAG_LOG_TYPE_EVENT = 1 << 2, /*!< Diagnostics log type event */
} esp_diag_log_type_t;
/**
* @brief Log argument data types
*/
typedef enum {
ARG_TYPE_CHAR, /*!< Argument type (char) */
ARG_TYPE_SHORT, /*!< Argument type (short) */
ARG_TYPE_INT, /*!< Argument type (int) */
ARG_TYPE_L, /*!< Argument type (long) */
ARG_TYPE_LL, /*!< Argument type (long long) */
ARG_TYPE_INTMAX, /*!< Argument type (intmax_t) */
ARG_TYPE_PTRDIFF, /*!< Argument type (ptrdiff_t) */
ARG_TYPE_UCHAR, /*!< Argument type (unsigned char) */
ARG_TYPE_USHORT, /*!< Argument type (unsigned short) */
ARG_TYPE_UINT, /*!< Argument type (unsigned int) */
ARG_TYPE_UL, /*!< Argument type (unsigned long) */
ARG_TYPE_ULL, /*!< Argument type (unsigned long long) */
ARG_TYPE_UINTMAX, /*!< Argument type (uintmax_t) */
ARG_TYPE_SIZE, /*!< Argument type (size_t) */
ARG_TYPE_DOUBLE, /*!< Argument type (double) */
ARG_TYPE_LDOUBLE, /*!< Argument type (long double) */
ARG_TYPE_STR, /*!< Argument type (char *) */
ARG_TYPE_INVALID, /*!< Argument type invalid */
} esp_diag_arg_type_t;
/**
* @brief Log argument data value
*/
typedef union {
char c; /*!< Value of type signed char */
short s; /*!< Value of type signed short */
int i; /*!< Value of type signed integer */
long l; /*!< Value of type signed long */
long long ll; /*!< Value of type signed long long */
intmax_t imx; /*!< Value of type intmax_t */
ptrdiff_t ptrdiff; /*!< Value of type ptrdiff_t */
unsigned char uc; /*!< Value of type unsigned char */
unsigned short us; /*!< Value of type unsigned short */
unsigned int u; /*!< Value of type unsigned integer */
unsigned long ul; /*!< Value of type unsigned long */
unsigned long long ull; /*!< Value of type unsigned long long */
uintmax_t umx; /*!< Value of type uintmax_t */
size_t sz; /*!< Value of type size_t */
double d; /*!< Value of type double */
long double ld; /*!< Value of type long double */
char *str; /*!< value of type string */
} esp_diag_arg_value_t;
/**
* @brief Diagnostics data point type
*/
typedef enum {
ESP_DIAG_DATA_PT_METRICS, /*!< Data point of type metrics */
ESP_DIAG_DATA_PT_VARIABLE, /*!< Data point of type variable */
} esp_diag_data_pt_type_t;
/**
* @brief Diagnostics data types
*/
typedef enum {
ESP_DIAG_DATA_TYPE_BOOL, /*!< Data type boolean */
ESP_DIAG_DATA_TYPE_INT, /*!< Data type integer */
ESP_DIAG_DATA_TYPE_UINT, /*!< Data type unsigned integer */
ESP_DIAG_DATA_TYPE_FLOAT, /*!< Data type float */
ESP_DIAG_DATA_TYPE_STR, /*!< Data type string */
ESP_DIAG_DATA_TYPE_IPv4, /*!< Data type IPv4 address */
ESP_DIAG_DATA_TYPE_MAC, /*!< Data type MAC address */
} esp_diag_data_type_t;
/**
* @brief Diagnostics log data structure
*/
typedef struct {
esp_diag_log_type_t type; /*!< Type of diagnostics log */
uint32_t pc; /*!< Program Counter */
uint64_t timestamp; /*!< If NTP sync enabled then POSIX time,
otherwise relative time since bootup in microseconds */
char tag[16]; /*!< Tag of log message */
void *msg_ptr; /*!< Address of err/warn/event message in rodata */
uint8_t msg_args[CONFIG_DIAG_LOG_MSG_ARG_MAX_SIZE]; /*!< Arguments of log message */
uint8_t msg_args_len; /*!< Length of argument */
char task_name[CONFIG_FREERTOS_MAX_TASK_NAME_LEN]; /*!< Task name */
} esp_diag_log_data_t;
/**
* @brief Device information structure
*/
typedef struct {
uint32_t chip_model; /*!< Chip model */
uint32_t chip_rev; /*!< Chip revision */
uint32_t reset_reason; /*!< Reset reason */
char app_version[32]; /*!< Application version */
char project_name[32]; /*!< Project name */
char app_elf_sha256[CONFIG_APP_RETRIEVE_LEN_ELF_SHA + 1]; /*!< SHA256 of application elf */
} esp_diag_device_info_t;
/**
* @brief Task backtrace structure
*/
typedef struct {
uint32_t bt[16]; /*!< Backtrace (array of PC) */
uint32_t depth; /*!< Number of backtrace entries */
bool corrupted; /*!< Status flag for backtrace is corrupt or not */
} esp_diag_task_bt_t;
/**
* @brief Task information structure
*/
typedef struct {
char name[CONFIG_FREERTOS_MAX_TASK_NAME_LEN]; /*!< Task name */
uint32_t state; /*!< Task state */
uint32_t high_watermark; /*!< Task high watermark */
#ifndef CONFIG_IDF_TARGET_ARCH_RISCV
esp_diag_task_bt_t bt_info; /*!< Backtrace of the task */
#endif /* !CONFIG_IDF_TARGET_ARCH_RISCV */
} esp_diag_task_info_t;
/**
* @brief Structure for diagnostics data point
*/
typedef struct {
uint16_t type; /*!< Metrics or Variable */
uint16_t data_type; /*!< Data type */
char key[16]; /*!< Key */
uint64_t ts; /*!< Timestamp */
union {
bool b; /*!< Value for boolean data type */
int32_t i; /*!< Value for integer data type */
uint32_t u; /*!< Value for unsigned integer data type */
float f; /*!< Value for float data type */
uint32_t ipv4; /*!< Value for the IPv4 address */
uint8_t mac[6]; /*!< Value for the MAC address */
} value;
} esp_diag_data_pt_t;
/**
* @brief Structure for string data type diagnostics data point
*/
typedef struct {
uint16_t type; /*!< Metrics or Variable */
uint16_t data_type; /*!< Data type */
char key[16]; /*!< Key */
uint64_t ts; /*!< Timestamp */
union {
char str[32]; /*!< Value for string data type */
} value;
} esp_diag_str_data_pt_t;
/**
* @brief Initialize diagnostics log hook
*
* @param[in] config Pointer to a config structure of type \ref esp_diag_log_config_t
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_log_hook_init(esp_diag_log_config_t *config);
/**
* @brief Enable the diagnostics log hook for provided log type
*
* @param[in] type Log type to enable, can be the bitwise OR of types from \ref esp_diag_log_type_t
*/
void esp_diag_log_hook_enable(uint32_t type);
/**
* @brief Disable the diagnostics log hook for provided log type
*
* @param[in] type Log type to disable, can be the bitwise OR of types from \ref esp_diag_log_type_t
*
*/
void esp_diag_log_hook_disable(uint32_t type);
/**
* @brief Add diagnostics event
*
* @param[in] tag The tag of message
* @param[in] format Message format
* @param[in] ... Variable arguments
*
* @return ESP_OK if successful, appropriate error code otherwise.
*
* @note This function is not intended to be used directly, Instead, use macro \ref ESP_DIAG_EVENT
*/
esp_err_t esp_diag_log_event(const char *tag, const char *format, ...) __attribute__ ((format (printf, 2, 3)));
/**
* @brief Macro to add the custom event
*
* @param[in] tag tag of the event
* @param[in] format format of the event
* @param[in] ... Variable arguments
*/
#define ESP_DIAG_EVENT(tag, format, ...) \
{ \
esp_diag_log_event(tag, "EV (%"PRIu32") %s: " format, esp_log_timestamp(), tag, ##__VA_ARGS__); \
ESP_LOGI(tag, format, ##__VA_ARGS__); \
}
/**
* @brief Get the device information for diagnostics
*
* @param[out] device_info Pointer to device_info structure of type \ref esp_diag_device_info_t
*
* @return ESP_OK on success
* @return ESP_ERR_INVALID_ARG if device_info is NULL
*/
esp_err_t esp_diag_device_info_get(esp_diag_device_info_t *device_info);
/**
* @brief Get the timestamp
*
* This function returns POSIX time if NTP sync is enabled
* otherwise returns time since bootup in microseconds
*
* @return timestamp
*/
uint64_t esp_diag_timestamp_get(void);
/**
* @brief Get backtrace and some more details of all tasks in system
*
* @note On device backtrace parsing not available on RISC-V boards (ESP32C3)
*
* @param[out] tasks Array to store task info
* @param[in] size Size of array, If size is less than the number of tasks in system,
* then info of size tasks is filled in array
*
* @return Number of task info filled in array
*
* @note Allocate enough memory to store all tasks,
* Use uxTaskGetNumberOfTasks() to get number of tasks in system
*/
uint32_t esp_diag_task_snapshot_get(esp_diag_task_info_t *tasks, size_t size);
/**
* @brief Dump backtrace and some more details of all tasks
* in system to console using \ref ESP_DIAG_EVENT
*/
void esp_diag_task_snapshot_dump(void);
/**
* @brief Get CRC of diagnostics metadata
*
* @return crc
*/
uint32_t esp_diag_meta_crc_get(void);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,209 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <stdbool.h>
#include <esp_err.h>
#include <esp_diagnostics.h>
#ifdef __cplusplus
extern "C"
{
#endif
#if CONFIG_DIAG_ENABLE_METRICS
/**
* @brief Callback to write metrics data
*
* @param[in] tag Tag for metrics
* @param[in] data Metrics data
* @param[in] len Length of metrics data
* @param[in] cb_arg User data to pass in write callback
*/
typedef esp_err_t (*esp_diag_metrics_write_cb_t)(const char *tag, void *data, size_t len, void *cb_arg);
/**
* @brief Diagnostics metrics config structure
*/
typedef struct {
esp_diag_metrics_write_cb_t write_cb; /*!< Callback function to write diagnostics data */
void *cb_arg; /*!< User data to pass in callback function */
} esp_diag_metrics_config_t;
/**
* @brief Structure for diagnostics metrics metadata
*/
typedef struct {
const char *tag; /*!< Tag of metrics */
const char *key; /*!< Unique key for the metrics */
const char *label; /*!< Label for the metrics */
const char *path; /*!< Hierarchical path for the key, must be separated by '.' for more than one level,
eg: "wifi", "heap.internal", "heap.external" */
esp_diag_data_type_t type; /*!< Data type of metrics */
} esp_diag_metrics_meta_t;
/**
* @brief Initialize the diagnostics metrics
*
* @param[in] config Pointer to a config structure of type \ref esp_diag_metrics_config_t
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_init(esp_diag_metrics_config_t *config);
/**
* @brief Deinitialize the diagnostics metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_deinit(void);
/**
* @brief Register a metrics
*
* @param[in] tag Tag of metrics
* @param[in] key Unique key for the metrics
* @param[in] label Label for the metrics
* @param[in] path Hierarchical path for key, must be separated by '.' for more than one level
* @param[in] type Data type of metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_register(const char *tag,
const char *key,
const char *label,
const char *path,
esp_diag_data_type_t type);
/**
* @brief Unregister a diagnostics metrics
*
* @param[in] key Key for the metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_unregister(const char *key);
/**
* @brief Unregister all previously registered metrics
*
* @return ESP_OK if successful, qppropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_unregister_all(void);
/**
* @brief Get metadata for all metrics
*
* @param[out] len Length of the metrics meta data array
*
* @return array Array of metrics meta data
*/
const esp_diag_metrics_meta_t *esp_diag_metrics_meta_get_all(uint32_t *len);
/**
* @brief Print metadata for all metrics
*/
void esp_diag_metrics_meta_print_all(void);
/**
* @brief Add metrics to storage
*
* @param[in] data_type Data type of metrics \ref esp_diag_data_type_t
* @param[in] key Key of metrics
* @param[in] val Value of metrics
* @param[in] val_sz Size of val
* @param[in] ts Timestamp in microseconds, this should be the value at the time of data gathering
*
* @return ESP_OK if successful, appropriate error code otherwise.
*
* @note \ref esp_diag_timestamp_get() API can be used to get timestamp in mircoseconds.
*/
esp_err_t esp_diag_metrics_add(esp_diag_data_type_t data_type,
const char *key, const void *val,
size_t val_sz, uint64_t ts);
/**
* @brief Add the metrics of data type boolean
*
* @param[in] key Key of the metrics
* @param[in] b Value of the metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_add_bool(const char *key, bool b);
/**
* @brief Add the metrics of data type integer
*
* @param[in] key Key of the metrics
* @param[in] i Value of the metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_add_int(const char *key, int32_t i);
/**
* @brief Add the metrics of data type unsigned integer
*
* @param[in] key Key of the metrics
* @param[in] u Value of the metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_add_uint(const char *key, uint32_t u);
/**
* @brief Add the metrics of data type float
*
* @param[in] key Key of the metrics
* @param[in] f Value of the metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_add_float(const char *key, float f);
/**
* @brief Add the IPv4 address metrics
*
* @param[in] key Key of the metrics
* @param[in] ip IPv4 address
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_add_ipv4(const char *key, uint32_t ip);
/**
* @brief Add the MAC address metrics
*
* @param[in] key Key of the metrics
* @param[in] mac Array of length 6 i.e 6 octets of mac address
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_add_mac(const char *key, uint8_t *mac);
/**
* @brief Add the metrics of data type string
*
* @param[in] key Key of the metrics
* @param[in] str Value of the metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_metrics_add_str(const char *key, const char *str);
#endif /* CONFIG_DIAG_ENABLE_METRICS */
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,41 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#ifdef __cplusplus
extern "C"
{
#endif
#if CONFIG_DIAG_ENABLE_NETWORK_VARIABLES
/**
* @brief Initialize the network variables
*
* Below listed Wi-Fi and IP parameters are collected and reported to cloud on change.
* Wi-Fi connection status, BSSID, SSID, channel, authentication mode,
* Wi-Fi disconnection reason, IP address, netmask, and gateway.
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_network_variables_init(void);
/**
* @brief Deinitialize the network variables
*/
esp_err_t esp_diag_network_variables_deinit(void);
#endif /* CONFIG_DIAG_ENABLE_NETWORK_VARIABLES */
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,105 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#ifdef __cplusplus
extern "C"
{
#endif
#if CONFIG_DIAG_ENABLE_HEAP_METRICS
/**
* @brief Initialize the heap metrics
*
* Free heap, largest free block, and all time minimum free heap values are collected periodically.
* Parameters are collected for RAM in internal memory and external memory (if device has PSRAM).
*
* Default periodic interval is 30 seconds and can be changed with esp_diag_heap_metrics_reset_interval().
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_heap_metrics_init(void);
/**
* @brief Deinitialize the heap metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_heap_metrics_deinit(void);
/**
* @brief Reset the periodic interval
*
* By default, heap metrics are collected every 30 seconds, this function can be used to change the interval.
* If the interval is set to 0, heap metrics collection disabled.
*
* @param[in] period Period interval in seconds
*/
void esp_diag_heap_metrics_reset_interval(uint32_t period);
/**
* @brief Dumps the heap metrics and prints them to the console.
*
* This API collects and reports metrics value at any give point in time.
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_heap_metrics_dump(void);
#endif /* CONFIG_DIAG_ENABLE_HEAP_METRICS */
#if CONFIG_DIAG_ENABLE_WIFI_METRICS
/**
* @brief Initialize the wifi metrics
*
* Wi-Fi RSSI and minimum ever Wi-Fi RSSI values are collected periodically.
* Default periodic interval is 30 seconds and can be changed with esp_diag_wifi_metrics_reset_interval().
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_wifi_metrics_init(void);
/**
* @brief Deinitialize the wifi metrics
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_wifi_metrics_deinit(void);
/**
* @brief Dumps the wifi metrics and prints them to the console.
*
* This API can be used to collect wifi metrics at any given point in time.
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_wifi_metrics_dump(void);
/**
* @brief Reset the periodic interval
*
* By default, wifi metrics are collected every 30 seconds, this function can be used to change the interval.
* If the interval is set to 0, wifi metrics collection disabled.
*
* @param[in] period Period interval in seconds
*/
void esp_diag_wifi_metrics_reset_interval(uint32_t period);
#endif /* CONFIG_DIAG_ENABLE_WIFI_METRICS */
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,210 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <stdbool.h>
#include <esp_err.h>
#include <esp_diagnostics.h>
#ifdef __cplusplus
extern "C"
{
#endif
#if CONFIG_DIAG_ENABLE_VARIABLES
/**
* @brief Callback to write variable's data
*
* @param[in] tag Tag for variable
* @param[in] data Data for variable
* @param[in] len Length of variable
* @param[in] cb_arg User data to pass in write callback
*/
typedef esp_err_t (*esp_diag_variable_write_cb_t)(const char *tag, void *data, size_t len, void *cb_arg);
/**
* @brief Diagnostics variable config structure
*/
typedef struct {
esp_diag_variable_write_cb_t write_cb; /*!< Callback function to write diagnostics data */
void *cb_arg; /*!< User data to pass in callback function */
} esp_diag_variable_config_t;
/**
* @brief Structure for diagnostics variable metadata
*/
typedef struct {
const char *tag; /*!< Tag of variable */
const char *key; /*!< Unique key for the variable */
const char *label; /*!< Label for the variable */
const char *path; /*!< Hierarchical path for the key, must be separated by '.' for more than one level,
eg: "wifi", "heap.internal", "heap.external" */
esp_diag_data_type_t type; /*!< Data type of variables */
} esp_diag_variable_meta_t;
/**
* @brief Initialize the diagnostics variable
*
* @param[in] config Pointer to a config structure of type \ref esp_diag_variable_config_t
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_init(esp_diag_variable_config_t *config);
/**
* @brief Deinitialize the diagnostics variables
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variables_deinit(void);
/**
* @brief Register a diagnostics variable
*
* @param[in] tag Tag of variable
* @param[in] key Unique key for the variable
* @param[in] label Label for the variable
* @param[in] path Hierarchical path for key, must be separated by '.' for more than one level
* @param[in] type Data type of variable
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_register(const char *tag,
const char *key,
const char *label,
const char *path,
esp_diag_data_type_t type);
/**
* @brief Unregister a diagnostics variable
*
* @param[in] key Key for the variable
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_unregister(const char *key);
/**
* @brief Unregister all previously registered variables
*
* @return ESP_OK if successful, qppropriate error code otherwise.
*/
esp_err_t esp_diag_variable_unregister_all(void);
/**
* @brief Get metadata for all variables
*
* @param[out] len Length of the variables meta data array
*
* @return array Array of variables meta data
*/
const esp_diag_variable_meta_t *esp_diag_variable_meta_get_all(uint32_t *len);
/**
* @brief Print metadata for all variables
*/
void esp_diag_variable_meta_print_all(void);
/**
* @brief Add variable to storage
*
* @param[in] data_type Data type of variable \ref esp_diag_data_type_t
* @param[in] key Key of variable
* @param[in] val Value of variable
* @param[in] val_sz Size of val
* @param[in] ts Timestamp in microseconds, this should be the value at the time of data gathering
*
* @return ESP_OK if successful, appropriate error code otherwise.
*
* @note \ref esp_diag_timestamp_get() API can be used to get timestamp in mircoseconds.
*/
esp_err_t esp_diag_variable_add(esp_diag_data_type_t data_type,
const char *key, const void *val,
size_t val_sz, uint64_t ts);
/**
* @brief Add the variable of data type boolean
*
* @param[in] key Key of the variable
* @param[in] b Value of the variable
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_add_bool(const char *key, bool b);
/**
* @brief Add the variable of data type integer
*
* @param[in] key Key of the variable
* @param[in] i Value of the variable
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_add_int(const char *key, int32_t i);
/**
* @brief Add the variable of data type unsigned integer
*
* @param[in] key Key of the variable
* @param[in] u Value of the variable
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_add_uint(const char *key, uint32_t u);
/**
* @brief Add the variable of data type float
*
* @param[in] key Key of the variable
* @param[in] f Value of the variable
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_add_float(const char *key, float f);
/**
* @brief Add the IPv4 address variable
*
* @param[in] key Key of the variable
* @param[in] ip IPv4 address
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_add_ipv4(const char *key, uint32_t ip);
/**
* @brief Add the MAC address variable
*
* @param[in] key Key of the variable
* @param[in] mac Array of length 6 i.e 6 octets of mac address
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_add_mac(const char *key, uint8_t *mac);
/**
* @brief Add the variable of data type string
*
* @param[in] key Key of the variable
* @param[in] str Value of the variable
*
* @return ESP_OK if successful, appropriate error code otherwise.
*/
esp_err_t esp_diag_variable_add_str(const char *key, const char *str);
#endif /* CONFIG_DIAG_ENABLE_VARIABLES */
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,169 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <stdint.h>
#include <esp_err.h>
#include <esp_event_base.h>
#include <esp_diagnostics.h>
#ifdef __cplusplus
extern "C"
{
#endif
/**
* @brief Insights event base
*/
ESP_EVENT_DECLARE_BASE(INSIGHTS_EVENT);
/**
* @brief ESP Insights configuration
*/
typedef struct {
/** Log types to enable, bitwise OR the values from \ref esp_diag_log_type_t */
uint32_t log_type;
/** Node id for insights. If NULL then insights agent uses MAC address as node id */
const char *node_id;
/** Authentication key, valid only for https transport */
const char *auth_key;
/** Try to allocate large buffers in External RAM */
bool alloc_ext_ram;
} esp_insights_config_t;
/**
* @brief Insights events
*
* Transport layer emits events using default event loop, every transport
* event has event data of type \ref esp_insights_transport_event_data_t;
*/
typedef enum {
/** Asynchronous data send succeded. Event data contains the msg_id of the data. */
INSIGHTS_EVENT_TRANSPORT_SEND_SUCCESS,
/** Asynchronous data send failed. Event data contains the msg_id of the data. */
INSIGHTS_EVENT_TRANSPORT_SEND_FAILED,
/** Data received. Event data contains received data and data_len. */
INSIGHTS_EVENT_TRANSPORT_RECV,
} esp_insights_event_t;
/**
* @brief Insights transport event data
*/
typedef struct {
uint8_t *data; /*!< Data associated with the event */
size_t data_len; /*!< Length of the data for the event */
int msg_id; /*!< Message id */
} esp_insights_transport_event_data_t;
/**
* @brief Insights transport init callback prototype
*
* @param[in] userdata User data
*
* @return ESP_OK on success, appropriate error code otherwise.
*/
typedef esp_err_t(*esp_insights_transport_init_t)(void *userdata);
/**
* @brief Insights transport deinit callback prototype
*/
typedef void(*esp_insights_transport_deinit_t)(void);
/**
* @brief Insights transport connect callback prototype
*
* @return ESP_OK on success, appropriate error code otherwise.
*/
typedef esp_err_t(*esp_insights_transport_connect_t)(void);
/**
* @brief Insights transport disconnect callback prototype
*/
typedef void(*esp_insights_transport_disconnect_t)(void);
/**
* @brief Insights transport data send callback prototype
*
* @param[in] data Data to send
* @param[in] len Length of data
*
* @return msg_id Message_id of the sent data.
* On failure, -1
* On success, 0 if data send happens synchronously.
* On success, message-id(positive integer) if data send happened asynchronously.
*
* @note If data send happened asynchronously then appropriate events in \ref esp_insights_event_t must be emitted.
*/
typedef int(*esp_insights_transport_data_send_t)(void *data, size_t len);
/**
* @brief Insights transport configurations
*/
typedef struct {
/** Insights transport callback functions */
struct {
/** Transport init function */
esp_insights_transport_init_t init;
/** Transport deinit function */
esp_insights_transport_deinit_t deinit;
/** Transport connect function */
esp_insights_transport_connect_t connect;
/** Transport disconnect function */
esp_insights_transport_disconnect_t disconnect;
/** Function to send data */
esp_insights_transport_data_send_t data_send;
} callbacks;
/** User data */
void *userdata;
} esp_insights_transport_config_t;
/**
* @brief Initialize ESP Insights
*
* @param[in] config Configuration for ESP Insights.
*
* @return ESP_OK on success, appropriate error code otherwise
*/
esp_err_t esp_insights_init(esp_insights_config_t *config);
/**
* @brief Deinitialize ESP Insights
*/
void esp_insights_deinit(void);
/**
* @brief Register insights transport
*
* @param[in] config Configurations of type \ref esp_insights_transport_config_t
*
* @return ESP_OK on success, appropriate error code otherwise
*/
esp_err_t esp_insights_transport_register(esp_insights_transport_config_t *config);
/**
* @brief Unregister insights transport
*/
void esp_insights_transport_unregister(void);
/**
* @brief Read insights data from buffers and send it to the cloud
*
* Call to this function is asynchronous, it may take some time to send the data.
*
* @return ESP_OK on success, appropriate error code otherwise
*/
esp_err_t esp_insights_send_data(void);
#ifdef __cplusplus
}
#endif

View file

@ -8,10 +8,10 @@
extern "C" {
#endif
#define ESP_LITTLEFS_VERSION_NUMBER "1.5.0"
#define ESP_LITTLEFS_VERSION_NUMBER "1.5.1"
#define ESP_LITTLEFS_VERSION_MAJOR 1
#define ESP_LITTLEFS_VERSION_MINOR 5
#define ESP_LITTLEFS_VERSION_PATCH 0
#define ESP_LITTLEFS_VERSION_PATCH 1
/**
*Configuration structure for esp_vfs_littlefs_register.

View file

@ -22,7 +22,7 @@ extern "C"
#endif
esp_rmaker_mqtt_conn_params_t *esp_rmaker_mqtt_get_conn_params(void);
/** Initialize ESP RainMaker MQTT
*
* @param[in] config The MQTT configuration data
@ -32,6 +32,12 @@ esp_rmaker_mqtt_conn_params_t *esp_rmaker_mqtt_get_conn_params(void);
*/
esp_err_t esp_rmaker_mqtt_init(esp_rmaker_mqtt_conn_params_t *conn_params);
/* Deinitialize ESP RainMaker MQTT
*
* Call this function after MQTT has disconnected.
*/
void esp_rmaker_mqtt_deinit(void);
/** MQTT Connect
*
* Starts the connection attempts to the MQTT broker as per the configuration
@ -85,6 +91,15 @@ esp_err_t esp_rmaker_mqtt_subscribe(const char *topic, esp_rmaker_mqtt_subscribe
*/
esp_err_t esp_rmaker_mqtt_unsubscribe(const char *topic);
esp_err_t esp_rmaker_mqtt_setup(esp_rmaker_mqtt_config_t mqtt_config);
/** Creates appropriate MQTT Topic String based on CONFIG_ESP_RMAKER_MQTT_USE_BASIC_INGEST_TOPICS
* @param[out] buf Buffer to hold topic string
* @param[in] buf_size Size of buffer
* @param[in] topic_suffix MQTT Topic suffix
* @param[in] rule Basic Ingests Rule Name
*/
void esp_rmaker_create_mqtt_topic(char *buf, size_t buf_size, const char *topic_suffix, const char *rule);
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,163 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <esp_err.h>
#include <esp_event.h>
#ifdef __cplusplus
extern "C" {
#endif
/** @cond **/
/**
* @brief RTC store event base
*/
ESP_EVENT_DECLARE_BASE(RTC_STORE_EVENT);
/** @endcond **/
/**
* @brief RTC store events
*/
typedef enum {
RTC_STORE_EVENT_CRITICAL_DATA_LOW_MEM, /*!< Critical data configured threshold crossed */
RTC_STORE_EVENT_CRITICAL_DATA_WRITE_FAIL, /*!< Critical data write failed */
RTC_STORE_EVENT_NON_CRITICAL_DATA_LOW_MEM, /*!< Non critical data configured threshold crossed */
RTC_STORE_EVENT_NON_CRITICAL_DATA_WRITE_FAIL, /*!< Non critical data write failed */
} rtc_store_event_t;
/**
* @brief Non critical data header
*/
typedef struct {
const char *dg; /*!< Data group of non critical data eg: heap, wifi, ip */
uint32_t len; /*!< Length of data */
} rtc_store_non_critical_data_hdr_t;
/**
* @brief Write critical data to the RTC storage
*
* @param[in] data Pointer to the data
* @param[in] len Length of data
*
* @return ESP_OK on success, appropriate error code otherwise.
*/
esp_err_t rtc_store_critical_data_write(void *data, size_t len);
/**
* @brief Read critical data from the RTC storage
*
* @param[out] size Number of bytes read
*
* @return Pointer to the data on success, otherwise NULL
*
* @note It is mandatory to call \ref rtc_store_critical_data_release_and_unlock() if \ref rtc_store_critical_data_read_and_lock() is successful.
* @note Please avoid adding \ref ESP_DIAG_EVENT(), error/warning logs using esp_log module in between rtc_store_critical_data_read_and_lock() and rtc_store_critical_data_release_and_unlock() API calls. It may lead to a deadlock.
*/
const void *rtc_store_critical_data_read_and_lock(size_t *size);
/**
* @brief Release the utilized data read using \ref rtc_store_critical_data_read_and_lock()
*
* This API releases the utilized data read using \ref rtc_store_critical_data_read_and_lock().
* Utilization may involve encoding data, sending data to the cloud, post processing or printing on the console, etc.
*
* @param[in] size Number of bytes to free. If all the data is utilized then pass the size returned by \ref rtc_store_critical_data_read_and_lock() or 0 if no data is utilized (e.g. sending to cloud failed).
*
* @return ESP_OK on success, appropriate error code otherwise.
*
* @note Please avoid adding \ref ESP_DIAG_EVENT(), error/warning logs using esp_log module in between rtc_store_critical_data_read_and_lock() and rtc_store_critical_data_release_and_unlock() API calls. It may lead to a deadlock.
*/
esp_err_t rtc_store_critical_data_release_and_unlock(size_t size);
/**
* @brief Release the size bytes critical data from RTC storage
*
* This API can be used to remove data from buffer when data is sent asynchronously.
*
* Consider data is read using \ref rtc_store_critical_data_read_and_lock() and sent to cloud asynchronously.
* Since status of data send is unknown, call \ref rtc_store_critical_data_release_and_unlock() with zero length.
* When acknowledgement for data send is received use this API with appropriate size to remove the data from the buffer.
*
* @param[in] size Number of bytes to free.
*
* @return ESP_OK on success, appropriate error code otherwise.
*/
esp_err_t rtc_store_critical_data_release(size_t size);
/**
* @brief Write non critical data to the RTC storage
*
* This API overwrites the data if non critical storage is full
*
* @param[in] dg Data group of data eg: heap, wifi, ip(Must be the string stored in RODATA)
* @param[in] data Pointer to non critical data
* @param[in] len Length of non critical data
*
* @return ESP_OK on success, appropriate error code otherwise.
*
* @note Data is stored in Type-Length-Value format
* Type(Data group) - 4 byte - Pointer to the string in rodata
* Length - 4 byte - Length of data
* Value - Length byte - Data
*/
esp_err_t rtc_store_non_critical_data_write(const char *dg, void *data, size_t len);
/**
* @brief Read non critical data from the RTC storage
*
* @param[out] size Number of bytes read
*
* @return Pointer to the data on success, otherwise NULL
*
* @note It is mandatory to call \ref rtc_store_non_critical_data_release_and_unlock() if \ref rtc_store_non_critical_data_read_and_lock() is successful.
*/
const void *rtc_store_non_critical_data_read_and_lock(size_t *size);
/**
* @brief Release the utilized data read using \ref rtc_store_non_critical_data_read_and_lock()
*
* This API releases the utilized data read using \ref rtc_store_non_critical_data_read_and_lock().
* Utilization may involve encoding data, sending data to the cloud, post processing or printing on the console, etc.
*
* @param[in] size Number of bytes to free. If all the data is utilized then pass the size returned by \ref rtc_store_non_critical_data_read_and_lock() or 0 if no data is utilized (e.g. sending to cloud failed).
*
* @return ESP_OK on success, appropriate error code otherwise.
*
*/
esp_err_t rtc_store_non_critical_data_release_and_unlock(size_t size);
/**
* @brief Release the size bytes non critical data from RTC storage
*
* @param[in] size Number of bytes to free.
*
* @return ESP_OK on success, appropriate error code otherwise.
*/
esp_err_t rtc_store_non_critical_data_release(size_t size);
/**
* @brief Initializes the RTC storage
*
* @return ESP_OK on success, appropriate error code otherwise
*/
esp_err_t rtc_store_init(void);
/**
* @brief Deinitializes the RTC storage
*/
void rtc_store_deinit(void);
#ifdef __cplusplus
}
#endif

View file

@ -310,8 +310,8 @@ SECTIONS
_bss_start = ABSOLUTE(.);
*(.bss .bss.*)
*(.dynbss .dynsbss .gnu.linkonce.b .gnu.linkonce.b.* .gnu.linkonce.sb .gnu.linkonce.sb.* .gnu.linkonce.sb2 .gnu.linkonce.sb2.* .sbss .sbss.* .sbss2 .sbss2.* .scommon .share.mem)
*(.ext_ram.bss .ext_ram.bss.*)
*(.dynbss .dynsbss .gnu.linkonce.b .gnu.linkonce.b.* .gnu.linkonce.sb .gnu.linkonce.sb.* .gnu.linkonce.sb2 .gnu.linkonce.sb2.* .sbss .sbss.* .sbss2 .sbss2.* .scommon .share.mem)
*(COMMON)
_bt_bss_start = ABSOLUTE(.);
*libbt.a:(.bss .bss.* COMMON)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -53,11 +53,19 @@
#define CONFIG_PARTITION_TABLE_MD5 1
#define CONFIG_LIB_BUILDER_FLASHMODE "qio"
#define CONFIG_LIB_BUILDER_FLASHFREQ "80m"
#define CONFIG_LIB_BUILDER_COMPILE 1
#define CONFIG_ESP_RMAKER_SELF_CLAIM 1
#define CONFIG_ESP_RMAKER_CLAIM_TYPE 1
#define CONFIG_ESP_RMAKER_CLAIM_SERVICE_BASE_URL "https://esp-claiming.rainmaker.espressif.com"
#define CONFIG_ESP_RMAKER_MQTT_HOST "a1p72mufdu6064-ats.iot.us-east-1.amazonaws.com"
#define CONFIG_ESP_RMAKER_MQTT_USE_BASIC_INGEST_TOPICS 1
#define CONFIG_ESP_RMAKER_MQTT_ENABLE_BUDGETING 1
#define CONFIG_ESP_RMAKER_MQTT_DEFAULT_BUDGET 100
#define CONFIG_ESP_RMAKER_MQTT_MAX_BUDGET 1024
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_PERIOD 5
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_COUNT 1
#define CONFIG_ESP_RMAKER_MAX_PARAM_DATA_SIZE 1024
#define CONFIG_ESP_RMAKER_USER_ID_CHECK 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM_0 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM 0
#define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1
@ -339,7 +347,7 @@
#define CONFIG_FATFS_CODEPAGE 850
#define CONFIG_FATFS_LFN_STACK 1
#define CONFIG_FATFS_MAX_LFN 255
#define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1
#define CONFIG_FATFS_API_ENCODING_UTF_8 1
#define CONFIG_FATFS_FS_LOCK 0
#define CONFIG_FATFS_TIMEOUT_MS 10000
#define CONFIG_FATFS_PER_FILE_CACHE 1
@ -602,6 +610,23 @@
#define CONFIG_ESP_RMAKER_DEF_TIMEZONE "Asia/Shanghai"
#define CONFIG_ESP_RMAKER_SNTP_SERVER_NAME "pool.ntp.org"
#define CONFIG_ESP_RMAKER_MAX_COMMANDS 10
#define CONFIG_DIAG_LOG_MSG_ARG_FORMAT_TLV 1
#define CONFIG_DIAG_LOG_MSG_ARG_MAX_SIZE 64
#define CONFIG_DIAG_LOG_DROP_WIFI_LOGS 1
#define CONFIG_DIAG_ENABLE_METRICS 1
#define CONFIG_DIAG_METRICS_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_HEAP_METRICS 1
#define CONFIG_DIAG_ENABLE_WIFI_METRICS 1
#define CONFIG_DIAG_ENABLE_VARIABLES 1
#define CONFIG_DIAG_VARIABLES_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_NETWORK_VARIABLES 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS_HOST "https://client.insights.espressif.com"
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MIN_INTERVAL_SEC 60
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MAX_INTERVAL_SEC 240
#define CONFIG_RTC_STORE_DATA_SIZE 6144
#define CONFIG_RTC_STORE_CRITICAL_DATA_SIZE 4096
#define CONFIG_RTC_STORE_REPORTING_WATERMARK_PERCENT 80
#define CONFIG_DSP_ANSI 1
#define CONFIG_DSP_OPTIMIZATION 0
#define CONFIG_DSP_MAX_FFT_SIZE_4096 1
@ -746,5 +771,5 @@
#define CONFIG_TOOLPREFIX CONFIG_SDK_TOOLPREFIX
#define CONFIG_UDP_RECVMBOX_SIZE CONFIG_LWIP_UDP_RECVMBOX_SIZE
#define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS
#define CONFIG_ARDUINO_IDF_COMMIT ""
#define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4"
#define CONFIG_ARDUINO_IDF_COMMIT "6407ecb3f8"
#define CONFIG_ARDUINO_IDF_BRANCH "v4.4.3"

View file

@ -53,11 +53,19 @@
#define CONFIG_PARTITION_TABLE_MD5 1
#define CONFIG_LIB_BUILDER_FLASHMODE "qout"
#define CONFIG_LIB_BUILDER_FLASHFREQ "80m"
#define CONFIG_LIB_BUILDER_COMPILE 1
#define CONFIG_ESP_RMAKER_SELF_CLAIM 1
#define CONFIG_ESP_RMAKER_CLAIM_TYPE 1
#define CONFIG_ESP_RMAKER_CLAIM_SERVICE_BASE_URL "https://esp-claiming.rainmaker.espressif.com"
#define CONFIG_ESP_RMAKER_MQTT_HOST "a1p72mufdu6064-ats.iot.us-east-1.amazonaws.com"
#define CONFIG_ESP_RMAKER_MQTT_USE_BASIC_INGEST_TOPICS 1
#define CONFIG_ESP_RMAKER_MQTT_ENABLE_BUDGETING 1
#define CONFIG_ESP_RMAKER_MQTT_DEFAULT_BUDGET 100
#define CONFIG_ESP_RMAKER_MQTT_MAX_BUDGET 1024
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_PERIOD 5
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_COUNT 1
#define CONFIG_ESP_RMAKER_MAX_PARAM_DATA_SIZE 1024
#define CONFIG_ESP_RMAKER_USER_ID_CHECK 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM_0 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM 0
#define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1
@ -339,7 +347,7 @@
#define CONFIG_FATFS_CODEPAGE 850
#define CONFIG_FATFS_LFN_STACK 1
#define CONFIG_FATFS_MAX_LFN 255
#define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1
#define CONFIG_FATFS_API_ENCODING_UTF_8 1
#define CONFIG_FATFS_FS_LOCK 0
#define CONFIG_FATFS_TIMEOUT_MS 10000
#define CONFIG_FATFS_PER_FILE_CACHE 1
@ -602,6 +610,23 @@
#define CONFIG_ESP_RMAKER_DEF_TIMEZONE "Asia/Shanghai"
#define CONFIG_ESP_RMAKER_SNTP_SERVER_NAME "pool.ntp.org"
#define CONFIG_ESP_RMAKER_MAX_COMMANDS 10
#define CONFIG_DIAG_LOG_MSG_ARG_FORMAT_TLV 1
#define CONFIG_DIAG_LOG_MSG_ARG_MAX_SIZE 64
#define CONFIG_DIAG_LOG_DROP_WIFI_LOGS 1
#define CONFIG_DIAG_ENABLE_METRICS 1
#define CONFIG_DIAG_METRICS_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_HEAP_METRICS 1
#define CONFIG_DIAG_ENABLE_WIFI_METRICS 1
#define CONFIG_DIAG_ENABLE_VARIABLES 1
#define CONFIG_DIAG_VARIABLES_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_NETWORK_VARIABLES 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS_HOST "https://client.insights.espressif.com"
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MIN_INTERVAL_SEC 60
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MAX_INTERVAL_SEC 240
#define CONFIG_RTC_STORE_DATA_SIZE 6144
#define CONFIG_RTC_STORE_CRITICAL_DATA_SIZE 4096
#define CONFIG_RTC_STORE_REPORTING_WATERMARK_PERCENT 80
#define CONFIG_DSP_ANSI 1
#define CONFIG_DSP_OPTIMIZATION 0
#define CONFIG_DSP_MAX_FFT_SIZE_4096 1
@ -746,5 +771,5 @@
#define CONFIG_TOOLPREFIX CONFIG_SDK_TOOLPREFIX
#define CONFIG_UDP_RECVMBOX_SIZE CONFIG_LWIP_UDP_RECVMBOX_SIZE
#define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS
#define CONFIG_ARDUINO_IDF_COMMIT ""
#define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4"
#define CONFIG_ARDUINO_IDF_COMMIT "6407ecb3f8"
#define CONFIG_ARDUINO_IDF_BRANCH "v4.4.3"

View file

@ -145,6 +145,7 @@ CONFIG_PARTITION_TABLE_MD5=y
CONFIG_LIB_BUILDER_FLASHMODE="qio"
CONFIG_LIB_BUILDER_FLASHFREQ="80m"
CONFIG_LIB_BUILDER_COMPILE=y
#
# ESP RainMaker Config
@ -155,9 +156,15 @@ CONFIG_ESP_RMAKER_SELF_CLAIM=y
CONFIG_ESP_RMAKER_CLAIM_TYPE=1
CONFIG_ESP_RMAKER_CLAIM_SERVICE_BASE_URL="https://esp-claiming.rainmaker.espressif.com"
CONFIG_ESP_RMAKER_MQTT_HOST="a1p72mufdu6064-ats.iot.us-east-1.amazonaws.com"
CONFIG_ESP_RMAKER_MQTT_USE_BASIC_INGEST_TOPICS=y
CONFIG_ESP_RMAKER_MQTT_ENABLE_BUDGETING=y
CONFIG_ESP_RMAKER_MQTT_DEFAULT_BUDGET=100
CONFIG_ESP_RMAKER_MQTT_MAX_BUDGET=1024
CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_PERIOD=5
CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_COUNT=1
CONFIG_ESP_RMAKER_MAX_PARAM_DATA_SIZE=1024
# CONFIG_ESP_RMAKER_DISABLE_USER_MAPPING_PROV is not set
# CONFIG_ESP_RMAKER_USER_ID_CHECK is not set
CONFIG_ESP_RMAKER_USER_ID_CHECK=y
# CONFIG_RMAKER_NAME_PARAM_CB is not set
# CONFIG_ESP_RMAKER_LOCAL_CTRL_ENABLE is not set
CONFIG_ESP_RMAKER_CONSOLE_UART_NUM_0=y
@ -172,6 +179,7 @@ CONFIG_ESP_RMAKER_OTA_AUTOFETCH=y
CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD=0
# CONFIG_ESP_RMAKER_SKIP_COMMON_NAME_CHECK is not set
CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK=y
# CONFIG_ESP_RMAKER_SKIP_SECURE_VERSION_CHECK is not set
# CONFIG_ESP_RMAKER_SKIP_PROJECT_NAME_CHECK is not set
CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE=1024
CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD=90
@ -1082,9 +1090,9 @@ CONFIG_FATFS_CODEPAGE=850
# CONFIG_FATFS_LFN_HEAP is not set
CONFIG_FATFS_LFN_STACK=y
CONFIG_FATFS_MAX_LFN=255
CONFIG_FATFS_API_ENCODING_ANSI_OEM=y
# CONFIG_FATFS_API_ENCODING_ANSI_OEM is not set
# CONFIG_FATFS_API_ENCODING_UTF_16 is not set
# CONFIG_FATFS_API_ENCODING_UTF_8 is not set
CONFIG_FATFS_API_ENCODING_UTF_8=y
CONFIG_FATFS_FS_LOCK=0
CONFIG_FATFS_TIMEOUT_MS=10000
CONFIG_FATFS_PER_FILE_CACHE=y
@ -1757,6 +1765,42 @@ CONFIG_ESP_RMAKER_MAX_COMMANDS=10
# CONFIG_WS2812_LED_ENABLE is not set
# end of WS2812 RGB LED
#
# Diagnostics
#
CONFIG_DIAG_LOG_MSG_ARG_FORMAT_TLV=y
# CONFIG_DIAG_LOG_MSG_ARG_FORMAT_STRING is not set
CONFIG_DIAG_LOG_MSG_ARG_MAX_SIZE=64
CONFIG_DIAG_LOG_DROP_WIFI_LOGS=y
CONFIG_DIAG_ENABLE_METRICS=y
CONFIG_DIAG_METRICS_MAX_COUNT=20
CONFIG_DIAG_ENABLE_HEAP_METRICS=y
CONFIG_DIAG_ENABLE_WIFI_METRICS=y
CONFIG_DIAG_ENABLE_VARIABLES=y
CONFIG_DIAG_VARIABLES_MAX_COUNT=20
CONFIG_DIAG_ENABLE_NETWORK_VARIABLES=y
# end of Diagnostics
#
# ESP Insights
#
# CONFIG_ESP_INSIGHTS_ENABLED is not set
# CONFIG_ESP_INSIGHTS_TRANSPORT_MQTT is not set
CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS=y
CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS_HOST="https://client.insights.espressif.com"
CONFIG_ESP_INSIGHTS_CLOUD_POST_MIN_INTERVAL_SEC=60
CONFIG_ESP_INSIGHTS_CLOUD_POST_MAX_INTERVAL_SEC=240
# end of ESP Insights
#
# RTC Store
#
CONFIG_RTC_STORE_DATA_SIZE=6144
CONFIG_RTC_STORE_CRITICAL_DATA_SIZE=4096
CONFIG_RTC_STORE_REPORTING_WATERMARK_PERCENT=80
# CONFIG_RTC_STORE_OVERWRITE_NON_CRITICAL_DATA is not set
# end of RTC Store
#
# DSP Library
#

View file

@ -53,11 +53,19 @@
#define CONFIG_PARTITION_TABLE_MD5 1
#define CONFIG_LIB_BUILDER_FLASHMODE "dio"
#define CONFIG_LIB_BUILDER_FLASHFREQ "80m"
#define CONFIG_LIB_BUILDER_COMPILE 1
#define CONFIG_ESP_RMAKER_SELF_CLAIM 1
#define CONFIG_ESP_RMAKER_CLAIM_TYPE 1
#define CONFIG_ESP_RMAKER_CLAIM_SERVICE_BASE_URL "https://esp-claiming.rainmaker.espressif.com"
#define CONFIG_ESP_RMAKER_MQTT_HOST "a1p72mufdu6064-ats.iot.us-east-1.amazonaws.com"
#define CONFIG_ESP_RMAKER_MQTT_USE_BASIC_INGEST_TOPICS 1
#define CONFIG_ESP_RMAKER_MQTT_ENABLE_BUDGETING 1
#define CONFIG_ESP_RMAKER_MQTT_DEFAULT_BUDGET 100
#define CONFIG_ESP_RMAKER_MQTT_MAX_BUDGET 1024
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_PERIOD 5
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_COUNT 1
#define CONFIG_ESP_RMAKER_MAX_PARAM_DATA_SIZE 1024
#define CONFIG_ESP_RMAKER_USER_ID_CHECK 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM_0 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM 0
#define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1
@ -249,7 +257,7 @@
#define CONFIG_FATFS_CODEPAGE 850
#define CONFIG_FATFS_LFN_STACK 1
#define CONFIG_FATFS_MAX_LFN 255
#define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1
#define CONFIG_FATFS_API_ENCODING_UTF_8 1
#define CONFIG_FATFS_FS_LOCK 0
#define CONFIG_FATFS_TIMEOUT_MS 10000
#define CONFIG_FATFS_PER_FILE_CACHE 1
@ -516,6 +524,23 @@
#define CONFIG_ESP_RMAKER_DEF_TIMEZONE "Asia/Shanghai"
#define CONFIG_ESP_RMAKER_SNTP_SERVER_NAME "pool.ntp.org"
#define CONFIG_ESP_RMAKER_MAX_COMMANDS 10
#define CONFIG_DIAG_LOG_MSG_ARG_FORMAT_TLV 1
#define CONFIG_DIAG_LOG_MSG_ARG_MAX_SIZE 64
#define CONFIG_DIAG_LOG_DROP_WIFI_LOGS 1
#define CONFIG_DIAG_ENABLE_METRICS 1
#define CONFIG_DIAG_METRICS_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_HEAP_METRICS 1
#define CONFIG_DIAG_ENABLE_WIFI_METRICS 1
#define CONFIG_DIAG_ENABLE_VARIABLES 1
#define CONFIG_DIAG_VARIABLES_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_NETWORK_VARIABLES 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS_HOST "https://client.insights.espressif.com"
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MIN_INTERVAL_SEC 60
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MAX_INTERVAL_SEC 240
#define CONFIG_RTC_STORE_DATA_SIZE 6144
#define CONFIG_RTC_STORE_CRITICAL_DATA_SIZE 4096
#define CONFIG_RTC_STORE_REPORTING_WATERMARK_PERCENT 80
#define CONFIG_DSP_ANSI 1
#define CONFIG_DSP_OPTIMIZATION 0
#define CONFIG_DSP_MAX_FFT_SIZE_4096 1
@ -638,5 +663,5 @@
#define CONFIG_USB_MSC_BUFSIZE CONFIG_TINYUSB_MSC_BUFSIZE
#define CONFIG_USB_MSC_ENABLED CONFIG_TINYUSB_MSC_ENABLED
#define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS
#define CONFIG_ARDUINO_IDF_COMMIT ""
#define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4"
#define CONFIG_ARDUINO_IDF_COMMIT "6407ecb3f8"
#define CONFIG_ARDUINO_IDF_BRANCH "v4.4.3"

View file

@ -53,11 +53,19 @@
#define CONFIG_PARTITION_TABLE_MD5 1
#define CONFIG_LIB_BUILDER_FLASHMODE "dout"
#define CONFIG_LIB_BUILDER_FLASHFREQ "80m"
#define CONFIG_LIB_BUILDER_COMPILE 1
#define CONFIG_ESP_RMAKER_SELF_CLAIM 1
#define CONFIG_ESP_RMAKER_CLAIM_TYPE 1
#define CONFIG_ESP_RMAKER_CLAIM_SERVICE_BASE_URL "https://esp-claiming.rainmaker.espressif.com"
#define CONFIG_ESP_RMAKER_MQTT_HOST "a1p72mufdu6064-ats.iot.us-east-1.amazonaws.com"
#define CONFIG_ESP_RMAKER_MQTT_USE_BASIC_INGEST_TOPICS 1
#define CONFIG_ESP_RMAKER_MQTT_ENABLE_BUDGETING 1
#define CONFIG_ESP_RMAKER_MQTT_DEFAULT_BUDGET 100
#define CONFIG_ESP_RMAKER_MQTT_MAX_BUDGET 1024
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_PERIOD 5
#define CONFIG_ESP_RMAKER_MQTT_BUDGET_REVIVE_COUNT 1
#define CONFIG_ESP_RMAKER_MAX_PARAM_DATA_SIZE 1024
#define CONFIG_ESP_RMAKER_USER_ID_CHECK 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM_0 1
#define CONFIG_ESP_RMAKER_CONSOLE_UART_NUM 0
#define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1
@ -249,7 +257,7 @@
#define CONFIG_FATFS_CODEPAGE 850
#define CONFIG_FATFS_LFN_STACK 1
#define CONFIG_FATFS_MAX_LFN 255
#define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1
#define CONFIG_FATFS_API_ENCODING_UTF_8 1
#define CONFIG_FATFS_FS_LOCK 0
#define CONFIG_FATFS_TIMEOUT_MS 10000
#define CONFIG_FATFS_PER_FILE_CACHE 1
@ -516,6 +524,23 @@
#define CONFIG_ESP_RMAKER_DEF_TIMEZONE "Asia/Shanghai"
#define CONFIG_ESP_RMAKER_SNTP_SERVER_NAME "pool.ntp.org"
#define CONFIG_ESP_RMAKER_MAX_COMMANDS 10
#define CONFIG_DIAG_LOG_MSG_ARG_FORMAT_TLV 1
#define CONFIG_DIAG_LOG_MSG_ARG_MAX_SIZE 64
#define CONFIG_DIAG_LOG_DROP_WIFI_LOGS 1
#define CONFIG_DIAG_ENABLE_METRICS 1
#define CONFIG_DIAG_METRICS_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_HEAP_METRICS 1
#define CONFIG_DIAG_ENABLE_WIFI_METRICS 1
#define CONFIG_DIAG_ENABLE_VARIABLES 1
#define CONFIG_DIAG_VARIABLES_MAX_COUNT 20
#define CONFIG_DIAG_ENABLE_NETWORK_VARIABLES 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS 1
#define CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS_HOST "https://client.insights.espressif.com"
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MIN_INTERVAL_SEC 60
#define CONFIG_ESP_INSIGHTS_CLOUD_POST_MAX_INTERVAL_SEC 240
#define CONFIG_RTC_STORE_DATA_SIZE 6144
#define CONFIG_RTC_STORE_CRITICAL_DATA_SIZE 4096
#define CONFIG_RTC_STORE_REPORTING_WATERMARK_PERCENT 80
#define CONFIG_DSP_ANSI 1
#define CONFIG_DSP_OPTIMIZATION 0
#define CONFIG_DSP_MAX_FFT_SIZE_4096 1
@ -638,5 +663,5 @@
#define CONFIG_USB_MSC_BUFSIZE CONFIG_TINYUSB_MSC_BUFSIZE
#define CONFIG_USB_MSC_ENABLED CONFIG_TINYUSB_MSC_ENABLED
#define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS
#define CONFIG_ARDUINO_IDF_COMMIT ""
#define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4"
#define CONFIG_ARDUINO_IDF_COMMIT "6407ecb3f8"
#define CONFIG_ARDUINO_IDF_BRANCH "v4.4.3"

View file

@ -193,7 +193,7 @@ typedef enum
}cdc_management_request_t;
//--------------------------------------------------------------------+
// Management Elemenent Notification (Notification Endpoint)
// Management Element Notification (Notification Endpoint)
//--------------------------------------------------------------------+
/// 6.3 Notification Codes

View file

@ -708,6 +708,7 @@ enum {
HID_USAGE_PAGE_MSR = 0x8e,
HID_USAGE_PAGE_CAMERA = 0x90,
HID_USAGE_PAGE_ARCADE = 0x91,
HID_USAGE_PAGE_FIDO = 0xF1D0, // FIDO alliance HID usage page
HID_USAGE_PAGE_VENDOR = 0xFF00 // 0xFF00 - 0xFFFF
};
@ -844,6 +845,14 @@ enum
HID_USAGE_CONSUMER_AC_PAN = 0x0238,
};
/// HID Usage Table: FIDO Alliance Page (0xF1D0)
enum
{
HID_USAGE_FIDO_U2FHID = 0x01, // U2FHID usage for top-level collection
HID_USAGE_FIDO_DATA_IN = 0x20, // Raw IN data report
HID_USAGE_FIDO_DATA_OUT = 0x21 // Raw OUT data report
};
/*--------------------------------------------------------------------
* ASCII to KEYCODE Conversion
* Expand to array of [128][2] (shift, keycode)

View file

@ -182,7 +182,7 @@ static inline bool tud_hid_gamepad_report(uint8_t report_id, int8_t x, int8_t y
HID_COLLECTION ( HID_COLLECTION_APPLICATION ) ,\
/* Report ID if any */\
__VA_ARGS__ \
/* 8 bits Modifier Keys (Shfit, Control, Alt) */ \
/* 8 bits Modifier Keys (Shift, Control, Alt) */ \
HID_USAGE_PAGE ( HID_USAGE_PAGE_KEYBOARD ) ,\
HID_USAGE_MIN ( 224 ) ,\
HID_USAGE_MAX ( 231 ) ,\
@ -352,6 +352,31 @@ static inline bool tud_hid_gamepad_report(uint8_t report_id, int8_t x, int8_t y
HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\
HID_COLLECTION_END \
// FIDO U2F Authenticator Descriptor Template
// - 1st parameter is report size, which is 64 bytes maximum in U2F
// - 2nd parameter is HID_REPORT_ID(n) (optional)
#define TUD_HID_REPORT_DESC_FIDO_U2F(report_size, ...) \
HID_USAGE_PAGE_N ( HID_USAGE_PAGE_FIDO, 2 ) ,\
HID_USAGE ( HID_USAGE_FIDO_U2FHID ) ,\
HID_COLLECTION ( HID_COLLECTION_APPLICATION ) ,\
/* Report ID if any */ \
__VA_ARGS__ \
/* Usage Data In */ \
HID_USAGE ( HID_USAGE_FIDO_DATA_IN ) ,\
HID_LOGICAL_MIN ( 0 ) ,\
HID_LOGICAL_MAX_N ( 0xff, 2 ) ,\
HID_REPORT_SIZE ( 8 ) ,\
HID_REPORT_COUNT ( report_size ) ,\
HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\
/* Usage Data Out */ \
HID_USAGE ( HID_USAGE_FIDO_DATA_OUT ) ,\
HID_LOGICAL_MIN ( 0 ) ,\
HID_LOGICAL_MAX_N ( 0xff, 2 ) ,\
HID_REPORT_SIZE ( 8 ) ,\
HID_REPORT_COUNT ( report_size ) ,\
HID_OUTPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\
HID_COLLECTION_END \
// HID Generic Input & Output
// - 1st parameter is report size (mandatory)
// - 2nd parameter is report id HID_REPORT_ID(n) (optional)

View file

@ -89,7 +89,7 @@ uint8_t tuh_hid_get_protocol(uint8_t dev_addr, uint8_t instance);
bool tuh_hid_set_protocol(uint8_t dev_addr, uint8_t instance, uint8_t protocol);
// Set Report using control endpoint
// report_type is either Intput, Output or Feature, (value from hid_report_type_t)
// report_type is either Input, Output or Feature, (value from hid_report_type_t)
bool tuh_hid_set_report(uint8_t dev_addr, uint8_t instance, uint8_t report_id, uint8_t report_type, void* report, uint16_t len);
//--------------------------------------------------------------------+

View file

@ -41,7 +41,14 @@
#define CFG_TUH_MSC_MAXLUN 4
#endif
typedef bool (*tuh_msc_complete_cb_t)(uint8_t dev_addr, msc_cbw_t const* cbw, msc_csw_t const* csw);
typedef struct {
msc_cbw_t const* cbw; // SCSI command
msc_csw_t const* csw; // SCSI status
void* scsi_data; // SCSI Data
uintptr_t user_arg; // user argument
}tuh_msc_complete_data_t;
typedef bool (*tuh_msc_complete_cb_t)(uint8_t dev_addr, tuh_msc_complete_data_t const* cb_data);
//--------------------------------------------------------------------+
// Application API
@ -66,33 +73,33 @@ uint32_t tuh_msc_get_block_size(uint8_t dev_addr, uint8_t lun);
// Perform a full SCSI command (cbw, data, csw) in non-blocking manner.
// Complete callback is invoked when SCSI op is complete.
// return true if success, false if there is already pending operation.
bool tuh_msc_scsi_command(uint8_t dev_addr, msc_cbw_t const* cbw, void* data, tuh_msc_complete_cb_t complete_cb);
bool tuh_msc_scsi_command(uint8_t dev_addr, msc_cbw_t const* cbw, void* data, tuh_msc_complete_cb_t complete_cb, uintptr_t arg);
// Perform SCSI Inquiry command
// Complete callback is invoked when SCSI op is complete.
bool tuh_msc_inquiry(uint8_t dev_addr, uint8_t lun, scsi_inquiry_resp_t* response, tuh_msc_complete_cb_t complete_cb);
bool tuh_msc_inquiry(uint8_t dev_addr, uint8_t lun, scsi_inquiry_resp_t* response, tuh_msc_complete_cb_t complete_cb, uintptr_t arg);
// Perform SCSI Test Unit Ready command
// Complete callback is invoked when SCSI op is complete.
bool tuh_msc_test_unit_ready(uint8_t dev_addr, uint8_t lun, tuh_msc_complete_cb_t complete_cb);
bool tuh_msc_test_unit_ready(uint8_t dev_addr, uint8_t lun, tuh_msc_complete_cb_t complete_cb, uintptr_t arg);
// Perform SCSI Request Sense 10 command
// Complete callback is invoked when SCSI op is complete.
bool tuh_msc_request_sense(uint8_t dev_addr, uint8_t lun, void *resposne, tuh_msc_complete_cb_t complete_cb);
bool tuh_msc_request_sense(uint8_t dev_addr, uint8_t lun, void *response, tuh_msc_complete_cb_t complete_cb, uintptr_t arg);
// Perform SCSI Read 10 command. Read n blocks starting from LBA to buffer
// Complete callback is invoked when SCSI op is complete.
bool tuh_msc_read10(uint8_t dev_addr, uint8_t lun, void * buffer, uint32_t lba, uint16_t block_count, tuh_msc_complete_cb_t complete_cb);
bool tuh_msc_read10(uint8_t dev_addr, uint8_t lun, void * buffer, uint32_t lba, uint16_t block_count, tuh_msc_complete_cb_t complete_cb, uintptr_t arg);
// Perform SCSI Write 10 command. Write n blocks starting from LBA to device
// Complete callback is invoked when SCSI op is complete.
bool tuh_msc_write10(uint8_t dev_addr, uint8_t lun, void const * buffer, uint32_t lba, uint16_t block_count, tuh_msc_complete_cb_t complete_cb);
bool tuh_msc_write10(uint8_t dev_addr, uint8_t lun, void const * buffer, uint32_t lba, uint16_t block_count, tuh_msc_complete_cb_t complete_cb, uintptr_t arg);
// Perform SCSI Read Capacity 10 command
// Complete callback is invoked when SCSI op is complete.
// Note: during enumeration, host stack already carried out this request. Application can retrieve capacity by
// simply call tuh_msc_get_block_count() and tuh_msc_get_block_size()
bool tuh_msc_read_capacity(uint8_t dev_addr, uint8_t lun, scsi_read_capacity10_resp_t* response, tuh_msc_complete_cb_t complete_cb);
bool tuh_msc_read_capacity(uint8_t dev_addr, uint8_t lun, scsi_read_capacity10_resp_t* response, tuh_msc_complete_cb_t complete_cb, uintptr_t arg);
//------------- Application Callback -------------//

View file

@ -158,7 +158,7 @@ enum {
USBTMC_BULK_IN_ERR_DATA_TOO_SHORT = 4u,
USBTMC_BULK_IN_ERR_DATA_TOO_LONG = 5u,
};
// bult-in halt errors
// built-in halt errors
enum {
USBTMC_BULK_IN_ERR = 1u, ///< receives a USBTMC command message that expects a response while a
/// Bulk-IN transfer is in progress

View file

@ -36,7 +36,7 @@
#endif
/***********************************************
* Functions to be implemeted by the class implementation
* Functions to be implemented by the class implementation
*/
// In order to proceed, app must call call tud_usbtmc_start_bus_read(rhport) during or soon after:

View file

@ -32,7 +32,7 @@
extern "C" {
#endif
// Due to the use of unmasked pointers, this FIFO does not suffer from loosing
// Due to the use of unmasked pointers, this FIFO does not suffer from losing
// one item slice. Furthermore, write and read operations are completely
// decoupled as write and read functions do not modify a common state. Henceforth,
// writing or reading from the FIFO within an ISR is safe as long as no other
@ -133,7 +133,7 @@ uint16_t tu_fifo_depth(tu_fifo_t* f)
}
// Pointer modifications intended to be used in combinations with DMAs.
// USE WITH CARE - NO SAFTY CHECKS CONDUCTED HERE! NOT MUTEX PROTECTED!
// USE WITH CARE - NO SAFETY CHECKS CONDUCTED HERE! NOT MUTEX PROTECTED!
void tu_fifo_advance_write_pointer(tu_fifo_t *f, uint16_t n);
void tu_fifo_advance_read_pointer (tu_fifo_t *f, uint16_t n);

View file

@ -225,7 +225,7 @@ enum {
typedef enum
{
XFER_RESULT_SUCCESS,
XFER_RESULT_SUCCESS = 0,
XFER_RESULT_FAILED,
XFER_RESULT_STALLED,
XFER_RESULT_TIMEOUT,

View file

@ -308,15 +308,16 @@ TU_ATTR_WEAK bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb
(uint8_t)(((_cablenum) - 1) * 4 + 4)
#define TUD_MIDI_DESC_JACK_LEN (6 + 6 + 9 + 9)
#define TUD_MIDI_DESC_JACK(_cablenum) \
#define TUD_MIDI_DESC_JACK_DESC(_cablenum, _stridx) \
/* MS In Jack (Embedded) */\
6, TUSB_DESC_CS_INTERFACE, MIDI_CS_INTERFACE_IN_JACK, MIDI_JACK_EMBEDDED, TUD_MIDI_JACKID_IN_EMB(_cablenum), 0,\
6, TUSB_DESC_CS_INTERFACE, MIDI_CS_INTERFACE_IN_JACK, MIDI_JACK_EMBEDDED, TUD_MIDI_JACKID_IN_EMB(_cablenum), _stridx,\
/* MS In Jack (External) */\
6, TUSB_DESC_CS_INTERFACE, MIDI_CS_INTERFACE_IN_JACK, MIDI_JACK_EXTERNAL, TUD_MIDI_JACKID_IN_EXT(_cablenum), 0,\
6, TUSB_DESC_CS_INTERFACE, MIDI_CS_INTERFACE_IN_JACK, MIDI_JACK_EXTERNAL, TUD_MIDI_JACKID_IN_EXT(_cablenum), _stridx,\
/* MS Out Jack (Embedded), connected to In Jack External */\
9, TUSB_DESC_CS_INTERFACE, MIDI_CS_INTERFACE_OUT_JACK, MIDI_JACK_EMBEDDED, TUD_MIDI_JACKID_OUT_EMB(_cablenum), 1, TUD_MIDI_JACKID_IN_EXT(_cablenum), 1, 0,\
9, TUSB_DESC_CS_INTERFACE, MIDI_CS_INTERFACE_OUT_JACK, MIDI_JACK_EMBEDDED, TUD_MIDI_JACKID_OUT_EMB(_cablenum), 1, TUD_MIDI_JACKID_IN_EXT(_cablenum), 1, _stridx,\
/* MS Out Jack (External), connected to In Jack Embedded */\
9, TUSB_DESC_CS_INTERFACE, MIDI_CS_INTERFACE_OUT_JACK, MIDI_JACK_EXTERNAL, TUD_MIDI_JACKID_OUT_EXT(_cablenum), 1, TUD_MIDI_JACKID_IN_EMB(_cablenum), 1, 0
9, TUSB_DESC_CS_INTERFACE, MIDI_CS_INTERFACE_OUT_JACK, MIDI_JACK_EXTERNAL, TUD_MIDI_JACKID_OUT_EXT(_cablenum), 1, TUD_MIDI_JACKID_IN_EMB(_cablenum), 1, _stridx
#define TUD_MIDI_DESC_JACK(_cablenum) TUD_MIDI_DESC_JACK_DESC(_cablenum, 0)
#define TUD_MIDI_DESC_EP_LEN(_numcables) (9 + 4 + (_numcables))
#define TUD_MIDI_DESC_EP(_epout, _epsize, _numcables) \
@ -333,7 +334,7 @@ TU_ATTR_WEAK bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb
// - 1 Embedded Jack out connected to 1 External Jack In
#define TUD_MIDI_DESCRIPTOR(_itfnum, _stridx, _epout, _epin, _epsize) \
TUD_MIDI_DESC_HEAD(_itfnum, _stridx, 1),\
TUD_MIDI_DESC_JACK(1),\
TUD_MIDI_DESC_JACK_DESC(1, 0),\
TUD_MIDI_DESC_EP(_epout, _epsize, 1),\
TUD_MIDI_JACKID_IN_EMB(1),\
TUD_MIDI_DESC_EP(_epin, _epsize, 1),\
@ -602,7 +603,7 @@ TU_ATTR_WEAK bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb
/* optional interrupt endpoint */ \
// _int_pollingInterval : for LS/FS, expressed in frames (1ms each). 16 may be a good number?
#define TUD_USBTMC_INT_DESCRIPTOR(_ep_interrupt, _ep_interrupt_size, _int_pollingInterval ) \
7, TUSB_DESC_ENDPOINT, _ep_interrupt, TUSB_XFER_INTERRUPT, U16_TO_U8S_LE(_ep_interrupt_size), 0x16
7, TUSB_DESC_ENDPOINT, _ep_interrupt, TUSB_XFER_INTERRUPT, U16_TO_U8S_LE(_ep_interrupt_size), _int_pollingInterval
#define TUD_USBTMC_INT_DESCRIPTOR_LEN (7u)
@ -647,7 +648,7 @@ TU_ATTR_WEAK bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb
#define TUD_DFU_DESC_LEN(_alt_count) (9 + (_alt_count) * 9)
// Interface number, Alternate count, starting string index, attributes, detach timeout, transfer size
// Note: Alternate count must be numberic or macro, string index is increased by one for each Alt interface
// Note: Alternate count must be numeric or macro, string index is increased by one for each Alt interface
#define TUD_DFU_DESCRIPTOR(_itfnum, _alt_count, _stridx, _attr, _timeout, _xfer_size) \
TU_XSTRCAT(_TUD_DFU_ALT_,_alt_count)(_itfnum, 0, _stridx), \
/* Function */ \

View file

@ -51,14 +51,15 @@ struct tuh_xfer_s
{
uint8_t daddr;
uint8_t ep_addr;
uint8_t TU_RESERVED; // reserved
xfer_result_t result;
uint32_t actual_len; // excluding setup packet
union
{
tusb_control_request_t const* setup; // setup packet pointer if control transfer
uint32_t buflen; // expected length if not control transfer (not available in callback)
uint32_t buflen; // expected length if not control transfer (not available in callback)
};
uint8_t* buffer; // not available in callback if not control transfer
@ -71,7 +72,7 @@ struct tuh_xfer_s
// ConfigID for tuh_config()
enum
{
TUH_CFGID_RPI_PIO_USB_CONFIGURATION = OPT_MCU_RP2040 // cfg_param: pio_usb_configuration_t
TUH_CFGID_RPI_PIO_USB_CONFIGURATION = OPT_MCU_RP2040 << 8 // cfg_param: pio_usb_configuration_t
};
//--------------------------------------------------------------------+
@ -80,10 +81,13 @@ enum
//TU_ATTR_WEAK uint8_t tuh_attach_cb (tusb_desc_device_t const *desc_device);
// Invoked when device is mounted (configured)
// Invoked when a device is mounted (configured)
TU_ATTR_WEAK void tuh_mount_cb (uint8_t daddr);
/// Invoked when device is unmounted (bus reset/unplugged)
// Invoked when a device failed to mount during enumeration process
// TU_ATTR_WEAK void tuh_mount_failed_cb (uint8_t daddr);
/// Invoked when a device is unmounted (detached)
TU_ATTR_WEAK void tuh_umount_cb(uint8_t daddr);
//--------------------------------------------------------------------+

View file

@ -37,6 +37,43 @@
extern "C" {
#endif
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF PROTYPES
//--------------------------------------------------------------------+
#if configSUPPORT_STATIC_ALLOCATION
typedef StaticSemaphore_t osal_semaphore_def_t;
typedef StaticSemaphore_t osal_mutex_def_t;
#else
// not used therefore defined to smallest possible type to save space
typedef uint8_t osal_semaphore_def_t;
typedef uint8_t osal_mutex_def_t;
#endif
typedef SemaphoreHandle_t osal_semaphore_t;
typedef SemaphoreHandle_t osal_mutex_t;
// _int_set is not used with an RTOS
#define OSAL_QUEUE_DEF(_int_set, _name, _depth, _type) \
static _type _name##_##buf[_depth];\
osal_queue_def_t _name = { .depth = _depth, .item_sz = sizeof(_type), .buf = _name##_##buf };
typedef struct
{
uint16_t depth;
uint16_t item_sz;
void* buf;
#if configSUPPORT_STATIC_ALLOCATION
StaticQueue_t sq;
#endif
}osal_queue_def_t;
typedef QueueHandle_t osal_queue_t;
//--------------------------------------------------------------------+
// TASK API
//--------------------------------------------------------------------+
TU_ATTR_ALWAYS_INLINE static inline uint32_t _osal_ms2tick(uint32_t msec)
{
if (msec == OSAL_TIMEOUT_WAIT_FOREVER) return portMAX_DELAY;
@ -51,9 +88,6 @@ TU_ATTR_ALWAYS_INLINE static inline uint32_t _osal_ms2tick(uint32_t msec)
return ticks;
}
//--------------------------------------------------------------------+
// TASK API
//--------------------------------------------------------------------+
TU_ATTR_ALWAYS_INLINE static inline void osal_task_delay(uint32_t msec)
{
vTaskDelay( pdMS_TO_TICKS(msec) );
@ -62,12 +96,15 @@ TU_ATTR_ALWAYS_INLINE static inline void osal_task_delay(uint32_t msec)
//--------------------------------------------------------------------+
// Semaphore API
//--------------------------------------------------------------------+
typedef StaticSemaphore_t osal_semaphore_def_t;
typedef SemaphoreHandle_t osal_semaphore_t;
TU_ATTR_ALWAYS_INLINE static inline osal_semaphore_t osal_semaphore_create(osal_semaphore_def_t* semdef)
{
#if configSUPPORT_STATIC_ALLOCATION
return xSemaphoreCreateBinaryStatic(semdef);
#else
(void) semdef;
return xSemaphoreCreateBinary();
#endif
}
TU_ATTR_ALWAYS_INLINE static inline bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr)
@ -92,7 +129,7 @@ TU_ATTR_ALWAYS_INLINE static inline bool osal_semaphore_post(osal_semaphore_t se
}
}
TU_ATTR_ALWAYS_INLINE static inline bool osal_semaphore_wait (osal_semaphore_t sem_hdl, uint32_t msec)
TU_ATTR_ALWAYS_INLINE static inline bool osal_semaphore_wait(osal_semaphore_t sem_hdl, uint32_t msec)
{
return xSemaphoreTake(sem_hdl, _osal_ms2tick(msec));
}
@ -105,15 +142,18 @@ TU_ATTR_ALWAYS_INLINE static inline void osal_semaphore_reset(osal_semaphore_t c
//--------------------------------------------------------------------+
// MUTEX API (priority inheritance)
//--------------------------------------------------------------------+
typedef StaticSemaphore_t osal_mutex_def_t;
typedef SemaphoreHandle_t osal_mutex_t;
TU_ATTR_ALWAYS_INLINE static inline osal_mutex_t osal_mutex_create(osal_mutex_def_t* mdef)
{
#if configSUPPORT_STATIC_ALLOCATION
return xSemaphoreCreateMutexStatic(mdef);
#else
(void) mdef;
return xSemaphoreCreateMutex();
#endif
}
TU_ATTR_ALWAYS_INLINE static inline bool osal_mutex_lock (osal_mutex_t mutex_hdl, uint32_t msec)
TU_ATTR_ALWAYS_INLINE static inline bool osal_mutex_lock(osal_mutex_t mutex_hdl, uint32_t msec)
{
return osal_semaphore_wait(mutex_hdl, msec);
}
@ -127,25 +167,13 @@ TU_ATTR_ALWAYS_INLINE static inline bool osal_mutex_unlock(osal_mutex_t mutex_hd
// QUEUE API
//--------------------------------------------------------------------+
// _int_set is not used with an RTOS
#define OSAL_QUEUE_DEF(_int_set, _name, _depth, _type) \
static _type _name##_##buf[_depth];\
osal_queue_def_t _name = { .depth = _depth, .item_sz = sizeof(_type), .buf = _name##_##buf };
typedef struct
{
uint16_t depth;
uint16_t item_sz;
void* buf;
StaticQueue_t sq;
}osal_queue_def_t;
typedef QueueHandle_t osal_queue_t;
TU_ATTR_ALWAYS_INLINE static inline osal_queue_t osal_queue_create(osal_queue_def_t* qdef)
{
return xQueueCreateStatic(qdef->depth, qdef->item_sz, (uint8_t*) qdef->buf, &qdef->sq);
#if configSUPPORT_STATIC_ALLOCATION
return xQueueCreateStatic(qdef->depth, qdef->item_sz, (uint8_t*) qdef->buf, &qdef->sq);
#else
return xQueueCreate(qdef->depth, qdef->item_sz);
#endif
}
TU_ATTR_ALWAYS_INLINE static inline bool osal_queue_receive(osal_queue_t qhdl, void* data, uint32_t msec)

View file

@ -114,7 +114,7 @@ typedef struct
volatile uint32_t current_page : 3 ; ///< Index into the qTD buffer pointer list
uint32_t int_on_complete : 1 ; ///< Interrupt on complete
volatile uint32_t total_bytes : 15 ; ///< Transfer bytes, decreased during transaction
volatile uint32_t data_toggle : 1 ; ///< Data Toogle bit
volatile uint32_t data_toggle : 1 ; ///< Data Toggle bit
/// Buffer Page Pointer List, Each element in the list is a 4K page aligned, physical memory address. The lower 12 bits in each pointer are reserved (except for the first one) as each memory pointer must reference the start of a 4K page
@ -160,7 +160,7 @@ typedef struct TU_ATTR_ALIGNED(32)
uint8_t used;
uint8_t removing; // removed from asyn list, waiting for async advance
uint8_t pid;
uint8_t interval_ms; // polling interval in frames (or milisecond)
uint8_t interval_ms; // polling interval in frames (or millisecond)
uint16_t total_xferred_bytes; // number of bytes xferred until a qtd with ioc bit set
uint8_t reserved2[2];
@ -225,7 +225,7 @@ typedef struct TU_ATTR_ALIGNED(32)
uint16_t reserved ; ///< reserved
// Word 3: siTD Transfer Status and Control
// Status [7:0] TODO indentical to qTD Token'status --> refractor later
// Status [7:0] TODO identical to qTD Token'status --> refactor later
volatile uint32_t : 1 ; // reserved
volatile uint32_t split_state : 1 ;
volatile uint32_t missed_uframe : 1 ;
@ -350,8 +350,8 @@ typedef volatile struct
uint32_t periodic_status : 1 ; ///< Periodic schedule status
uint32_t async_status : 1 ; ///< Async schedule status
uint32_t : 2 ;
uint32_t nxp_int_async : 1 ; ///< NXP customized: This bit is set by the Host Controller when the cause of an interrupt is a completion of a USB transaction where the Transfer Descriptor (TD) has an interrupt on complete (IOC) bit set andthe TD was from the asynchronous schedule. This bit is also set by the Host when a short packet is detected andthe packet is on the asynchronous schedule.
uint32_t nxp_int_period : 1 ; ///< NXP customized: This bit is set by the Host Controller when the cause of an interrupt is a completion of a USB transaction where the Transfer Descriptor (TD) has an interrupt on complete (IOC) bit set andthe TD was from the periodic schedule.
uint32_t nxp_int_async : 1 ; ///< NXP customized: This bit is set by the Host Controller when the cause of an interrupt is a completion of a USB transaction where the Transfer Descriptor (TD) has an interrupt on complete (IOC) bit set and the TD was from the asynchronous schedule. This bit is also set by the Host when a short packet is detected and the packet is on the asynchronous schedule.
uint32_t nxp_int_period : 1 ; ///< NXP customized: This bit is set by the Host Controller when the cause of an interrupt is a completion of a USB transaction where the Transfer Descriptor (TD) has an interrupt on complete (IOC) bit set and the TD was from the periodic schedule.
uint32_t : 12 ;
}status_bm;
};

View file

@ -21,16 +21,16 @@
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
*******************************************************************************/
/*******************************************************************************
USBHS Peripheral Library Register Defintions
USBHS Peripheral Library Register Definitions
File Name:
usbhs_registers.h
Summary:
USBHS PLIB Register Defintions
USBHS PLIB Register Definitions
Description:
This file contains the constants and defintions which are required by the
This file contains the constants and definitions which are required by the
the USBHS library.
*******************************************************************************/

View file

@ -34,7 +34,7 @@
//--------------------------------------------------------------------+
// OHCI CONFIGURATION & CONSTANTS
//--------------------------------------------------------------------+
#define HOST_HCD_XFER_INTERRUPT // TODO interrupt is used widely, should always be enalbed
#define HOST_HCD_XFER_INTERRUPT // TODO interrupt is used widely, should always be enabled
#define OHCI_PERIODIC_LIST (defined HOST_HCD_XFER_INTERRUPT || defined HOST_HCD_XFER_ISOCHRONOUS)
// TODO merge OHCI with EHCI

View file

@ -82,26 +82,30 @@ void hw_endpoint_reset_transfer(struct hw_endpoint *ep);
void _hw_endpoint_buffer_control_update32(struct hw_endpoint *ep, uint32_t and_mask, uint32_t or_mask);
TU_ATTR_ALWAYS_INLINE static inline uint32_t _hw_endpoint_buffer_control_get_value32(struct hw_endpoint *ep) {
return *ep->buffer_control;
}
TU_ATTR_ALWAYS_INLINE static inline void _hw_endpoint_buffer_control_set_value32(struct hw_endpoint *ep, uint32_t value) {
return _hw_endpoint_buffer_control_update32(ep, 0, value);
}
TU_ATTR_ALWAYS_INLINE static inline void _hw_endpoint_buffer_control_set_mask32(struct hw_endpoint *ep, uint32_t value) {
return _hw_endpoint_buffer_control_update32(ep, ~value, value);
}
TU_ATTR_ALWAYS_INLINE static inline void _hw_endpoint_buffer_control_clear_mask32(struct hw_endpoint *ep, uint32_t value) {
return _hw_endpoint_buffer_control_update32(ep, ~value, 0);
}
static inline uintptr_t hw_data_offset(uint8_t *buf)
TU_ATTR_ALWAYS_INLINE static inline uint32_t _hw_endpoint_buffer_control_get_value32 (struct hw_endpoint *ep)
{
// Remove usb base from buffer pointer
return (uintptr_t)buf ^ (uintptr_t)usb_dpram;
return *ep->buffer_control;
}
TU_ATTR_ALWAYS_INLINE static inline void _hw_endpoint_buffer_control_set_value32 (struct hw_endpoint *ep, uint32_t value)
{
return _hw_endpoint_buffer_control_update32(ep, 0, value);
}
TU_ATTR_ALWAYS_INLINE static inline void _hw_endpoint_buffer_control_set_mask32 (struct hw_endpoint *ep, uint32_t value)
{
return _hw_endpoint_buffer_control_update32(ep, ~value, value);
}
TU_ATTR_ALWAYS_INLINE static inline void _hw_endpoint_buffer_control_clear_mask32 (struct hw_endpoint *ep, uint32_t value)
{
return _hw_endpoint_buffer_control_update32(ep, ~value, 0);
}
static inline uintptr_t hw_data_offset (uint8_t *buf)
{
// Remove usb base from buffer pointer
return (uintptr_t) buf ^ (uintptr_t) usb_dpram;
}
extern const char *ep_dir_string[];

View file

@ -98,6 +98,10 @@
#undef USB_PMAADDR
#define USB_PMAADDR USB1_PMAADDR
#elif CFG_TUSB_MCU == OPT_MCU_STM32L4
#include "stm32l4xx.h"
#define PMA_LENGTH (1024u)
#else
#error You are using an untested or unimplemented STM32 variant. Please update the driver.
// This includes L1x0, L1x1, L1x2, L4x2 and L4x3, G1x1, G1x3, and G1x4

Some files were not shown because too many files have changed in this diff Show more