forked from wled/WLED
-
-
Notifications
You must be signed in to change notification settings - Fork 134
[upstream backport] RMT High-priority Interrupt driver - solves flickering problems on esp32, esp32-S2 and esp32-S3 #308
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
abdbe0b
Merge pull request #4980 from willmmiles/0_15_x_rmthi
willmmiles 4c6b352
upgraade all esp32 buildenv to NeoPixelBus 2.7.9
softhack007 86473a8
RMTHI backport to NPB 2.7.9
softhack007 8d41bc4
don't compile RMTHI on unsupprted (old) platforms
softhack007 d70a3a8
additional protection
softhack007 fafcbf9
no file access waiting if we have the flicker-free LEDs driver
softhack007 ad04097
WLEDMM_NO_FILEWAIT => WLEDMM_FILEWAIT
softhack007 cec6e22
small simplification
softhack007 3af8987
disable RMTHI on -S2
softhack007 d1d020b
disable RMTHI on -S3
softhack007 68eee6b
re-enable RMTHI for debugging, simplified buildenv for deugging
softhack007 dc10a76
(minor) fix for WLED_RELEASE_NAM
softhack007 01331b2
Merge branch 'mdev' into flickerFixer_backport
softhack007 db847f5
make sure that the interrupt driver is compiled
softhack007 74a8a95
-S3 and -S2 work with RMTHI now
softhack007 5ce9ba6
finishing touches and cleanup
softhack007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is the cause of your problems: the high priority interrupt assembly layer is being disabled here. Neither
ARDUINO_ARCH_ESP32orESP_IDF_VERSION_MAJORare available as they haven't been included, only command-line defines are available at this point in the file. (Also!defined(__riscv)is implied bydefined(__XTENSA__)).(FWIW the
!defined(CONFIG_BTDM_CTRL_HLI)check there above is also wrong -- it can never be defined at that point in the file sincesdkconfig.hhasn't been included yet.)This change is also unnecessary: the linker will discard the object file if it's never referenced by the application code. (This is the same approach used by all the other unused drivers in NPB.)
The error isn't caught at build time because the
NeoESPRmtHIMethod.cppcode that asks for it to be linked is playing some games with__attribute__((used))in a way that cues the linker to include the file, but at no actual code space or runtime cost. However, if the assembly file is missing, the link will still succeed as the symbol it calls for is never in fact truly used. I'd prioritized runtime performance over developer convenience - sorry about that!Anyways my recommendation is revert all the changes to
lib/NeoESP32RmtHIfrom this patch. Ifbus_wrapper.hnever calls for any RMTHI instances, the linker will discard the .cpp and .S object files, so it ultimately won't affect any build products.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're curious as to the derivation of the symptoms:
CONFIG_BTDM_CTRL_HLI, so the HI driver piggybacks on the Bluetooth driver's handler (as there's only one high priority interrupt level available). This is why it worked on basic ESP32s, but not -S2s and -S3s.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, that's unexpected, but it explains the problems. I still have a problem with my "emergency fallback"
esp32dev_compatV3 buildenv, because its still on NPB 2.7.5.--> i'll do some more experimenting, most likely I can still protect compiling the .s file with
#if !defined(WLED_USE_SHARED_RMT)because this is a command line define.😅 means another round of testing, but at least we now have an explanation that makes sense 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe try
lib_ignore = NeoESP32RmtHIin the environment def for those using older NPB? It might be cleaner.