Skip to content

Three fixes found for ESP32-C6#9616

Merged
dhalbert merged 3 commits into
adafruit:9.1.xfrom
tannewt:fix_c6_crash
Sep 12, 2024
Merged

Three fixes found for ESP32-C6#9616
dhalbert merged 3 commits into
adafruit:9.1.xfrom
tannewt:fix_c6_crash

Conversation

@tannewt

@tannewt tannewt commented Sep 12, 2024

Copy link
Copy Markdown
Member
  1. Correctly free memory used by ESP _bleio.Characteristic by adding deinit().
  2. Correct gc_alloc_possible() because it was true after the first VM run and caused BLE characteristic allocations outside the VM to occur on the VM heap.
  3. Clear the serial RX buffer when receiving a CTRL-C. Without clearing it, you may skip straight to the REPL without the "press any key" prompt. The file transfer over serial stuff looks for the "press any key" line.

Espressif's Characteristics allocate memory that may be on the
supervisor heap. We need to free it when stopping BLE workflow.
Otherwise, we leak the memory and eventually safe mode.

Fixes micropython#9599
The BLE workflow was allocating to the VM heap when it wasn't
active and causing a port_malloc.
Some serial sources clear their RX buffers and others didn't. This
cause CP to skip into the REPL based on characters typed before the
CTRL-C. The serial file transfer code looks for "press any key"
which is skipped in this case.

Fixes circuitpython/web-editor#238

@dhalbert dhalbert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of interrelated fixes. Thanks for the debugging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants