Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in ESP32-C3 esp_wifi_set_ant_gpio() #29

Open
BaaBaaGoat opened this issue Jul 8, 2022 · 1 comment
Open

Crash in ESP32-C3 esp_wifi_set_ant_gpio() #29

BaaBaaGoat opened this issue Jul 8, 2022 · 1 comment

Comments

@BaaBaaGoat
Copy link

Environment

  • Development Kit: none
  • Module or chip used: ESP32-C3FH4 on dev board dev board https://wiki.luatos.com/chips/esp32c3/hardware.html
  • IDF version (run git describe --tags to find it):v4.4
  • Build System: idf.py
  • Compiler version (run xtensa-esp32-elf-gcc --version to find it):8.4.0
  • Operating System: Windows
  • (Windows only) environment type:ESP Command Prompt.
  • Using an IDE?: Yes (Espressif-IDE 2.5.0)
  • Power Supply: USB

Problem Description

an Store access fault was thrown when calling esp_wifi_set_ant_gpio,

Expected Behavior

antenna controlling GPIO is successfully configured.

Actual Behavior

an Guru Meditation Error: Core 0 panic'ed (Store access fault) was thrown during call to API esp_wifi_set_ant_gpio()

Steps to reproduce

  1. create an IDF project by using example template wifi/scan
    图片
  2. add this code snippet after esp_wifi_init(line 119 in scan.c):
    gpio_reset_pin(18);
    gpio_set_direction(18, GPIO_MODE_OUTPUT);
    gpio_reset_pin(19);
    gpio_set_direction(19, GPIO_MODE_OUTPUT);
	ESP_ERROR_CHECK(gpio_set_level(18,0));
	ESP_ERROR_CHECK(gpio_set_level(19,0));
    wifi_ant_gpio_config_t gpiocfg = {{
        { .gpio_select = 1, .gpio_num = 18 },
        { .gpio_select = 1, .gpio_num = 19 }
    }};
    ESP_ERROR_CHECK(esp_wifi_set_ant_gpio(&gpiocfg));

图片
3. build&flash&monitor.error occur.
图片
// If possible, attach a picture of your setup/wiring here.
using dev board https://wiki.luatos.com/chips/esp32c3/hardware.html,powered by USB type c.
no external wiring/setup made.

Code to reproduce this issue

    gpio_reset_pin(18);
    gpio_set_direction(18, GPIO_MODE_OUTPUT);
    gpio_reset_pin(19);
    gpio_set_direction(19, GPIO_MODE_OUTPUT);
	ESP_ERROR_CHECK(gpio_set_level(18,0));
	ESP_ERROR_CHECK(gpio_set_level(19,0));
    wifi_ant_gpio_config_t gpiocfg = {{
        { .gpio_select = 1, .gpio_num = 18 },
        { .gpio_select = 1, .gpio_num = 19 }
    }};
    ESP_ERROR_CHECK(esp_wifi_set_ant_gpio(&gpiocfg));

// If your code is longer than 30 lines, GIST is preferred.

Debug Logs

Guru Meditation Error: Core  0 panic'ed (Store access fault). Exception was unhandled.

Stack dump detected
Core  0 register dump:
MEPC    : 0x4203bc00  RA      : 0x4203a2ca  SP      : 0x3fc9f060  GP      : 0x3fc8ec00
0x4203bc00: wifi_set_ant_gpio at ??:?

0x4203a2ca: ieee80211_ioctl_process at ??:?

TP      : 0x3fc8b97c  T0      : 0x420126fc  T1      : 0x420130a0  T2      : 0x42012270
0x420126fc: aes_decrypt_init at C:/Users/exote/.espressif/frameworks/esp-idf-v4.4/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:326

0x420130a0: ccmp_decrypt at C:/Users/exote/.espressif/frameworks/esp-idf-v4.4/components/wpa_supplicant/src/crypto/ccmp.c:141

0x42012270: esp_aes_decrypt at C:/Users/exote/.espressif/frameworks/esp-idf-v4.4/components/wpa_supplicant/src/crypto/crypto_ops.c:35

S0/FP   : 0x3fc994f4  S1      : 0xffffffff  A0      : 0x00000001  A1      : 0x00000004
A2      : 0x000000d8  A3      : 0x0ffd114c  A4      : 0x00000000  A5      : 0x3ff44578
A6      : 0x4201226c  A7      : 0x42013158  S2      : 0x3fc93dbc  S3      : 0x3ff1b5a8
0x4201226c: esp_aes_gmac at C:/Users/exote/.espressif/frameworks/esp-idf-v4.4/components/wpa_supplicant/src/crypto/crypto_ops.c:47

0x42013158: ccmp_encrypt at C:/Users/exote/.espressif/frameworks/esp-idf-v4.4/components/wpa_supplicant/src/crypto/ccmp.c:193

S4      : 0x3fce0000  S5      : 0x3fce0000  S6      : 0x3fce0000  S7      : 0x3fce0000
S8      : 0x3ff1b000  S9      : 0x3fce0000  S10     : 0x3fcdf934  S11     : 0x00000000
T3      : 0x42012b54  T4      : 0x4201279c  T5      : 0x42012732  T6      : 0x42012724
0x42012b54: omac1_aes_128 at C:/Users/exote/.espressif/frameworks/esp-idf-v4.4/components/wpa_supplicant/src/crypto/aes-omac1.c:153

0x4201279c: aes_128_cbc_decrypt at C:/Users/exote/.espressif/frameworks/esp-idf-v4.4/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:363

0x42012732: aes_128_cbc_encrypt at C:/Users/exote/.espressif/frameworks/esp-idf-v4.4/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:341

0x42012724: aes_decrypt_deinit at C:/Users/exote/.espressif/frameworks/esp-idf-v4.4/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:336

MSTATUS : 0x00001881  MTVEC   : 0x40380001  MCAUSE  : 0x00000007  MTVAL   : 0x3ff44578
0x40380001: _vector_table at ??:?

MHARTID : 0x00000000

idfMonitorLogs.log

Other items if possible

  • [sdkconfig.zip ] sdkconfig file (attach the sdkconfig file from your project folder)
  • [ scan.zip] elf file in the build folder (note this may contain all the code details and symbols of your project.)
  • [ included in idfMonitorLogs.log ] coredump (This provides stacks of tasks.)
  • full project archive AFETest.zip
@jack0c
Copy link
Collaborator

jack0c commented Aug 31, 2023

yes, this is a bug, will fix soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants