294 Star 1.6K Fork 391

GVP合宙Luat / LuatOS

 / 详情

[🐛Bug]: ESP32C3wifi的SSID或密码错误时内核报错

已完成
创建于  
2024-05-06 11:34

描述一下这个bug / Describe the bug

问题描述如题,编译固件包含wlan和nimble和LUAT_CONF_WIFI_AND_BLE具体报错如下:

复现步骤 / To Reproduce

只要将demo里的密码ssid改成错误的或不存在的就可以复现
PROJECT = "wifidemo"
VERSION = "1.0.0"

-- 引入必要的库文件(lua编写), 内部库不需要require
sys = require("sys")
require("sysplus")

-- sys.subscribe("WLAN_READY", function ()
-- print("!!! wlan ready event !!!")
-- end)

-- sys.taskInit(function()
-- while 1 do
-- sys.wait(5000)
-- log.info("lua", rtos.meminfo())
-- log.info("sys", rtos.meminfo("sys"))
-- end

-- end)

-- 兼容V1001固件的
if http == nil and http2 then
http = http2
end

sys.taskInit(function()
sys.wait(1000)
wlan.init()
wlan.connect("luatos1234", "12341234")
log.info("wlan", "wait for IP_READY")
sys.waitUntil("IP_READY", 30000)
if wlan.ready() then
log.info("wlan", "ready !!")
sys.wait(100)
local url = "http://ip.nutz.cn/json"
-- local url = "http://nutzam.com/1.txt"
local code, headers, body = http.request("GET", url).wait()
log.info("http", code, json.encode(headers or {}), body and #body or 0)
if body and #body < 512 then
log.info("body", body)
end
else
print("wlan NOT ready!!!!")
end
log.info("wlan", "test done")
end)

sys.taskInit(function()
while 1 do
sys.wait(3000)
log.info("lua", rtos.meminfo())
log.info("sys", rtos.meminfo("sys"))
end
end)

-- 用户代码已结束---------------------------------------------
-- 结尾总是这一句
sys.run()

如果正常,应该是什么样 / Expected behavior

如果是1006固件,密码错误wifi会一直重连,但是1006固件不支持蓝牙和wlan一起使用

截图 / Screenshots

输入图片说明

日志 / Logs

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

Core 0 register dump:
MEPC : 0x42023940 RA : 0x420238d4 SP : 0x3fcd3560 GP : 0x3fc97c00
0x42023940: net_lwip_task at F:/ESP32/LuatOS/components/network/adapter_lwip2/luat_network_adapter_lwip2.c:718
0x420238d4: net_lwip_task at F:/ESP32/LuatOS/components/network/adapter_lwip2/luat_network_adapter_lwip2.c:694

TP : 0x3fca2f4c T0 : 0x4005890e T1 : 0x40393324 T2 : 0x00000000
0x4005890e: _data_end_btdm_rom in ROM
0x40393324: multi_heap_realloc_impl at F:/ESP-IDF/esp-idf/components/heap/multi_heap.c:265

S0/FP : 0x3fcae348 S1 : 0x00000002 A0 : 0x00000001 A1 : 0x00000121
A2 : 0xf300000c A3 : 0x3fcc0038 A4 : 0x00000000 A5 : 0x3fcae0d2
A6 : 0x00000000 A7 : 0x3fcb3000 S2 : 0x3fcae0d0 S3 : 0x00000002
S4 : 0x00000000 S5 : 0x00000003 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x00000000 T4 : 0x00000000 T5 : 0x00000000 T6 : 0x00000000
MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000005 MTVAL : 0x00000004
0x40380001: _vector_table at ??:?

MHARTID : 0x00000000

Stack memory:
3fcd3560: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd3580: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd35a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd35c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x3fcd98e0 0x3fcb3000 0x00000000 0x00000000
3fcd35e0: 0x3fcba148 0x00000003 0x00000004 0x00000002 0x3fcd1364 0x3fcb3000 0xffffffff 0x42085f60
0x42085f60: nvs::Page::load(nvs::Partition*, unsigned long) at F:/ESP-IDF/esp-idf/components/nvs_flash/src/nvs_page.cpp:54

3fcd3600: 0x00000000 0x00000000 0x00000000 0x3fcd1364 0x00000000 0x00000000 0x00000000 0x00000000
3fcd3620: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd3640: 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
3fcd3660: 0x00000154 0x3fcd3510 0x00004e8b 0x3fc9adfc 0x3fc9adfc 0x3fcd3664 0x3fc9adf4 0x00000007
3fcd3680: 0x3fcd13b4 0x3fcd13b4 0x3fcd3664 0x00000000 0x00000012 0x3fcd1460 0x00546974 0xa64d566e
3fcd36a0: 0x6e6d7df3 0x00f8dc35 0x00000000 0x3fcd3650 0x00000012 0x00000000 0x00000000 0x00000000
3fcd36c0: 0x00000000 0x3fcb4f8c 0x3fcb4ff4 0x3fcb505c 0x00000000 0x00000000 0x00000001 0x00000000
3fcd36e0: 0x00000000 0x00000000 0x4210167e 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x4210167e: __ieee754_powf at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/newlib/newlib/libm/math/ef_pow.c:197

3fcd3700: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd3720: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd3740: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd3760: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd3780: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcd37a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x3f000000 0x00000054 0x3fcd37bc
3fcd37c0: 0x3fcd37bc 0x3fcd37bc 0x3fcd37bc 0x00000000 0x3fcd37d4 0xffffffff 0x3fcd37d4 0x3fcd37d4
3fcd37e0: 0x00000000 0x3fcd37e8 0xffffffff 0x3fcd37e8 0x3fcd37e8 0x00000000 0x00000001 0x00000000
3fcd3800: 0xd700ffff 0x00000000 0xb33fffff 0x00000000 0x0000000c 0x00000000 0x3fcd3824 0x00000000
3fcd3820: 0x00000010 0x3c13cfa0 0x3fcd3838 0x3fcd39d8 0x3fcd3858 0x0000000c 0x3fcd3848 0x00000000
3fcd3840: 0x3fcd3830 0x0000000c 0x420410e6 0x00000000 0x3fcd3840 0x00000010 0x3c13c688 0x3fcd386c
0x420410e6: add_value at F:/ESP32/LuatOS/lua/src/lstrlib.c:757
(inlined by) str_gsub at F:/ESP32/LuatOS/lua/src/lstrlib.c:786

3fcd3860: 0x3fcd3af8 0x3fcd388c 0x0000000c 0x3fcd387c 0x00000000 0x3fcd3864 0x0000000c 0x42041030
0x42041030: str_gsub at F:/ESP32/LuatOS/lua/src/lstrlib.c:778

3fcd3880: 0x00000000 0x3fcd3874 0x00000010 0x3c13cda0 0x3fcd38a0 0x00000000 0x00000000 0x0000000c
3fcd38a0: 0x3fcd38b0 0x00000000 0x3fcd3898 0x0000000c 0x42040e64 0x00000000 0x3fcd38a8 0x00000060
0x42040e64: match at F:/ESP32/LuatOS/lua/src/lstrlib.c:498

3fcd38c0: 0xd13bdaec 0x0000b8be 0x3fcd3924 0x3fcd3934 0x3fcd3944 0x420dffae 0x420dff4a 0x3fcd3944
0x420dffae: sc_ieee80211_data_extract at ??:?
0x420dff4a: sc_ieee80211_data_extract at ??:?

3fcd38e0: 0x00000000 0x00000000 0x3fcd39c8 0x421173ea 0x4038b93e 0x421173e0 0x00000000 0x00000000
0x421173ea: gptimer_new_timer at F:/ESP-IDF/esp-idf/components/driver/gptimer/gptimer.c:128
0x4038b93e: rtc_sleep_init at F:/ESP-IDF/esp-idf/components/esp_hw_support/port/esp32c3/rtc_sleep.c:172
0x421173e0: gptimer_register_to_group at F:/ESP-IDF/esp-idf/components/driver/gptimer/gptimer.c:65
(inlined by) gptimer_new_timer at F:/ESP-IDF/esp-idf/components/driver/gptimer/gptimer.c:122

3fcd3900: 0x00000000 0x00000000 0x00000001 0x00000019 0x3fcd46f4 0x3fcd39a4 0x3fcd39b8 0x00000064
3fcd3920: 0x0000000c 0x00000000 0x00000000 0x00000000 0x0000000c 0x00000000 0x00000000 0x00000000
3fcd3940: 0x0000004c 0x3fcafb78 0x00000000 0x00000000 0x00000000 0x42086068 0x420919c8 0x420dfebe
0x42086068: nvs::Page::alterPageState(nvs::Page::PageState) at F:/ESP-IDF/esp-idf/components/nvs_flash/src/nvs_page.cpp:837
(inlined by) nvs::Page::markFull() at F:/ESP-IDF/esp-idf/components/nvs_flash/src/nvs_page.cpp:1023
0x420919c8: tcp_zero_window_probe at F:/ESP-IDF/esp-idf/components/lwip/lwip/src/core/tcp_out.c:2158
0x420dfebe: sc_cmp_bssid_crc at ??:?

ELF file SHA256: 9ea9da0bcd4fa62c
Warning: checksum mismatch between flashed and built applications. Checksum of built application is f5345951dfc9abafeda2615c292acf7a511f99ab7f436abbe0650ee5bfedf152

Rebooting...

PACK包版本 / Version

V1007

验证

  • 检查过该问题,之前没有人提过 / Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • 提供了最小可复现工程或详细的复现步骤,确保开发者可以复现 / The provided reproduction is a minimal reproducible example of the bug.
  • 已经提供了完整的报错信息、日志、截图,没有经过删减。

评论 (4)

yeyeyeah233 创建了任务
yeyeyeah233 修改了描述
展开全部操作日志

像是内存不够

不是吧,我用的demo代码测试的,之后我又在云编译把蓝牙去掉,光用wifi也是这么报错

yeyeyeah233 修改了描述

待我试试

修复了, 多谢反馈

Wendal 负责人设置为Wendal
Wendal 任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
4674 wendal 1578914274
Lua
1
https://gitee.com/openLuat/LuatOS.git
git@gitee.com:openLuat/LuatOS.git
openLuat
LuatOS
LuatOS

搜索帮助

344bd9b3 5694891 D2dac590 5694891