← index #8693PR #7258
Related · medium · value 0.647
QUERY · ISSUE

Motor doesn't work under idf 4.2.2 + micropython 1.18

openby JackieLsopened 2022-05-24updated 2022-05-31
bugport-esp32

I build the esp32-micropython which is based v1.18 with the idf-4.2.2, It's worked well for led, except the motor.
But when I use the micropython master branch with the idf-4.4.1.All is right.
1、Is there any konwn reason about this?
2、Is the master branch is a statable branch ? May I use this branch?

CANDIDATE · PULL REQUEST

Pin ESP32 to core 1 once again ftw

closedby breedx2opened 2021-05-12updated 2022-01-21
port-esp32

Hi friends. New contributor, but pretty experienced...and hopefully I have done my homework. Phew, there is a lot of context/history in a very small PR here... :)

Originally we had some latency issues that were resolved by pinning micropython to a core, specifically opposite of the other stuff going on (BLE/Wifi). That "other stuff" could introduce latency or jitter in timer or interrupt callback delivery. All good, cool workaround.

Some of this seemed to be rooted in an upstream bug in IDF < 4.2, so we pinned everything to core0 in the esp32 port. Related.. There were comments to indicate that when this upstream situation was resolved we could undo this...

Time passed. A major branch got integrated. The core pinning stayed or otherwise got left behind as IDF improved (I couldn't track down the root cause in IDF).

Fast forward to the future...and I boot up a project based on the 1.15 release, and I'm doing what I think to be a pretty simple thing -- 1ms pin toggles based on a Timer. It's rock solid, until I turn on wifi...at which point it becomes unstable (even with no traffic). I make a pretty basic test case that I can put on the oscilloscope and it is solid without wifi, significantly jittery with wifi on.

LOTS of digging ensues, and I end up finding the above-related issues.

I checked out the main branch and built with IDF 4.2.1, same problem. I made the change in this PR and presto the problem goes away and the latency is solid again. Woohoo! Let's do this!

Sadly, my target device doesn't leverage BLE so I'm able to verify that this doesn't regress the original issue...but I can verify that Timer() instances now deliver with negligible jitter when WiFi is on. Can others with BLE-based targets confirm that this patch doesn't impact them? Are we ready to roll with pinning to core 1 again please, cuz this 100% helps me.

Thanks thanks.

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