ESP32 without psram. Socket and Memory Split or ... .
Checks
-
I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.
-
I've searched for existing issues matching this bug, and didn't find any.
Port, board and/or hardware
ESP32 withou PSRAM / ESP32-C3
MicroPython version
Micropython 23.0-preview.346.g64f28dc1e on 2024-05-03
Reproduction
>>> gc.collect()
>>> micropython.mem_info()
stack: 704 out of 15360
GC: total: 112000, used: 71008, free: 40992, max new split: 21504
No. of 1-blocks: 979, 2-blocks: 263, max blk sz: 142, max free sz: 133
>>> s1=socket.socket()
>>>
>>> gc.collect()
>>> micropython.mem_info()
stack: 704 out of 15360
GC: total: 112000, used: 71040, free: 40960, max new split: 20480
No. of 1-blocks: 977, 2-blocks: 265, max blk sz: 142, max free sz: 133
>>> s2=socket.socket()
>>>
>>> gc.collect()
>>> micropython.mem_info()
stack: 704 out of 15360
GC: total: 112000, used: 71072, free: 40928, max new split: 20480
No. of 1-blocks: 977, 2-blocks: 266, max blk sz: 142, max free sz: 133
>>> s3=socket.socket()
>>>
>>> gc.collect()
>>> micropython.mem_info()
stack: 704 out of 15360
GC: total: 131968, used: 75584, free: 56384, max new split: 248
No. of 1-blocks: 976, 2-blocks: 268, max blk sz: 282, max free sz: 966
>>> s4=socket.socket()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 105] ENOBUFS
Expected behaviour
No response
Observed behaviour
-
Connected to WIFI.
-
Already open 3 socket with FTP, TELNET, MQTT
All works
However, when I attempt to create an additional socket for testing purposes, I encounter an error: OSError: [Errno 105] ENOBUFS. Following this error, the WiFi functionality ceases to work.
Additional Information
Any guidance on how to resolve this issue would be greatly appreciated.
ESP32C3 BLE get panic when some 10-20k byte arrays is allocated otherwhere before
Checks
-
I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.
-
I've searched for existing issues matching this bug, and didn't find any.
Port, board and/or hardware
ESP32C3
MicroPython version
MicroPython v1.22.2 on 2024-02-22; LOLIN_C3_MINI with ESP32-C3FH4
Reproduction
`MicroPython v1.22.2 on 2024-02-22; LOLIN_C3_MINI with ESP32-C3FH4
Type "help()" for more information.
import micropython as m
m.mem_info()
stack: 1012 out of 14336
GC: total: 64000, used: 11392, free: 52608, max new split: 139264
No. of 1-blocks: 200, 2-blocks: 29, max blk sz: 94, max free sz: 3278
a=bytes(20000)
b=bytes(20000)
import bluetooth
m.mem_info()
stack: 1012 out of 14336
GC: total: 139968, used: 122640, free: 17328, max new split: 65536
No. of 1-blocks: 84, 2-blocks: 13, max blk sz: 4747, max free sz: 531
ble=bluetooth.BLE()
ble.active()
False
ble.active(True)
Guru Meditation Error: Core 0 panic'ed (Store access fault). Exception was unhandled.
Core 0 register dump:
MEPC : 0x4205e2ba RA : 0x4205f9fa SP : 0x3fca8760 GP : 0x3fc97c00
TP : 0x3fc6e5f4 T0 : 0x0000201d T1 : 0x00000000 T2 : 0x42067bc6
S0/FP : 0x3fc9f868 S1 : 0x000141eb A0 : 0x3fca0ab0 A1 : 0x00000000
A2 : 0x00000000 A3 : 0x000049be A4 : 0x00000002 A5 : 0x00000001
A6 : 0x00000000 A7 : 0xac400000 S2 : 0x000149bb S3 : 0x000007d0
S4 : 0x3fc9ae5c S5 : 0x00000003 S6 : 0x3fffffff S7 : 0x3fca99fd
S8 : 0x00000030 S9 : 0x3c141000 S10 : 0x3c141000 S11 : 0x3c141000
T3 : 0x00000000 T4 : 0x00014204 T5 : 0x0000201e T6 : 0x42068332
MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000007 MTVAL : 0x00000000
MHARTID : 0x00000000
Stack memory:
3fca8760: 0x000000c0 0x3fcaa3d0 0x3fc9f738 0x42027a5a 0x3fffffff 0x3ffffffe 0x40000000 0x3fca98c0
3fca8780: 0x000000c0 0x3fca895c 0x3fca99fe 0x4201bce6 0x000000c0 0x3fca895c 0x3fca99fe 0x40382f12
3fca87a0: 0x3fca8954 0x00000008 0x3fca8968 0x3fca8940 0x3c14888c 0x3fc9ae5c 0x3fca8964 0x00000000
3fca87c0: 0x00002dda 0x3fca8920 0x00000000 0x3fca895c 0x00000020 0x3fca8920 0x3fca89c8 0x4203f348
3fca87e0: 0x403828fa 0x3fca89a0 0x3fc9aeb8 0x00000000 0x00000000 0x00000000 0x00000005 0x00000000
3fca8800: 0x3fca8940 0x00000030 0x3c141000 0x3c141000 0x3c141000 0x3fca87a0 0x000000a8 0x000000a7
3fca8820: 0x00000030 0x3fcaa7f0 0x00000032 0x3fcaa804 0x3fca8920 0x00000002 0x00000002 0x4203f860
3fca8840: 0x00000000 0x000000a6 0x00000000 0x00000001 0x00000000 0x3fca8920 0x00000001 0x4203f348
3fca8860: 0x3fca8954 0x00000001 0x00000001 0x3fcaa80c 0x3c141000 0x3c141000 0x00000001 0x3fca886c
3fca8880: 0x00000030 0x3fcaa81c 0x00000032 0x3c141000 0x3c141000 0x3c141000 0x00000001 0x00000000
3fca88a0: 0x00000030 0x3fcaa81c 0x00000032 0x3fcaa830 0x3fca8920 0x00000002 0x00000002 0x4203f860
3fca88c0: 0x00000002 0x000000e9 0x3fca89c0 0x00000004 0x00000000 0x3fcaa848 0x3fca8920 0x4203db6e
3fca88e0: 0x00000000 0x00000001 0x3fca89c0 0x00000004 0x00000002 0x00000005 0x00000014 0x00000005
3fca8900: 0x3fcaa3d0 0x0000000f 0x3fca98e0 0x3c141000 0x3c141000 0x3c141000 0x00000030 0x3fca8940
3fca8920: 0x00000000 0x00000005 0x00000000 0x00000000 0x00000000 0x3fc9aeb8 0x3fca89a0 0x4200f29a
3fca8940: 0x3fca98e0 0x3fca99fc 0x3fca8950 0x00000005 0x3fc9aeb8 0x3fcaa1d0 0x3fcaa2e0 0x3c1490bc
3fca8960: 0x3fca98b0 0x0000001e 0x3fca89a0 0x4200f1ec 0x3c14b000 0x3c14b000 0x3c142000 0x3fcb8be8
3fca8980: 0x3c14b000 0x3c14b000 0x3c14b000 0x3c143000 0x420291f8 0x420291c2 0x3fca98e0 0x420290b0
3fca89a0: 0x00003800 0x00000011 0x3fca8b30 0x00000001 0x3c171d39 0xffffffff 0x3c1404ac 0x00000002
3fca89c0: 0x3fcaa848 0x3fcaa7d0 0x00000000 0x00000000 0x4202902c 0x00000004 0x420291c2 0x420291f8
3fca89e0: 0x3c143000 0x3c14b000 0x3c14b000 0x3c14b000 0x3fcb8be8 0x3c142000 0x3c141000 0x3c141000
3fca8a00: 0x3c141000 0x3fca89a0 0x3c1417f0 0x00000001 0x4202902c 0x00000000 0x3c1417e4 0x00000001
3fca8a20: 0x4038ffca 0x40391e9c 0x3fca8aa0 0x3fc97c00 0x40391e9c 0x40391e9c 0x3fca8ab0 0x3fc97c00
3fca8a40: 0x4038ffa0 0x40390708 0x3fca8ac0 0x3fc97c00 0x3fc6e5f4 0x6d3c2228 0x40390902 0x203a276e
3fca8a60: 0x4038ffa0 0x4039210e 0x3fca8ae0 0x3fc97c00 0x3fc6e5f4 0x203a2762 0x40390902 0x27202c29
3fca8a80: 0x3fc9f650 0x00000000 0x00000000 0x3fcdce10 0x600c0000 0x00000001 0x00000001 0x600c2000
3fca8aa0: 0x00000003 0x0000015c 0x3fc9afdc 0x40390b84 0x00000001 0x3c14b000 0x3c14b000 0xffffffff
3fca8ac0: 0x3c142000 0x3c141000 0x3c141000 0x3c141000 0x00000002 0x00000fa0 0x3c14b000 0x3c143000
3fca8ae0: 0x3c14b000 0x3c14b000 0x3c14b000 0x3c143000 0x420291f8 0x3c161270 0x00000002 0x42006660
3fca8b00: 0x420291f8 0x420291c2 0x00000004 0x420293d2 0x00000000 0x00000000 0x3fca1e78 0x403906f0
3fca8b20: 0x00003800 0x3fca8be8 0x42006000 0x00000000 0x000005d8 0x00000033 0x3fca9bd0 0x3fc9ae00
3fca8b40: 0x00003800 0x3fca8be8 0x42006000 0x3fcb8be8 0x00003800 0x3fca8be8 0x42006000 0x3fc9ae5c
ELF file SHA256: 9327e703ea8d9c28
Rebooting...
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0xc (RTC_SW_CPU_RST),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x403807a8
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0xe8c
load:0x403cc710,len:0x6ec
load:0x403ce710,len:0x2b24
entry 0x403cc710
`
Expected behaviour
No response
Observed behaviour
MicroPython v1.22.2 on 2024-02-22; LOLIN_C3_MINI with ESP32-C3FH4
Type "help()" for more information.
import micropython as m
m.mem_info()
stack: 1012 out of 14336
GC: total: 64000, used: 11392, free: 52608, max new split: 139264
No. of 1-blocks: 200, 2-blocks: 29, max blk sz: 94, max free sz: 3278
a=bytes(20000)
b=bytes(20000)
import bluetooth
m.mem_info()
stack: 1012 out of 14336
GC: total: 139968, used: 122640, free: 17328, max new split: 65536
No. of 1-blocks: 84, 2-blocks: 13, max blk sz: 4747, max free sz: 531
ble=bluetooth.BLE()
ble.active()
False
ble.active(True)
Guru Meditation Error: Core 0 panic'ed (Store access fault). Exception was unhandled.
Core 0 register dump:
MEPC : 0x4205e2ba RA : 0x4205f9fa SP : 0x3fca8760 GP : 0x3fc97c00
TP : 0x3fc6e5f4 T0 : 0x0000201d T1 : 0x00000000 T2 : 0x42067bc6
S0/FP : 0x3fc9f868 S1 : 0x000141eb A0 : 0x3fca0ab0 A1 : 0x00000000
A2 : 0x00000000 A3 : 0x000049be A4 : 0x00000002 A5 : 0x00000001
A6 : 0x00000000 A7 : 0xac400000 S2 : 0x000149bb S3 : 0x000007d0
S4 : 0x3fc9ae5c S5 : 0x00000003 S6 : 0x3fffffff S7 : 0x3fca99fd
S8 : 0x00000030 S9 : 0x3c141000 S10 : 0x3c141000 S11 : 0x3c141000
T3 : 0x00000000 T4 : 0x00014204 T5 : 0x0000201e T6 : 0x42068332
MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000007 MTVAL : 0x00000000
MHARTID : 0x00000000
Stack memory:
3fca8760: 0x000000c0 0x3fcaa3d0 0x3fc9f738 0x42027a5a 0x3fffffff 0x3ffffffe 0x40000000 0x3fca98c0
3fca8780: 0x000000c0 0x3fca895c 0x3fca99fe 0x4201bce6 0x000000c0 0x3fca895c 0x3fca99fe 0x40382f12
3fca87a0: 0x3fca8954 0x00000008 0x3fca8968 0x3fca8940 0x3c14888c 0x3fc9ae5c 0x3fca8964 0x00000000
3fca87c0: 0x00002dda 0x3fca8920 0x00000000 0x3fca895c 0x00000020 0x3fca8920 0x3fca89c8 0x4203f348
3fca87e0: 0x403828fa 0x3fca89a0 0x3fc9aeb8 0x00000000 0x00000000 0x00000000 0x00000005 0x00000000
3fca8800: 0x3fca8940 0x00000030 0x3c141000 0x3c141000 0x3c141000 0x3fca87a0 0x000000a8 0x000000a7
3fca8820: 0x00000030 0x3fcaa7f0 0x00000032 0x3fcaa804 0x3fca8920 0x00000002 0x00000002 0x4203f860
3fca8840: 0x00000000 0x000000a6 0x00000000 0x00000001 0x00000000 0x3fca8920 0x00000001 0x4203f348
3fca8860: 0x3fca8954 0x00000001 0x00000001 0x3fcaa80c 0x3c141000 0x3c141000 0x00000001 0x3fca886c
3fca8880: 0x00000030 0x3fcaa81c 0x00000032 0x3c141000 0x3c141000 0x3c141000 0x00000001 0x00000000
3fca88a0: 0x00000030 0x3fcaa81c 0x00000032 0x3fcaa830 0x3fca8920 0x00000002 0x00000002 0x4203f860
3fca88c0: 0x00000002 0x000000e9 0x3fca89c0 0x00000004 0x00000000 0x3fcaa848 0x3fca8920 0x4203db6e
3fca88e0: 0x00000000 0x00000001 0x3fca89c0 0x00000004 0x00000002 0x00000005 0x00000014 0x00000005
3fca8900: 0x3fcaa3d0 0x0000000f 0x3fca98e0 0x3c141000 0x3c141000 0x3c141000 0x00000030 0x3fca8940
3fca8920: 0x00000000 0x00000005 0x00000000 0x00000000 0x00000000 0x3fc9aeb8 0x3fca89a0 0x4200f29a
3fca8940: 0x3fca98e0 0x3fca99fc 0x3fca8950 0x00000005 0x3fc9aeb8 0x3fcaa1d0 0x3fcaa2e0 0x3c1490bc
3fca8960: 0x3fca98b0 0x0000001e 0x3fca89a0 0x4200f1ec 0x3c14b000 0x3c14b000 0x3c142000 0x3fcb8be8
3fca8980: 0x3c14b000 0x3c14b000 0x3c14b000 0x3c143000 0x420291f8 0x420291c2 0x3fca98e0 0x420290b0
3fca89a0: 0x00003800 0x00000011 0x3fca8b30 0x00000001 0x3c171d39 0xffffffff 0x3c1404ac 0x00000002
3fca89c0: 0x3fcaa848 0x3fcaa7d0 0x00000000 0x00000000 0x4202902c 0x00000004 0x420291c2 0x420291f8
3fca89e0: 0x3c143000 0x3c14b000 0x3c14b000 0x3c14b000 0x3fcb8be8 0x3c142000 0x3c141000 0x3c141000
3fca8a00: 0x3c141000 0x3fca89a0 0x3c1417f0 0x00000001 0x4202902c 0x00000000 0x3c1417e4 0x00000001
3fca8a20: 0x4038ffca 0x40391e9c 0x3fca8aa0 0x3fc97c00 0x40391e9c 0x40391e9c 0x3fca8ab0 0x3fc97c00
3fca8a40: 0x4038ffa0 0x40390708 0x3fca8ac0 0x3fc97c00 0x3fc6e5f4 0x6d3c2228 0x40390902 0x203a276e
3fca8a60: 0x4038ffa0 0x4039210e 0x3fca8ae0 0x3fc97c00 0x3fc6e5f4 0x203a2762 0x40390902 0x27202c29
3fca8a80: 0x3fc9f650 0x00000000 0x00000000 0x3fcdce10 0x600c0000 0x00000001 0x00000001 0x600c2000
3fca8aa0: 0x00000003 0x0000015c 0x3fc9afdc 0x40390b84 0x00000001 0x3c14b000 0x3c14b000 0xffffffff
3fca8ac0: 0x3c142000 0x3c141000 0x3c141000 0x3c141000 0x00000002 0x00000fa0 0x3c14b000 0x3c143000
3fca8ae0: 0x3c14b000 0x3c14b000 0x3c14b000 0x3c143000 0x420291f8 0x3c161270 0x00000002 0x42006660
3fca8b00: 0x420291f8 0x420291c2 0x00000004 0x420293d2 0x00000000 0x00000000 0x3fca1e78 0x403906f0
3fca8b20: 0x00003800 0x3fca8be8 0x42006000 0x00000000 0x000005d8 0x00000033 0x3fca9bd0 0x3fc9ae00
3fca8b40: 0x00003800 0x3fca8be8 0x42006000 0x3fcb8be8 0x00003800 0x3fca8be8 0x42006000 0x3fc9ae5c
ELF file SHA256: 9327e703ea8d9c28
Rebooting...
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0xc (RTC_SW_CPU_RST),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x403807a8
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0xe8c
load:0x403cc710,len:0x6ec
load:0x403ce710,len:0x2b24
entry 0x403cc710
Additional Information
It's strange why the GC report seems to be enlarged after applying for two pieces of memory.
GC: total: 64000, used: 11392, free: 52608, max new split: 139264
No. of 1-blocks: 200, 2-blocks: 29, max blk sz: 94, max free sz: 3278
a=bytes(20000)
b=bytes(20000)
import bluetooth
m.mem_info()
stack: 1012 out of 14336
GC: total: 139968, used: 122640, free: 17328, max new split: 65536
No. of 1-blocks: 84, 2-blocks: 13, max blk sz: 4747, max free sz: 531