title: ESP8266-12F WiFi soft AP config.authmode failed
body: <p>For a project I try do use the ESP8266 RTOS SDK.
  First step I install the tools and the toolchain. The <code>hello_world</code> example and the other <code>gpio</code> example works fine. I try the <code>softAP</code> example and get a <code>Guru Meditation Error: Core  0 panic'ed (StoreProhibited). Exception was unhandled</code> Error. I figured out that the <code>line 62 : .automode = WIFI_AUTH_WPA_WPA2_PSK </code>not works. I tried <code>WIFI_AUTH_WEP</code>,<code>WIFI_AUTH_WPA_PSK</code>,<code>WIFI_AUTH_WPA2_PSK</code> but only with <code>WIFI_AUTH_OPEN</code> the softAP works. Anyone same behavior or some tips?</p>
  <p><strong>Console Trace:</strong></p>
  <pre><code> ets Jan  8 2013,rst cause:1, boot mode:(3,6)
  
  load 0x40100000, len 7040, room 16
  tail 0
  chksum 0xe5
  load 0x3ffe8408, len 24, room 8
  tail 0
  chksum 0x6c
  load 0x3ffe8420, len 3312, room 8
  tail 8
  chksum 0x75
  csum 0x75
  I (123) boot: ESP-IDF v3.4-rc 2nd stage bootloader
  I (123) boot: compile time 19:41:32
  I (207) qio_mode: Enabling default flash chip QIO
  I (207) boot: SPI Speed      : 40MHz
  I (208) boot: SPI Mode       : QOUT
  I (212) boot: SPI Flash Size : 2MB
  I (219) boot: Partition Table:
  I (224) boot: ## Label            Usage          Type ST Offset   Length
  I (236) boot:  0 nvs              WiFi data        01 02 00009000 00006000
  I (247) boot:  1 phy_init         RF data          01 01 0000f000 00001000
  I (259) boot:  2 factory          factory app      00 00 00010000 000f0000
  I (271) boot: End of partition table
  I (277) esp_image: segment 0: paddr=0x00010010 vaddr=0x40210010 size=0x52c80 (339072) map
  I (406) esp_image: segment 1: paddr=0x00062c98 vaddr=0x40262c90 size=0x0f594 ( 62868) map
  I (428) esp_image: segment 2: paddr=0x00072234 vaddr=0x3ffe8000 size=0x005fc (  1532) load
  I (429) esp_image: segment 3: paddr=0x00072838 vaddr=0x40100000 size=0x00080 (   128) load
  I (439) esp_image: segment 4: paddr=0x000728c0 vaddr=0x40100080 size=0x05560 ( 21856) load
  I (460) boot: Loaded app from partition at offset 0x10000
  I (481) wifi softAP: ESP_WIFI_MODE_AP
  I (484) system_api: Base MAC address is not set, read default base MAC address from EFUSE
  I (486) system_api: Base MAC address is not set, read default base MAC address from EFUSE
  phy_version: 1163.0, 665d56c, Jun 24 2020, 10:00:08, RTOS new
  I (557) phy_init: phy ver: 1163_0
  I (567) wifi softAP: ----------------###------------
  ESP_ERROR_CHECK failed: esp_err_t 0x2 (ERROR) at 0x4021f7cc
  file: &quot;softap_example_main.c&quot; line 73
  func: wifi_init_softap
  expression: esp_wifi_set_config(ESP_IF_WIFI_AP, &amp;wifi_config)
  abort() was called at PC 0x4021f7cf on core 0
  Guru Meditation Error: Core  0 panic'ed (StoreProhibited). Exception was unhandled.
  Core 0 register dump:
  PC      : 0x40221c72  PS      : 0x00000030  A0      : 0x40221c70  A1      : 0x3ffeb550
  A2      : 0x00000000  A3      : 0xffffffdb  A4      : 0x00000001  A5      : 0x00000001
  A6      : 0x00000000  A7      : 0x4026663c  A8      : 0x00000020  A9      : 0x00000000
  A10     : 0x00000008  A11     : 0x00000000  A12     : 0x00000000  A13     : 0x00000000
  A14     : 0x00000000  A15     : 0x00000000  SAR     : 0x0000001e  EXCCAUSE: 0x0000001d
  
  Backtrace: 0x40221c72:0x3ffeb550 0x4021f7d2:0x3ffeb560 0x4022182e:0x3ffeb570 0x40221894:0x3ffeb630 0x402118ef:0x3ffeb640
  </code></pre>
  <p><strong>Example Code from GitHub: (examples/wifi/getting_started/softAP/main/softap_example_main.c)</strong></p>
  <pre><code>/*  WiFi softAP Example
     This example code is in the Public Domain (or CC0 licensed, at your option.)
     Unless required by applicable law or agreed to in writing, this
     software is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR
     CONDITIONS OF ANY KIND, either express or implied.
  */
  #include &lt;string.h&gt;
  #include &quot;freertos/FreeRTOS.h&quot;
  #include &quot;freertos/task.h&quot;
  #include &quot;esp_system.h&quot;
  #include &quot;esp_wifi.h&quot;
  #include &quot;esp_event.h&quot;
  #include &quot;esp_log.h&quot;
  #include &quot;nvs_flash.h&quot;
  
  #include &quot;lwip/err.h&quot;
  #include &quot;lwip/sys.h&quot;
  
  /* The examples use WiFi configuration that you can set via project configuration menu.
     If you'd rather not, just change the below entries to strings with
     the config you want - ie #define EXAMPLE_WIFI_SSID &quot;mywifissid&quot;
  */
  #define EXAMPLE_ESP_WIFI_SSID      CONFIG_ESP_WIFI_SSID
  #define EXAMPLE_ESP_WIFI_PASS      CONFIG_ESP_WIFI_PASSWORD
  #define EXAMPLE_MAX_STA_CONN       CONFIG_ESP_MAX_STA_CONN
  
  static const char *TAG = &quot;wifi softAP&quot;;
  
  static void wifi_event_handler(void* arg, esp_event_base_t event_base,
                                      int32_t event_id, void* event_data)
  {
      if (event_id == WIFI_EVENT_AP_STACONNECTED) {
          wifi_event_ap_staconnected_t* event = (wifi_event_ap_staconnected_t*) event_data;
          ESP_LOGI(TAG, &quot;station &quot;MACSTR&quot; join, AID=%d&quot;,
                   MAC2STR(event-&gt;mac), event-&gt;aid);
      } else if (event_id == WIFI_EVENT_AP_STADISCONNECTED) {
          wifi_event_ap_stadisconnected_t* event = (wifi_event_ap_stadisconnected_t*) event_data;
          ESP_LOGI(TAG, &quot;station &quot;MACSTR&quot; leave, AID=%d&quot;,
                   MAC2STR(event-&gt;mac), event-&gt;aid);
      }
  }
  
  void wifi_init_softap()
  {
      tcpip_adapter_init();
      ESP_ERROR_CHECK(esp_event_loop_create_default());
  
      wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
      ESP_ERROR_CHECK(esp_wifi_init(&amp;cfg));
  
      ESP_ERROR_CHECK(esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, &amp;wifi_event_handler, NULL));
  
      wifi_config_t wifi_config = {
          .ap = {
              .ssid = EXAMPLE_ESP_WIFI_SSID,
              .ssid_len = strlen(EXAMPLE_ESP_WIFI_SSID),
              .password = EXAMPLE_ESP_WIFI_PASS,
              .max_connection = EXAMPLE_MAX_STA_CONN,
              .authmode = WIFI_AUTH_WPA_WPA2_PSK
          },
      };
      if (strlen(EXAMPLE_ESP_WIFI_PASS) == 0) {
          wifi_config.ap.authmode = WIFI_AUTH_OPEN;
      }
  
      ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_AP));
      ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_AP, &amp;wifi_config));
      ESP_ERROR_CHECK(esp_wifi_start());
  
      ESP_LOGI(TAG, &quot;wifi_init_softap finished. SSID:%s password:%s&quot;,
               EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS);
  }
  
  void app_main()
  {
      ESP_ERROR_CHECK(nvs_flash_init());
  
      ESP_LOGI(TAG, &quot;ESP_WIFI_MODE_AP&quot;);
      wifi_init_softap();
  }
  </code></pre>