fix: ESP32 hard_reset now sets DTR before toggling RTS#342
Conversation
On boards with the classic auto-program circuit (two cross-coupled NPN transistors), EN is only pulled low when DTR and RTS are in opposite states. The previous hard_reset only toggled RTS without controlling DTR, making it ineffective when DTR was in an unknown state. Also updates tests to verify the exact DTR/RTS signal sequences for both hard_reset and enter_bootloader. Made-with: Cursor
✅ Deploy Preview for jumpstarter-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughUpdated the ESP32 driver's Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
hard_reset: On ESP32 boards with the classic auto-program circuit (two cross-coupled NPN transistors, e.g. ESP32 DevKitC), EN is only pulled low when DTR and RTS are in opposite states. The previoushard_resetonly toggled RTS without controlling DTR, so it was ineffective when DTR happened to be in the wrong state. Now explicitly de-asserts DTR before toggling RTS.enter_bootloaderdocs: Updated comments to accurately describe the transistor circuit behavior (DTR/RTS pin states → EN/IO0 effects) instead of the misleading direct-pin comments.test_hard_resetandtest_enter_bootloadernow verify the exact DTR/RTS signal sequences usingPropertyMock, rather than just checking the methods don't crash.Test plan
make pkg-test-jumpstarter-driver-esp32)test_hard_resetasserts DTR=[False], RTS=[True, False]test_enter_bootloaderasserts DTR=[False, True, False], RTS=[True, False]hard_resetnow correctly resets the chipMade with Cursor