-
-
Notifications
You must be signed in to change notification settings - Fork 26
Nicla fw optimizations #45
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
Conversation
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
Memory usage change @ 57529bf
Click for full report table
Click for full report CSV
|
Memory usage change @ 4b7631f
Click for full report table
Click for full report CSV
|
This method works only if Wire slave thread stack is freed when deleted (ArduinoCore-mbed PR #375)
4b7631f
to
e36e7c7
Compare
Memory usage change @ e36e7c7
Click for full report table
Click for full report CSV
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR introduces some firmware improvements and optimizations that aim at simplifying the code and improving its stability, in particular when using the Host board + Nicla Sense setup.
The main change is about the usage of the Eslov Int Pin. In the current released libraries, this pin is used not only for synchronization, but also to signal Nicla board that communication over the Eslov interface is going to start. There is, indeed, a change of pinMode for the ESLOV_INT_PIN. The current used mechanism is the following:
This complex mechanism was required because there was not enough stack space to start both Eslov and BLE interface and run their threads.
Now, thanks to the change introduced by PR #375 in ArduinoCore-mbed which frees the slave thread stack size when
Wire.end()
is called, both Eslov interface and BLE can be activated within theBHY2.begin()
function. Then, one of the two will be eventually disabled.NOTE: this PR cannot be merged before a new release of Nicla core containing the mentioned patch is done!
Other introduced changes:
NICLA_STANDALONE
option added toNiclaConfig
enum. WhenBHY2.begin(NICLA_STANDALONE)
is called, only BoschSensortec is started, while BLEHandler, EslovHandler and DFUManager are NOT started.About this point, some of them are still needed, in particular when issuing a Wire request from the Host board to Nicla Sense. The synchronization mechanism over ESLOV_INT_PIN (
while(!digitalRead(_eslovIntPin)) {}
) may not be enough here, since the callback on Nicla side may be serviced after a certain delay. Therefore we need to add a delay to avoid that a second request is issued before the first one is handled. A more efficient solution here would have been to start a thread that checks the ESLOV_INT_PIN activity, but this could be done only for Portenta and not for the MKR family.Pull request type