-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add Mbed OS support into CHIP #6355
Conversation
e386244
to
45299a6
Compare
cafdb1c
to
db923c6
Compare
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.
Reviewed build files so far.
) | ||
|
||
list(APPEND CHIP_DEFINES | ||
__LINUX_ERRNO_EXTENSIONS__=1 |
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 does this do?
Is errno task local in Mbed ?
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.
We need that define to access all the error codes required by our BSD socket implementation.
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 errno task local in Mbed ?
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'm not sure to understand what you mean by task. The errno
variable (not really a variable by default with newlib) should be global to the application and there is mechanism in place in newlib and Mbed to handle concurrent access.
It seems this adds support for Mbed by adding adapters for various POSIX (sockets) and even Linux-specific APIs (eventfds). Is the aim to just keep using an adapter to POSIX & Linux APIs going forward? |
@Damian-Nordic @mspang I think I addressed all your comments. Fixes are in new commit that I can rebase once everything has been reviewed.
As long as CHIP doesn't expose a platform abstraction for networking, we would prefer keep it that way. We could have chosen to go the LWIP way but this would cut part of our user base out of CHIP if they use an off-board stack and it could cause other issues with part of the user application that wants to use Mbed OS API for networking instead of CHIP API. The plan is to upstream the BSD socket layer we created to Mbed OS in a near future so this won't stay forever in that repository. |
422cef1
to
be9bd81
Compare
@mspang Is there anything else I can do to move this forward ? |
Update according to changes to project-chip#6765 .
Size increase report for "nrfconnect-example-build" from 8d7486f
Full report output
|
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.
@mspang Is there anything else I can do to move this forward ?
What's the ETA for landing the POSIX adaptation in your SDK?
"cStandard": "c11", | ||
"cppStandard": "gnu++14", | ||
"intelliSenseMode": "gcc-arm", | ||
"compilerPath": "/opt/mbed-os-toolchain/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gcc", |
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 path right?
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.
Yes it is:
RUN set -x \ | |
&& (mkdir -p /opt/mbed-os-toolchain \ | |
&& cd /opt/mbed-os-toolchain \ | |
&& wget --progress=dot:giga https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 \ | |
&& tar -xjf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 \ | |
&& rm gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 \ | |
&& : ) # last line | |
# ------------------------------------------------------------------------------ | |
# Configure mbed build system | |
RUN set -x \ | |
&& mbed config -G GCC_ARM_PATH /opt/mbed-os-toolchain/gcc-arm-none-eabi-9-2019-q4-major/bin/ \ | |
&& mbed toolchain -G -s GCC_ARM \ | |
&& : # last line |
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.
Can you dedupe this please, we already had a copy of ARM gcc:
COPY --from=nrf /opt/ARM-software/gcc-arm-none-eabi-9-2019-q4-major /opt/ARM-software/gcc-arm-none-eabi-9-2019-q4-major |
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.
Sure, I will open a PR to modify the docker image.
@mspang I don't have a precise picture on when the BSD socket adaptation will land in Mbed OS. My aim is before the end of the summer. Is it a concern to have it in the Mbed OS port for now ? We can move it out of CHIP in another repo under the |
Landing this now risks Mbed becoming the last platform using the select() API for I/O polling. Adapting to a partial implementation of the POSIX APIs we were using puts us in an awkward situation; Mbed may be missing something that we need.
|
I'm not sure to understand how the problematic is different from Linux or Zephyr which uses select today. Is there a proposed API for #5556 ? |
I've only been working with the _POSIX implementation, with the intent to convert the _Zephyr version afterward. This version looks substantially similar, so I don't think a third copy makes much difference in that respect. Practically speaking, the immediate platform work is just shuffling some fragments of The first draft API for #5556 was #6561 (see *EndPoint.cpp for examples of use). My current WIP is substantially similar but also encapsulates the file descriptor and active conditions ( One thing I notice in this PR is a change to the functionality of |
Thanks, I will review #6561.
It addresses and issue in connectedhomeip/src/inet/UDPEndPoint.cpp Lines 647 to 655 in f6f2bfa
If |
These generic bug fixes or other uncoupled changes should really be separated out into standalone PRs. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This stale pull request has been automatically closed. Thank you for your contributions. |
@pan- Your PR was approved, are you able to rebase it? |
/rebase |
@mspang I was planning in making a new one since that was was marked at stalled while the BLE flow was broken...
We also support more examples but I will open new PRs for them. |
Ok, opening a new PR sounds fine. |
Problem
There is no support for Mbed OS in CHIP.
Summary of Changes
Add Mbed OS support to CHIP.
It requires the PR #6352 to be merged and the Mbed OS docker image to be pushed on dockerhub to pass the build workflow.
Few details about the port:
There is few commits in this PR which could be their own PRs. I want guidance on what I should do with them:
ec3566b: Update the Android workflow to archive the APK created by the build.In term of future work here is what the Mbed OS team supporting CHIP will work on next:
test_driver