Closed lyh20190329 closed 2 years ago
my config like this:
#
# CONFIG_SOC_ADC_SUPPORTED=y CONFIG_SOC_DEDICATED_GPIO_SUPPORTED=y CONFIG_SOC_GDMA_SUPPORTED=y CONFIG_SOC_BT_SUPPORTED=y CONFIG_SOC_ESP_NIMBLE_CONTROLLER=y CONFIG_SOC_WIFI_SUPPORTED=y CONFIG_SOC_ASYNC_MEMCPY_SUPPORTED=y CONFIG_SOC_SUPPORTS_SECURE_DL_MODE=y CONFIG_SOC_EFUSE_CONSISTS_OF_ONE_KEY_BLOCK=y CONFIG_SOC_TEMP_SENSOR_SUPPORTED=y CONFIG_SOC_SHA_SUPPORTED=y CONFIG_SOC_ECC_SUPPORTED=y CONFIG_SOC_FLASH_ENC_SUPPORTED=y CONFIG_SOC_SECURE_BOOT_SUPPORTED=y CONFIG_SOC_SYSTIMER_SUPPORTED=y CONFIG_SOC_XTAL_SUPPORT_26M=y CONFIG_SOC_XTAL_SUPPORT_40M=y CONFIG_SOC_ADC_DIG_CTRL_SUPPORTED=y CONFIG_SOC_ADC_FILTER_SUPPORTED=y CONFIG_SOC_ADC_MONITOR_SUPPORTED=y CONFIG_SOC_ADC_PERIPH_NUM=1 CONFIG_SOC_ADC_MAX_CHANNEL_NUM=5 CONFIG_SOC_ADC_ATTEN_NUM=4 CONFIG_SOC_ADC_DIGI_CONTROLLER_NUM=1 CONFIG_SOC_ADC_PATT_LEN_MAX=8 CONFIG_SOC_ADC_DIGI_MIN_BITWIDTH=12 CONFIG_SOC_ADC_DIGI_MAX_BITWIDTH=12 CONFIG_SOC_ADC_DIGI_FILTER_NUM=2 CONFIG_SOC_ADC_DIGI_MONITOR_NUM=2 CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_HIGH=83333 CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_LOW=611 CONFIG_SOC_ADC_RTC_MIN_BITWIDTH=12 CONFIG_SOC_ADC_RTC_MAX_BITWIDTH=12 CONFIG_SOC_RTC_SLOW_CLOCK_SUPPORT_8MD256=y CONFIG_SOC_BROWNOUT_RESET_SUPPORTED=y CONFIG_SOC_SHARED_IDCACHE_SUPPORTED=y CONFIG_SOC_CPU_CORES_NUM=1 CONFIG_SOC_CPU_INTR_NUM=32 CONFIG_SOC_CPU_HAS_FLEXIBLE_INTC=y CONFIG_SOC_CPU_BREAKPOINTS_NUM=2 CONFIG_SOC_CPU_WATCHPOINTS_NUM=2 CONFIG_SOC_CPU_WATCHPOINT_SIZE=0x80000000 CONFIG_SOC_CPU_IDRAM_SPLIT_USING_PMP=y CONFIG_SOC_GDMA_GROUPS=1 CONFIG_SOC_GDMA_PAIRS_PER_GROUP=1 CONFIG_SOC_GDMA_TX_RX_SHARE_INTERRUPT=y CONFIG_SOC_GPIO_PORT=1 CONFIG_SOC_GPIO_PIN_COUNT=21 CONFIG_SOC_GPIO_SUPPORTS_RTC_INDEPENDENT=y CONFIG_SOC_GPIO_SUPPORT_FORCE_HOLD=y CONFIG_SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP=y CONFIG_SOC_GPIO_DEEP_SLEEP_WAKE_VALID_GPIO_MASK=0 CONFIG_SOC_GPIO_SUPPORT_SLP_SWITCH=y CONFIG_SOC_DEDIC_GPIO_OUT_CHANNELS_NUM=8 CONFIG_SOC_DEDIC_GPIO_IN_CHANNELS_NUM=8 CONFIG_SOC_DEDIC_PERIPH_ALWAYS_ENABLE=y CONFIG_SOC_I2C_NUM=1 CONFIG_SOC_I2C_FIFO_LEN=32 CONFIG_SOC_I2C_SUPPORT_HW_CLR_BUS=y CONFIG_SOC_I2C_SUPPORT_XTAL=y CONFIG_SOC_I2C_SUPPORT_RTC=y CONFIG_SOC_LEDC_SUPPORT_PLL_DIV_CLOCK=y CONFIG_SOC_LEDC_SUPPORT_XTAL_CLOCK=y CONFIG_SOC_LEDC_CHANNEL_NUM=6 CONFIG_SOC_LEDC_TIMER_BIT_WIDE_NUM=14 CONFIG_SOC_LEDC_SUPPORT_FADE_STOP=y CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000 CONFIG_SOC_MPU_REGIONS_MAX_NUM=8 CONFIG_SOC_RTC_CNTL_CPU_PD_DMA_BUS_WIDTH=128 CONFIG_SOC_RTC_CNTL_CPU_PD_REG_FILE_NUM=108 CONFIG_SOC_RTCIO_PIN_COUNT=0 CONFIG_SOC_RSA_MAX_BIT_LEN=3072 CONFIG_SOC_SHA_SUPPORT_RESUME=y CONFIG_SOC_SHA_SUPPORT_SHA1=y CONFIG_SOC_SHA_SUPPORT_SHA224=y CONFIG_SOC_SHA_SUPPORT_SHA256=y CONFIG_SOC_SPI_PERIPH_NUM=2 CONFIG_SOC_SPI_MAXIMUM_BUFFER_SIZE=64 CONFIG_SOC_SPI_SUPPORT_DDRCLK=y CONFIG_SOC_SPI_SLAVE_SUPPORT_SEG_TRANS=y CONFIG_SOC_SPI_SUPPORT_CD_SIG=y CONFIG_SOC_SPI_SUPPORT_CONTINUOUS_TRANS=y CONFIG_SOC_SPI_SUPPORT_SLAVE_HD_VER2=y CONFIG_SOC_SPI_PERIPH_SUPPORT_CONTROL_DUMMY_OUT=y CONFIG_SOC_MEMSPI_IS_INDEPENDENT=y CONFIG_SOC_SPI_MAX_PRE_DIVIDER=16 CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_WAIT_IDLE=y CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_SUSPEND=y CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_RESUME=y CONFIG_SOC_SPI_MEM_SUPPORT_IDLE_INTR=y CONFIG_SOC_SPI_MEM_SUPPORT_SW_SUSPEND=y CONFIG_SOC_SPI_MEM_SUPPORT_CHECK_SUS=y CONFIG_SOC_MEMSPI_SRC_FREQ_60M_SUPPORTED=y CONFIG_SOC_MEMSPI_SRC_FREQ_30M_SUPPORTED=y CONFIG_SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED=y CONFIG_SOC_MEMSPI_SRC_FREQ_15M_SUPPORTED=y CONFIG_SOC_SYSTIMER_COUNTER_NUM=2 CONFIG_SOC_SYSTIMER_ALARM_NUM=3 CONFIG_SOC_SYSTIMER_BIT_WIDTH_LO=32 CONFIG_SOC_SYSTIMER_BIT_WIDTH_HI=20 CONFIG_SOC_SYSTIMER_FIXED_DIVIDER=y CONFIG_SOC_SYSTIMER_INT_LEVEL=y CONFIG_SOC_SYSTIMER_ALARM_MISS_COMPENSATE=y CONFIG_SOC_TIMER_GROUPS=1 CONFIG_SOC_TIMER_GROUP_TIMERS_PER_GROUP=1 CONFIG_SOC_TIMER_GROUP_COUNTER_BIT_WIDTH=54 CONFIG_SOC_TIMER_GROUP_SUPPORT_XTAL=y CONFIG_SOC_TIMER_GROUP_SUPPORT_PLL_F40M=y CONFIG_SOC_TIMER_GROUP_TOTAL_TIMERS=1 CONFIG_SOC_SECURE_BOOT_V2_ECC=y CONFIG_SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS=1 CONFIG_SOC_FLASH_ENCRYPTED_XTS_AES_BLOCK_MAX=32 CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES=y CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_OPTIONS=y CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_128=y CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_128_DERIVED=y CONFIG_SOC_UART_NUM=2 CONFIG_SOC_UART_FIFO_LEN=128 CONFIG_SOC_UART_BITRATE_MAX=5000000 CONFIG_SOC_UART_SUPPORT_WAKEUP_INT=y CONFIG_SOC_UART_SUPPORT_RTC_CLK=y CONFIG_SOC_UART_SUPPORT_XTAL_CLK=y CONFIG_SOC_UART_SUPPORT_FSM_TX_WAIT_SEND=y CONFIG_SOC_COEX_HW_PTI=y CONFIG_SOC_PHY_DIG_REGS_MEM_SIZE=21 CONFIG_SOC_MAC_BB_PD_MEM_SIZE=192 CONFIG_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH=12 CONFIG_SOC_PM_SUPPORT_WIFI_WAKEUP=y CONFIG_SOC_PM_SUPPORT_BT_WAKEUP=y CONFIG_SOC_MMU_PAGE_SIZE_CONFIGURABLE=y CONFIG_SOC_WIFI_HW_TSF=y CONFIG_IDF_CMAKE=y CONFIG_IDF_TARGET_ARCH_RISCV=y CONFIG_IDF_TARGET_ARCH="riscv" CONFIG_IDF_TARGET="esp32c2" CONFIG_IDF_TARGET_ESP32C2=y CONFIG_IDF_FIRMWARE_CHIP_ID=0x000C
#
# CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y
CONFIG_APP_BUILD_GENERATE_BINARIES=y CONFIG_APP_BUILD_BOOTLOADER=y CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y
#
# CONFIG_APP_COMPILE_TIME_DATE=y
CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16
#
# CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x0 CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y
CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y
CONFIG_BOOTLOADER_LOG_LEVEL=3
CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y
CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y CONFIG_BOOTLOADER_WDT_ENABLE=y
CONFIG_BOOTLOADER_WDT_TIME_MS=9000
CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y
#
# CONFIG_SECURE_BOOT_V2_ECC_SUPPORTED=y CONFIG_SECURE_BOOT_V2_PREFERRED=y
CONFIG_SECURE_ROM_DL_MODE_ENABLED=y
CONFIG_ESP_ROM_HAS_CRC_LE=y CONFIG_ESP_ROM_HAS_CRC_BE=y CONFIG_ESP_ROM_UART_CLK_IS_XTAL=y CONFIG_ESP_ROM_HAS_RETARGETABLE_LOCKING=y CONFIG_ESP_ROM_GET_CLK_FREQ=y CONFIG_ESP_ROM_HAS_RVFPLIB=y CONFIG_ESP_ROM_HAS_HAL_WDT=y CONFIG_ESP_ROM_HAS_HAL_SYSTIMER=y CONFIG_ESP_ROM_HAS_HEAP_TLSF=y
#
# CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y
#
#
CONFIG_ESPTOOLPY_FLASHMODE_DIO=y
CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" CONFIG_ESPTOOLPY_FLASHFREQ_60M=y
CONFIG_ESPTOOLPY_FLASHFREQ="60m"
CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="2MB"
CONFIG_ESPTOOLPY_BEFORE_RESET=y
CONFIG_ESPTOOLPY_BEFORE="default_reset" CONFIG_ESPTOOLPY_AFTER_RESET=y
CONFIG_ESPTOOLPY_AFTER="hard_reset" CONFIG_ESPTOOLPY_MONITOR_BAUD=115200
#
#
CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitionsvm12m.csv" CONFIG_PARTITION_TABLE_FILENAME="partitionsvm12m.csv" CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_MD5=y
#
# CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
CONFIG_COMPILER_FLOAT_LIB_FROM_RVFPLIB=y CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2
CONFIG_COMPILER_HIDE_PATHS_MACROS=y
CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y
CONFIG_COMPILER_SAVE_RESTORE_LIBCALLS=y
#
#
#
#
CONFIG_APPTRACE_DEST_NONE=y
CONFIG_APPTRACE_DEST_UART_NONE=y CONFIG_APPTRACE_UART_TASK_PRIO=1 CONFIG_APPTRACE_LOCK_ENABLE=y
#
# CONFIG_BT_ENABLED=y
CONFIG_BT_NIMBLE_ENABLED=y
CONFIG_BT_CONTROLLER_ENABLED=y
#
# CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL=y
CONFIG_BT_NIMBLE_LOG_LEVEL_INFO=y
CONFIG_BT_NIMBLE_LOG_LEVEL=1 CONFIG_BT_NIMBLE_MAX_CONNECTIONS=2 CONFIG_BT_NIMBLE_MAX_BONDS=3 CONFIG_BT_NIMBLE_MAX_CCCDS=8 CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM=0 CONFIG_BT_NIMBLE_PINNED_TO_CORE=0 CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=4096 CONFIG_BT_NIMBLE_ROLE_CENTRAL=y CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=y CONFIG_BT_NIMBLE_ROLE_BROADCASTER=y CONFIG_BT_NIMBLE_ROLE_OBSERVER=y
CONFIG_BT_NIMBLE_SECURITY_ENABLE=y CONFIG_BT_NIMBLE_SM_LEGACY=y CONFIG_BT_NIMBLE_SM_SC=y
CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_ENCRYPTION=y
CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME="nimble" CONFIG_BT_NIMBLE_GAP_DEVICE_NAME_MAX_LEN=31 CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU=256 CONFIG_BT_NIMBLE_SVC_GAP_APPEARANCE=0
#
# CONFIG_BT_NIMBLE_MSYS_1_BLOCK_COUNT=12 CONFIG_BT_NIMBLE_MSYS_1_BLOCK_SIZE=256 CONFIG_BT_NIMBLE_MSYS_2_BLOCK_COUNT=24 CONFIG_BT_NIMBLE_MSYS_2_BLOCK_SIZE=320 CONFIG_BT_NIMBLE_ACL_BUF_COUNT=24 CONFIG_BT_NIMBLE_ACL_BUF_SIZE=255 CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70 CONFIG_BT_NIMBLE_HCI_EVT_HI_BUF_COUNT=30 CONFIG_BT_NIMBLE_HCI_EVT_LO_BUF_COUNT=8
CONFIG_BT_NIMBLE_GATT_MAX_PROCS=4
CONFIG_BT_NIMBLE_RPA_TIMEOUT=900
CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS=y CONFIG_BT_NIMBLE_HS_STOP_TIMEOUT_MS=2000
CONFIG_BT_NIMBLE_ENABLE_CONN_REATTEMPT=y CONFIG_BT_NIMBLE_MAX_CONN_REATTEMPT=5 CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT=y CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_2M_PHY=y CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_CODED_PHY=y
CONFIG_BT_NIMBLE_MAX_PERIODIC_SYNCS=0 CONFIG_BT_NIMBLE_MAX_PERIODIC_ADVERTISER_LIST=5 CONFIG_BT_NIMBLE_COEX_PHY_CODED_TX_RX_TLIM_EFF=0 CONFIG_BT_NIMBLE_WHITELIST_SIZE=12
CONFIG_BT_NIMBLE_BLUFI_ENABLE=y CONFIG_BT_NIMBLE_USE_ESP_TIMER=y
#
#
#
# CONFIG_BT_LE_HCI_INTERFACE_USE_RAM=y
CONFIG_BT_LE_CONTROLLER_NPL_OS_PORTING_SUPPORT=y CONFIG_BT_LE_CONTROLLER_TASK_STACK_SIZE=4096 CONFIG_BT_LE_LL_RESOLV_LIST_SIZE=4 CONFIG_BT_LE_LL_DUP_SCAN_LIST_COUNT=20 CONFIG_BT_LE_LL_SCA=60
#
#
#
#
#
#
#
#
CONFIG_SPI_MASTER_ISR_IN_IRAM=y
CONFIG_SPI_SLAVE_ISR_IN_IRAM=y
#
#
#
#
#
#
#
#
#
#
CONFIG_EFUSE_MAX_BLK_LEN=256
#
# CONFIG_ESP_TLS_USING_MBEDTLS=y
#
#
#
#
#
# CONFIG_ETH_ENABLED=y CONFIG_ETH_USE_SPI_ETHERNET=y
#
#
CONFIG_ESP_EVENT_POST_FROM_ISR=y CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y
#
# CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y
#
# CONFIG_HTTPD_MAX_REQ_HDR_LEN=512 CONFIG_HTTPD_MAX_URI_LEN=512 CONFIG_HTTPD_ERR_RESP_NO_DELAY=y CONFIG_HTTPD_PURGE_BUF_LEN=32
#
#
#
#
#
#
#
# CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y
CONFIG_ESP32C2_UNIVERSAL_MAC_ADDRESSES_FOUR=y CONFIG_ESP32C2_UNIVERSAL_MAC_ADDRESSES=4
#
#
CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU=y
#
# CONFIG_RTC_CLK_SRC_INT_RC=y
CONFIG_RTC_CLK_CAL_CYCLES=1024
#
#
#
# CONFIG_MMU_PAGE_SIZE_32KB=y CONFIG_MMU_PAGE_MODE="32KB" CONFIG_MMU_PAGE_SIZE=0x8000
#
#
#
# CONFIG_XTAL_FREQ_26=y
CONFIG_XTAL_FREQ=26
#
#
#
#
#
# CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32
#
# CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 CONFIG_ESP_NETIF_TCPIP_LWIP=y
#
# CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y
CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 CONFIG_ESP_PHY_MAX_TX_POWER=20 CONFIG_ESP_PHY_REDUCE_TX_POWER=y
#
#
#
#
#
#
#
#
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_120=y CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=120
#
#
CONFIG_ESP32C2_MMU_PAGE_SIZE_64KB=y
CONFIG_ESP32C2_MMU_PAGE_MODE=2
CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y
CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE=y
#
# CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT=y
CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y
CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048
CONFIG_ESP_CONSOLE_UART_CUSTOM=y
CONFIG_ESP_CONSOLE_UART=y CONFIG_ESP_CONSOLE_UART_NUM=0 CONFIG_ESP_CONSOLE_UART_TX_GPIO=5 CONFIG_ESP_CONSOLE_UART_RX_GPIO=4 CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200
CONFIG_ESP_TASK_WDT=y
CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
CONFIG_ESP_DEBUG_OCDAWARE=y CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y
#
# CONFIG_ESP_BROWNOUT_DET=y CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7=y
CONFIG_ESP_BROWNOUT_DET_LVL=7
CONFIG_ESP_SYSTEM_BROWNOUT_INTR=y
#
# CONFIG_ESP_IPC_TASK_STACK_SIZE=1024
#
#
CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1
CONFIG_ESP_TIMER_IMPL_SYSTIMER=y
#
# CONFIG_ESP32_WIFI_ENABLED=y
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32 CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_TX_BA_WIN=6 CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP32_WIFI_RX_BA_WIN=6 CONFIG_ESP32_WIFI_NVS_ENABLED=y CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 CONFIG_ESP32_WIFI_IRAM_OPT=y CONFIG_ESP32_WIFI_RX_IRAM_OPT=y CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y CONFIG_ESP32_WIFI_ENABLE_WPA3_OWE_STA=y
#
#
CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y
#
# CONFIG_FATFS_VOLUME_COUNT=2
CONFIG_FATFS_SECTOR_4096=y CONFIG_FATFS_SECTORS_PER_CLUSTER_1=y
CONFIG_FATFS_CODEPAGE_437=y
CONFIG_FATFS_AUTO_TYPE=y
CONFIG_FATFS_CODEPAGE=437 CONFIG_FATFS_LFN_NONE=y
CONFIG_FATFS_FS_LOCK=0 CONFIG_FATFS_TIMEOUT_MS=10000 CONFIG_FATFS_PER_FILE_CACHE=y
#
#
#
#
CONFIG_FREERTOS_UNICORE=y CONFIG_FREERTOS_HZ=100 CONFIG_FREERTOS_OPTIMIZED_SCHEDULER=y
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536
CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16
CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0
#
# CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y
CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y CONFIG_FREERTOS_ISR_STACKSIZE=1536 CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y
CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y
CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y
CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y CONFIG_FREERTOS_DEBUG_OCDAWARE=y
#
# CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y
CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 CONFIG_HAL_SYSTIMER_USE_ROM_IMPL=y CONFIG_HAL_WDT_USE_ROM_IMPL=y
#
# CONFIG_HEAP_POISONING_DISABLED=y
CONFIG_HEAP_TRACING_OFF=y
CONFIG_HEAP_TLSF_USE_ROM_IMPL=y
#
#
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
CONFIG_LOG_DEFAULT_LEVEL=3 CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
CONFIG_LOG_MAXIMUM_LEVEL=3 CONFIG_LOG_COLORS=y CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y
#
# CONFIG_LWIP_LOCAL_HOSTNAME="espressif"
CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y
CONFIG_LWIP_TIMERS_ONDEMAND=y CONFIG_LWIP_MAX_SOCKETS=8
CONFIG_LWIP_SO_REUSE=y CONFIG_LWIP_SO_REUSE_RXTOALL=y
CONFIG_LWIP_IP4_FRAG=y
CONFIG_LWIP_ESP_GRATUITOUS_ARP=y CONFIG_LWIP_GARP_TMR_INTERVAL=60 CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=16 CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y
CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y
CONFIG_LWIP_DHCP_OPTIONS_LEN=68 CONFIG_LWIP_NUM_NETIF_CLIENT_DATA=0
#
# CONFIG_LWIP_DHCPS=y CONFIG_LWIP_DHCPS_LEASE_UNIT=60 CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8
CONFIG_LWIP_NETIF_LOOPBACK=y CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8
#
# CONFIG_LWIP_MAX_ACTIVE_TCP=8 CONFIG_LWIP_MAX_LISTENING_TCP=8 CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y CONFIG_LWIP_TCP_MAXRTX=12 CONFIG_LWIP_TCP_SYNMAXRTX=12 CONFIG_LWIP_TCP_MSS=1440 CONFIG_LWIP_TCP_TMR_INTERVAL=250 CONFIG_LWIP_TCP_MSL=60000 CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 CONFIG_LWIP_TCP_WND_DEFAULT=5744 CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 CONFIG_LWIP_TCP_QUEUE_OOSEQ=y
CONFIG_LWIP_TCP_OVERSIZE_MSS=y
CONFIG_LWIP_TCP_RTO_TIME=1500
#
# CONFIG_LWIP_MAX_UDP_PCBS=8 CONFIG_LWIP_UDP_RECVMBOX_SIZE=6
#
#
CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y
CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y
CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF
#
# CONFIG_LWIP_ICMP=y
#
# CONFIG_LWIP_MAX_RAW_PCBS=16
#
# CONFIG_LWIP_SNTP_MAX_SERVERS=1
CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000
CONFIG_LWIP_BRIDGEIF_MAX_PORTS=7 CONFIG_LWIP_ESP_LWIP_ASSERT=y
#
#
CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT=y
CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y
#
# CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 CONFIG_MBEDTLS_DYNAMIC_BUFFER=y CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT=y
#
#
CONFIG_MBEDTLS_ECDH_LEGACY_CONTEXT=y
CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y
#
# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200
CONFIG_MBEDTLS_ECP_RESTARTABLE=y CONFIG_MBEDTLS_CMAC_C=y CONFIG_MBEDTLS_HARDWARE_SHA=y CONFIG_MBEDTLS_HARDWARE_ECC=y CONFIG_MBEDTLS_ECC_OTHER_CURVES_SOFT_FALLBACK=y CONFIG_MBEDTLS_ROM_MD5=y
CONFIG_MBEDTLS_HAVE_TIME=y
CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y CONFIG_MBEDTLS_SHA512_C=y CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y
CONFIG_MBEDTLS_TLS_SERVER=y CONFIG_MBEDTLS_TLS_CLIENT=y CONFIG_MBEDTLS_TLS_ENABLED=y
#
#
CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA=y CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y
CONFIG_MBEDTLS_SSL_RENEGOTIATION=y CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y
CONFIG_MBEDTLS_SSL_ALPN=y CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y
#
# CONFIG_MBEDTLS_AES_C=y
CONFIG_MBEDTLS_CCM_C=y CONFIG_MBEDTLS_GCM_C=y
#
# CONFIG_MBEDTLS_PEM_PARSE_C=y CONFIG_MBEDTLS_PEM_WRITE_C=y CONFIG_MBEDTLS_X509_CRL_PARSE_C=y CONFIG_MBEDTLS_X509_CSR_PARSE_C=y
CONFIG_MBEDTLS_ECP_C=y CONFIG_MBEDTLS_DHM_C=y CONFIG_MBEDTLS_ECDH_C=y CONFIG_MBEDTLS_ECDSA_C=y
CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y CONFIG_MBEDTLS_ECP_NIST_OPTIM=y
#
# CONFIG_MQTT_PROTOCOL_311=y
CONFIG_MQTT_TRANSPORT_SSL=y CONFIG_MQTT_TRANSPORT_WEBSOCKET=y CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y
#
# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y
CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y CONFIG_NEWLIB_NANO_FORMAT=y CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC_HRT=y
#
#
#
#
#
# CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0=y CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1=y
#
# CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 CONFIG_PTHREAD_STACK_MIN=768 CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread"
#
#
CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y CONFIG_SPI_FLASH_HAS_ROM_IMPL=y
CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y
CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20 CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1 CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192
#
# CONFIG_SPI_FLASH_BROWNOUT_RESET_XMC=y CONFIG_SPI_FLASH_BROWNOUT_RESET=y
#
# CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y
CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y
#
# CONFIG_SPIFFS_MAX_PARTITIONS=3
#
# CONFIG_SPIFFS_CACHE=y CONFIG_SPIFFS_CACHE_WR=y
CONFIG_SPIFFS_PAGE_CHECK=y CONFIG_SPIFFS_GC_MAX_RUNS=10
CONFIG_SPIFFS_PAGE_SIZE=256 CONFIG_SPIFFS_OBJ_NAME_LEN=32
CONFIG_SPIFFS_USE_MAGIC=y CONFIG_SPIFFS_USE_MAGIC_LENGTH=y CONFIG_SPIFFS_META_LENGTH=4 CONFIG_SPIFFS_USE_MTIME=y
#
#
#
#
#
# CONFIG_WS_TRANSPORT=y CONFIG_WS_BUFFER_SIZE=1024
#
# CONFIG_UNITY_ENABLE_FLOAT=y CONFIG_UNITY_ENABLE_DOUBLE=y
CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
#
# CONFIG_VFS_SUPPORT_IO=y CONFIG_VFS_SUPPORT_DIR=y CONFIG_VFS_SUPPORT_SELECT=y CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y CONFIG_VFS_SUPPORT_TERMIOS=y
#
# CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1
#
#
CONFIG_WL_SECTOR_SIZE_4096=y CONFIG_WL_SECTOR_SIZE=4096
#
# CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 CONFIG_WIFI_PROV_BLE_BONDING=y CONFIG_WIFI_PROV_BLE_SEC_CONN=y CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION=y
#
# CONFIG_WPA_MBEDTLS_CRYPTO=y CONFIG_WPA_MBEDTLS_TLS_CLIENT=y
CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y
CONFIG_LOG_BOOTLOADER_LEVEL=3
CONFIG_FLASHMODE_DIO=y
CONFIG_MONITOR_BAUD=115200 CONFIG_OPTIMIZATION_LEVEL_DEBUG=y CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y
CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y
CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2
CONFIG_STACK_CHECK_NONE=y
CONFIG_ESP32_APPTRACE_DEST_NONE=y CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y
CONFIG_NIMBLE_ENABLED=y CONFIG_NIMBLE_MEM_ALLOC_MODE_INTERNAL=y
CONFIG_NIMBLE_MAX_CONNECTIONS=2 CONFIG_NIMBLE_MAX_BONDS=3 CONFIG_NIMBLE_MAX_CCCDS=8 CONFIG_NIMBLE_L2CAP_COC_MAX_NUM=0 CONFIG_NIMBLE_PINNED_TO_CORE=0 CONFIG_NIMBLE_TASK_STACK_SIZE=4096 CONFIG_BT_NIMBLE_TASK_STACK_SIZE=4096 CONFIG_NIMBLE_ROLE_CENTRAL=y CONFIG_NIMBLE_ROLE_PERIPHERAL=y CONFIG_NIMBLE_ROLE_BROADCASTER=y CONFIG_NIMBLE_ROLE_OBSERVER=y
CONFIG_NIMBLE_SM_LEGACY=y CONFIG_NIMBLE_SM_SC=y
CONFIG_NIMBLE_SVC_GAP_DEVICE_NAME="nimble" CONFIG_NIMBLE_GAP_DEVICE_NAME_MAX_LEN=31 CONFIG_NIMBLE_ATT_PREFERRED_MTU=256 CONFIG_NIMBLE_SVC_GAP_APPEARANCE=0 CONFIG_BT_NIMBLE_MSYS1_BLOCK_COUNT=12 CONFIG_NIMBLE_ACL_BUF_COUNT=24 CONFIG_NIMBLE_ACL_BUF_SIZE=255 CONFIG_NIMBLE_HCI_EVT_BUF_SIZE=70 CONFIG_NIMBLE_HCI_EVT_HI_BUF_COUNT=30 CONFIG_NIMBLE_HCI_EVT_LO_BUF_COUNT=8
CONFIG_NIMBLE_RPA_TIMEOUT=900
CONFIG_NIMBLE_CRYPTO_STACK_MBEDTLS=y
CONFIG_POST_EVENTS_FROM_ISR=y CONFIG_POST_EVENTS_FROM_IRAM_ISR=y
CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y
CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 CONFIG_ESP32_PHY_MAX_TX_POWER=20 CONFIG_REDUCE_PHY_TX_POWER=y CONFIG_ESP32_REDUCE_PHY_TX_POWER=y CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 CONFIG_MAIN_TASK_STACK_SIZE=3584
CONFIG_CONSOLE_UART_CUSTOM=y
CONFIG_CONSOLE_UART=y CONFIG_CONSOLE_UART_NUM=0 CONFIG_CONSOLE_UART_TX_GPIO=5 CONFIG_CONSOLE_UART_RX_GPIO=4 CONFIG_CONSOLE_UART_BAUDRATE=115200
CONFIG_TASK_WDT=y
CONFIG_TASK_WDT_TIMEOUT_S=5 CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
CONFIG_BROWNOUT_DET=y CONFIG_BROWNOUT_DET_LVL_SEL_7=y
CONFIG_BROWNOUT_DET_LVL=7 CONFIG_IPC_TASK_STACK_SIZE=1024 CONFIG_TIMER_TASK_STACK_SIZE=3584
CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y CONFIG_TIMER_TASK_PRIORITY=1 CONFIG_TIMER_TASK_STACK_DEPTH=2048 CONFIG_TIMER_QUEUE_LENGTH=10
CONFIG_ESP_GRATUITOUS_ARP=y CONFIG_GARP_TMR_INTERVAL=60 CONFIG_TCPIP_RECVMBOX_SIZE=16 CONFIG_TCP_MAXRTX=12 CONFIG_TCP_SYNMAXRTX=12 CONFIG_TCP_MSS=1440 CONFIG_TCP_MSL=60000 CONFIG_TCP_SND_BUF_DEFAULT=5744 CONFIG_TCP_WND_DEFAULT=5744 CONFIG_TCP_RECVMBOX_SIZE=6 CONFIG_TCP_QUEUE_OOSEQ=y CONFIG_TCP_OVERSIZE_MSS=y
CONFIG_UDP_RECVMBOX_SIZE=6 CONFIG_TCPIP_TASK_STACK_SIZE=3072 CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y
CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF
CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 CONFIG_ESP32_PTHREAD_STACK_MIN=768 CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y
CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y CONFIG_SUPPORT_TERMIOS=y CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1
Hi @lyh20190329, can you please share the sample application to reproduce this issue?
example like this: main.zip
When turning on bluetooth (calling start_blufi()) does nothing, then turning off bluetooth (calling sop_blufi()), everything is normal, but after bluetooth receives data, after connecting to wifi successfully and then turning off bluetooth, a crash occurs, I don't know if it is The reason for the wrong usage of the set_wifi_info_ble function or the reason for the destruction of the wifitask, thank you for your guidance
hi @RoshanESP ,thank you for your guidance,pls help me
Hi @lyh20190329,
I think sequence you are trying to deinit is not working. Please find attached functions that you can use instead and achieve the intended functionality.
I tested these changes on blufi app by modifying code and invoked the new API. I am attaching the patch file for your reference.
when i test this ,still crash,the BT_5.0_FEATURE=Y: blufi_security_deinit(); esp_blufi_adv_start(); esp_blufi_ble_stop();
log: I (66982) BT: BLUFI ble disconnect
Guru Meditation Error: Core 0 panic'ed (Load access fault). Exception was unhandled.
Stack dump detected
Core 0 register dump:
MEPC : 0x42020dca RA : 0x4201f0e4 SP : 0x3fccbc00 GP : 0x3fcaae40
0x42020dca: ble_npl_mutex_pend at /home/ubuntu/work/esp-idf/components/bt/porting/npl/freertos/include/nimble/nimble_npl_os.h:223
(inlined by) ble_hs_lock_nested at /home/ubuntu/work/esp-idf/components/bt/host/nimble/nimble/nimble/host/src/ble_hs.c:175
0x4201f0e4: ble_hs_id_copy_addr at /home/ubuntu/work/esp-idf/components/bt/host/nimble/nimble/nimble/host/src/ble_hs_id.c:263
TP : 0x3fca9c2c T0 : 0x4201f0d8 T1 : 0x403880d0 T2 : 0x7373227b
0x4201f0d8: ble_hs_id_copy_addr at /home/ubuntu/work/esp-idf/components/bt/host/nimble/nimble/nimble/host/src/ble_hs_id.c:257
0x403880d0: gpspi_flash_ll_set_command at /home/ubuntu/work/esp-idf/components/hal/esp32c2/include/hal/gpspi_flash_ll.h:289 (inlined by) spi_flash_hal_gpspi_configure_host_io_mode at /home/ubuntu/work/esp-idf/components/hal/spi_flash_hal_common.inc:118
S0/FP : 0x3fcca830 S1 : 0x00000000 A0 : 0x3fcb2000 A1 : 0xffffffff
A2 : 0x00000000 A3 : 0x00000013 A4 : 0x3fcb15b4 A5 : 0x00000000
A6 : 0x00000080 A7 : 0x55514522 S2 : 0x3fcca850 S3 : 0x00000001
S4 : 0x00000000 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x70222c22 T4 : 0x6946696e T5 : 0x555f5345 T6 : 0x55514522
MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000005 MTVAL : 0x00000044
0x40380001: _vector_table at ??:?
@RoshanESP Can you test it on my example? Send custom data through bluetooth, the data contains ssid, passwd. The jason encapsulation of the name, such as: {"ssid":"EQUES","pwd":"EQUES123","user_name":"hgz123456"}, when the application receives this string, it will parse the WiFi data and connect to the WiFi hotspot, and then Turning off bluetooth will crash
Hi @lyh20190329 , I checked your code. Whenever wifi status is 3, the while loop will keep calling the code to stop ble.
The api I gave yesterday assumed that it would be called only once. Attached is the updated patch where I have modified the stop_blufi function.
void stop_blufi() { if (!blufi_init) return; blufi_init = 0; blufi_ble_stop(); }
Please find the complete example attached. I have tested at my end and observed no crash. working_main.zip
@RoshanESP Thank you very much for your support. I can turn off Bluetooth according to your method. Now there is a need to turn it on after turning it off sometimes. I tested it. After turning it off, I directly call the following code to turn it on. like this:
nimble_port_init();
nimble_port_run();
The bluetooth can never be discover. Whether I call it again .Is there a problem with the bluetooth turned on?
Hi @lyh20190329, If the intention is to restart after stopping, why are you not invoking start_blufi() function of your application?
Your initial request was to stop Bluetooth. Now a new requirement is added. Based on your first request, I suggested the application level changes. If the intention is to restart then ensure that you are also calling esp_blufi_deinit() in the stop_blufi function.
@RoshanESP Unfortunately, I re-tested several times, and turned off the bluetooth when the bluetooth was disconnected, or manually turned off the bluetooth when it was connected, and the bluetooth could not be turned off, and sometimes crashed.
case ESP_BLUFI_EVENT_BLE_DISCONNECT:
BLUFI_INFO("BLUFI ble disconnect\n");
ble_is_connected = false;
blufi_security_deinit();
esp_blufi_adv_start();
esp_blufi_ble_stop();
break;
void esp_blufi_ble_stop()
{
int ret = nimble_port_stop();
ESP_LOGI("BLUFI_EXAMPLE", "esp_blufi_ble_stop=%d-----",ret);
if (ret == 0) {
nimble_port_deinit();
}
}
I used the code in the example of ESP latest release, used in the ESP32C2 chip, and the crystal oscillator is 26MHZ (Hardware Settings → Main XTAL Config->Main XTAL frequency (26 MHz) ),It seems that there is still a problem with closing the NIMBLE interface, what should I do?
if the intention is to restart after stopping, why are you not invoking start_blufi() function of your application? In the previous test, I tried to call start_blufi() to restart after turning off the bluetooth, but the mobile phone could not find the bluetooth device. From the current consumption, the bluetooth has been turned on. Now test it, the current does not change after turning off the bluetooth, and sometimes it crashes
Hi @lyh20190329,
In this case, you are starting advertisement and then attempting to stop ble.
case ESP_BLUFI_EVENT_BLE_DISCONNECT:
BLUFI_INFO("BLUFI ble disconnect\n");
ble_is_connected = false;
blufi_security_deinit();
esp_blufi_adv_start();
esp_blufi_ble_stop();
break;
I suggest referring to documentation for esp apis which will assist you to understand what the API does.
At my end, I tried to stop and start Bluetooth/blufi and find its working. Please try the attached patch. These are mostly application-level changes. app_changes.txt
blufi_example.zip This is what I debugged on the latest official website example. IDF is also the latest one. I modified XTAL to 26MHZ. After receiving the first character 0x30 of the custom data, turn off the Bluetooth. The test found that the current will not decrease, and the Bluetooth is disconnected. Can no longer be scanned, sometimes crashes
Hi @lyh20190329, I made the changes in your example to stop blufi when the first character of custom data is received and then started blufi again with the same steps done for the first time. I found this working properly. Below is the working_patch.txt file for your reference. working_patch.txt
Hi @RoshanESP I really appreciate your support, I don't know what to do without your support. I have integrated your patch and did the following tests: test 1. Do nothing, only turn on and turn off Bluetooth: it works fine, but there will be memory leaks, each time it leaks about 5k. Keep turning on and off bluetooth, and finally there is no memory available!
test2. I did a process test, fist time test is ok,but do this again,seem some broken(ESP not sleep,not power off),Found that it was normal to turn on Bluetooth for the second time to receive data. When it was turned off, the log looked normal. When WIFI was connected to the Internet or was about to be connected to the Internet, a crash occurred: The test process is as follows: Connect Bluetooth -> Receive WiFi configuration data -> turn off bluetooth -> connect to wifi -> connect to server (websokect connect))-> (stop wifi)start BT->Connect Bluetooth -> Receive WiFi configuration data -> turn off bluetooth -> start wifi -> connect to server (websokect connect))(CRASH )
CRASH LOGS: Guru Meditation Error: Core 0 panic'ed (Load access fault). Exception was unhandled.
Stack dump detected
Core 0 register dump:
MEPC : 0x40057ff4 RA : 0x40058800 SP : 0x3fcc9540 GP : 0x3fcacf10
TP : 0x3fca6d18 T0 : 0x40057e12 T1 : 0xffffffe0 T2 : 0xffffffff
S0/FP : 0x3fcb3c14 S1 : 0x3fccae7c A0 : 0x3fcb3c14 A1 : 0x3fccae84
A2 : 0x3fccae8c A3 : 0x00000004 A4 : 0x317a676a A5 : 0x3fccae7c
A6 : 0x00000008 A7 : 0xf4240000 S2 : 0x00000000 S3 : 0x3fccae7d
S4 : 0x3fccae84 S5 : 0x7f995cfc S6 : 0x00000000 S7 : 0x00000000
S8 : 0x3fcc38bc S9 : 0x00000000 S10 : 0x3c09d000 S11 : 0x00000100
T3 : 0x00000edf T4 : 0x0000003f T5 : 0x3338315f T6 : 0x6c376875
MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000005 MTVAL : 0x7f995d00
0x40380001: _vector_table at ??:?
MHARTID : 0x00000000
Backtrace:
0x40057ff4 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?) ELF file SHA256: 614b8f49c2ad03b6
CPU halted.
The interface called to close Bluetooth is as follows:
esp_blufi_deinit();
esp_blufi_ble_stop();
Hi @RoshanESP After continuous testing and tracking, the problem of crash has been solved. Now it's the memory leak that needs your support. Don't do anything, keep turning on and off bluetooth, use esp_get_free_heap_size ()to check the remaining memory, it will get smaller and smaller until the bluetooth fails to turn on.
Hi @lyh20190329 ,
Thanks for pointing out. Can you please try the attached changes. Except for the first instance where some memory gets reserved, the next attempts for init / deinit should not cause any memory leak. Can you please try attached patch and share your observation. Please put this patch on top of all existing changes. patch.txt At my end I modified application to do init / deinit in a loop and now see constant heap numbers.
Hi @RoshanESP Thanks for support,I try the attached changes and working fine. no memory leak.
This commit address the issue discussed here.
Answers checklist.
IDF version.
v5.0-beta1-206-gccdeb43cc7-dirt
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
No response
Development Kit.
esp32c2
Power Supply used.
External 3.3V
What is the expected behavior?
Bluetooth is off, freeing up memory
What is the actual behavior?
esp32c2 crashes or restarts
Steps to reproduce.
1、start BT like blow: ret = esp_bt_controller_init(&bt_cfg); if (ret) { ESP_LOGE(TAG,"%s initialize bt controller failed: %s\n", func, esp_err_to_name(ret)); }
esp_bt_controller_deinit();
ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT)); ........ ........
it is run ok in bluedoid but faild in nimblue,please help me,thanks!
Debug Logs.
More Information.
No response