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

Three fixes found for ESP32-C6 #9616

Merged
merged 3 commits into from
Sep 12, 2024
Merged

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Sep 12, 2024

  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
Copy link
Collaborator

@dhalbert dhalbert left a comment

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!

@dhalbert dhalbert merged commit fad755d into adafruit:9.1.x Sep 12, 2024
528 checks passed
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