The terminal shows the following:
Code: Select all
Rebooting...
ets Jul 29 2019 12:21:46
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6940
ho 0 tail 12 room 4
load:0x40078000,len:15500
load:0x40080400,len:3844
0x40080400: _init at ??:?
entry 0x4008064c
I (29) boot: ESP-IDF v5.0.2 2nd stage bootloader
I (29) boot: compile time 23:08:38
I (29) boot: chip revision: v3.0
I (32) boot.esp32: SPI Speed : 40MHz
I (37) boot.esp32: SPI Mode : DIO
I (41) boot.esp32: SPI Flash Size : 2MB
I (46) boot: Enabling RNG early entropy source...
I (51) boot: Partition Table:
I (55) boot: ## Label Usage Type ST Offset Length
I (62) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (70) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (77) boot: 2 factory factory app 00 00 00010000 00177000
I (85) boot: End of partition table
I (89) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=38b40h (232256) map
I (181) esp_image: segment 1: paddr=00048b68 vaddr=3ffbdb60 size=0504ch ( 20556) load
I (189) esp_image: segment 2: paddr=0004dbbc vaddr=40080000 size=0245ch ( 9308) load
I (193) esp_image: segment 3: paddr=00050020 vaddr=400d0020 size=e6b64h (944996) map
I (537) esp_image: segment 4: paddr=00136b8c vaddr=4008245c size=1c06ch (114796) load
I (599) boot: Loaded app from partition at offset 0x10000
I (599) boot: Disabling RNG early entropy source...
I (611) cpu_start: Pro cpu up.
I (611) cpu_start: Starting app cpu, entry point is 0x40081414
0x40081414: call_start_cpu1 at C:/Users/konec/esp/esp-idf/components/esp_system/port/cpu_start.c:141
I (597) cpu_start: App cpu up.
I (628) cpu_start: Pro cpu start user code
I (628) cpu_start: cpu freq: 160000000 Hz
I (628) cpu_start: Application information:
I (632) cpu_start: Project name: ESP32_BT_WIFI_MAC_ADD
I (639) cpu_start: App version: 1
I (643) cpu_start: Compile time: Dec 8 2023 23:10:43
I (649) cpu_start: ELF file SHA256: 2fec272580b93529...
I (655) cpu_start: ESP-IDF: v5.0.2
I (660) cpu_start: Min chip rev: v0.0
I (665) cpu_start: Max chip rev: v3.99
I (669) cpu_start: Chip rev: v3.0
I (674) heap_init: Initializing. RAM available for dynamic allocation:
I (682) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (687) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (693) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (700) heap_init: At 3FFCD4A0 len 00012B60 (74 KiB): DRAM
I (706) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (712) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (719) heap_init: At 4009E4C8 len 00001B38 (6 KiB): IRAM
I (726) spi_flash: detected chip: generic
I (729) spi_flash: flash io: dio
W (733) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (748) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (798) MAIN: Value of ret: 0
I (808) wifi:wifi driver task: 3ffbd854, prio:23, stack:6656, core=0
I (808) system_api: Base MAC address is not set
I (808) system_api: read default base MAC address from EFUSE
I (818) wifi:wifi firmware version: 57982fe
I (818) wifi:wifi certification version: v7.0
I (818) wifi:config NVS flash: enabled
I (818) wifi:config nano formating: disabled
I (828) wifi:Init data frame dynamic rx buffer num: 32
I (828) wifi:Init management frame dynamic rx buffer num: 32
I (838) wifi:Init management short buffer num: 32
I (838) wifi:Init dynamic tx buffer num: 32
I (848) wifi:Init static rx buffer size: 1600
I (848) wifi:Init static rx buffer num: 10
I (848) wifi:Init dynamic rx buffer num: 32
I (858) wifi_init: rx ba win: 6
I (858) wifi_init: tcpip mbox: 32
I (868) wifi_init: udp mbox: 6
I (868) wifi_init: tcp mbox: 6
I (868) wifi_init: tcp tx win: 5744
I (878) wifi_init: tcp rx win: 5744
I (878) wifi_init: tcp mss: 1440
I (888) wifi_init: WiFi IRAM OP enabled
I (888) wifi_init: WiFi RX IRAM OP enabled
I (888) MAIN: Value of ret: 0
I (898) BTDM_INIT: BT controller compile version [2c56073]
ESP_ERROR_CHECK failed: esp_err_t 0x102 (ESP_ERR_INVALID_ARG) at 0x400d854a
0x400d854a: app_main at C:/Users/konec/ESP-IDF/ESP32_BT_WIFI_MAC_ADD/main/main.c:38 (discriminator 1)
file: "./main/main.c" line 38
func: app_main
expression: ret
abort() was called at PC 0x40091c67 on core 0
0x40091c67: _esp_error_check_failed at C:/Users/konec/esp/esp-idf/components/esp_system/esp_err.c:47
Backtrace: 0x40081f1a:0x3ffbba30 0x40091c71:0x3ffbba50 0x4009855e:0x3ffbba70 0x40091c67:0x3ffbbae0 0x400d854a:0x3ffbbb10 0x401b4e7b:0x3ffbbc50 0x40094e01:0x3ffbbc80
0x40081f1a: panic_abort at C:/Users/konec/esp/esp-idf/components/esp_system/panic.c:423
0x40091c71: esp_system_abort at C:/Users/konec/esp/esp-idf/components/esp_system/esp_system.c:153
0x4009855e: abort at C:/Users/konec/esp/esp-idf/components/newlib/abort.c:38
0x40091c67: _esp_error_check_failed at C:/Users/konec/esp/esp-idf/components/esp_system/esp_err.c:47
0x400d854a: app_main at C:/Users/konec/ESP-IDF/ESP32_BT_WIFI_MAC_ADD/main/main.c:38 (discriminator 1)
GetOverlappedResult failed (PermissionError(13, 'P????stup byl odep??en0x4.0'1,b 4Neo7nbe:, m5a)i)n_t
asWka at C:/itiUnsge frosr/ kotnheec/ edsepv/icee stpo- idrfeconne/ctcomponents/freertos/FreeRTOS-Kernel/portable/port_common.c:131 (discriminator 2)
0x40094e01: vPortTaskWrapper at C:/Users/konec/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:154
ELF file SHA256: 2fec272580b93529
Rebooting...
Code: Select all
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "esp_wifi.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include "esp_bt.h"
#include "esp_bt_main.h"
#include "esp_bt_device.h"
#include "esp_gap_bt_api.h"
#include "string.h"
void app_main()
{
// Inicializace NVS
esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}
ESP_ERROR_CHECK(ret);
ESP_LOGI("MAIN", "Value of ret: %d", ret);
// Inicializace WiFi
esp_netif_init();
esp_event_loop_create_default();
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ret = esp_wifi_init(&cfg);
ESP_ERROR_CHECK(ret);
ESP_LOGI("MAIN", "Value of ret: %d", ret);
// Inicializace Bluetooth
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
ret = esp_bt_controller_init(&bt_cfg);
ESP_ERROR_CHECK(ret);
ret = esp_bt_controller_enable(ESP_BT_MODE_BTDM);
ESP_ERROR_CHECK(ret);
ESP_LOGI("MAIN", "Value of ret: %d", ret);
// Získání MAC adresy WiFi rozhraní
uint8_t wifi_mac[6];
ret = esp_wifi_get_mac(ESP_IF_WIFI_STA, wifi_mac);
ESP_ERROR_CHECK(ret);
ESP_LOGI("MAIN", "Value of ret: %d", ret);
// Výpis MAC adresy WiFi na konzoli
ESP_LOGI("MAC", "WiFi MAC adresa: %02x:%02x:%02x:%02x:%02x:%02x",
wifi_mac[0], wifi_mac[1], wifi_mac[2], wifi_mac[3], wifi_mac[4], wifi_mac[5]);
// Získání MAC adresy Bluetooth
uint8_t bt_mac[6];
const uint8_t *bt_addr = esp_bt_dev_get_address();
memcpy(bt_mac, bt_addr, 6);
// Výpis MAC adresy Bluetooth na konzoli
ESP_LOGI("MAC", "Bluetooth MAC adresa: %02x:%02x:%02x:%02x:%02x:%02x",
bt_mac[0], bt_mac[1], bt_mac[2], bt_mac[3], bt_mac[4], bt_mac[5]);
}