← index #14450Issue #14330
Related · high · value 1.421
QUERY · ISSUE

Make MPY ARCH supports for ESP32C3 RISCV

openby m24hopened 2024-05-08updated 2026-03-16
enhancementport-esp32proposed-close

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 regarding this feature, and didn't find any.

Description

I tried to use Micropython to do real-time tasks on the ESP32C3, but it doesn't support hard interrupts, I can't get the timestamp and Pin state of the IRQ event (why don't MPY give such important informations rather then a useless Pin object), and if I use timer for resampling, the time jitter of the timer event is too bad (also a soft interrupt), so I had to try to use native code mpy, but the RISCV architecture of ESP32C3 is not supported, and there is no way to do it without customizing the firmware. How can I get millisecond-level time processing accuracy?

Code Size

I'm not sure about the code size requirement for this feature, maybe it's less than several kilo-bytes.

Implementation

  • I intend to implement this feature and would submit a Pull Request if desirable.
  • I hope the MicroPython maintainers or community will implement this feature.
  • I would like to Sponsor development of this feature.
CANDIDATE · ISSUE

Add 'hard' Pin.irq() support for ESP32

closedby m24hopened 2024-04-19updated 2025-01-07
enhancement

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 regarding this feature, and didn't find any.

Description

Micropython on ESP32 board does not support option 'hard=True' in machine.Pin.irq().

This results in unpredictable effects in the case of faster interrupts, and even the number of call-back function being called far exceeds the number of interrupts that actually occur.

Code Size

Since STM32 platforms have implemented hard interrupts, so I don't think that adds much of a burden.

I once glanced at the source code and felt that it was enough to use mp_call_function_1() instead of mp_sched_schedule, and lock/unlock some resources like GC.

Implementation

  • I intend to implement this feature and would submit a Pull Request if desirable.
  • I hope the MicroPython maintainers or community will implement this feature.
  • I would like to Sponsor development of this feature.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied