-
Notifications
You must be signed in to change notification settings - Fork 511
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
Third-party dependency update #1864
Conversation
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.
lgtm. Please document the steps used to upgrade 3rd party dependencies, in particular the dependencies that are not under the third_party
folder. Some rationale for the changes in the concurrent_hal would be helpful
@@ -145,6 +145,7 @@ auto SessionPersist::restore(mbedtls_ssl_context* context, bool renegotiate, uin | |||
|
|||
mbedtls_ssl_handshake_wrapup(context); | |||
size = sizeof(*this); | |||
|
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.
The rationale for whitespace here would be good to include in our style guide.
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.
It's obviously an unintended change 😄 I'll revert it.
* while buffering multiple smaller handshake messages. | ||
* | ||
*/ | ||
#define MBEDTLS_SSL_DTLS_MAX_BUFFERING 16384 |
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.
Please add a doc comment stating why this is less than the recommended value and how the value was derived.
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.
I'll update the header, but for quick reference this is what we've been using with our own implementation of DTLS message queuing.
@@ -691,7 +622,8 @@ void OpenThreadNetif::refreshIpAddresses() { | |||
addresses_[i].mValid = true; | |||
addresses_[i].mPreferred = !memcmp(&config, &active, sizeof(config)); | |||
if (config.mRloc16 != ourRloc16) { | |||
otIp6CreateRandomIid(ot_, &addresses_[i], nullptr); | |||
Random rand; |
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.
What's the reason for this change?
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.
otIp6CreateRandomIid
is no longer available so we are emulating its behavior.
hal/src/nRF52840/concurrent_hal.cpp
Outdated
@@ -384,19 +380,19 @@ int os_mutex_destroy(os_mutex_t mutex) | |||
|
|||
int os_mutex_lock(os_mutex_t mutex) | |||
{ | |||
xSemaphoreTake(mutex, portMAX_DELAY); | |||
xSemaphoreTake(reinterpret_cast<QueueHandle_t>(mutex), portMAX_DELAY); |
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.
SemaphoreHandle_t
?
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.
SemaphoreHandle_t
is just an alias to QueueHandle_t
. FreeRTOS implements almost all of the synchronization primitives on top of the queue. However I agree, it would make sense to use specific types for the sake of clarity and to avoid having to make changes if this ever changes. 👍
return error; | ||
} | ||
|
||
bool otPlatRadioIsEnabled(otInstance *aInstance) |
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.
Is this code that we maintain? if not, it would be clearer to have it in third_party modules.
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.
These sources come (modified) from OpenThread examples
folder. I'd rather not modify the original example sources within our OpenThread fork and unless we create a separate repository just so that we could have them in third_party
folder, I'd prefer to keep things as-is. We have other cases like this as well: e.g. hal/src/nRF52840/mbedtls/
. I'm open to other suggestions to improve this.
I'll create a separate PR targeting the documentation.
As for this one, I doubt the changes I've done warrant documentation in our source code. It was wrong of us to assume that FreeRTOS-specific types (e.g. |
…eba919e81f63ebe5a9745811239a
…023a4d62628eb149fe3d3c3a
…t to SemaphoreHandle_t where appropriate
b75df8e
to
cc694c1
Compare
Review comments addressed. |
Problem
DeviceOS depends on a number of third-party components, which we should strive to keep up to date in order to not be affected by various issues in them possibly fixed in the recent versions. We've had several of such occurances already.
Solution
This PR updates the following dependencies:
LittleFS
We haven't upgraded LittleFS to the latest stable 2.0.0 and are still on 1.x line, because the format of the filesystem has significantly changed and the devices will require to migrate to it. Given that both our bootloader and system firmware require access to the DCT (which is stored as a file in the filesystem) we'll need to be careful with this process, so we'll be evaluating the upgrade to 2.x line separately and will upgrade in a separate PR later on as well.
Steps to Test
Pretty much everything needs to be retested.
Example App
N/A
References
Changelog