Skip to content
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

native drivers and backends not yet supported with embedded C libraries #60096

Open
9 of 13 tasks
aescolar opened this issue Jul 6, 2023 · 3 comments
Open
9 of 13 tasks
Labels
area: native port Host native arch port (native_posix) Enhancement Changes/Updates/Additions to existing features

Comments

@aescolar
Copy link
Member

aescolar commented Jul 6, 2023

Now that we have the native_sim targets, we can build Zephyr as a Linux application, with the choice of using an embedded C library. When the user selects to use an embedded libC, a few of the old native_posix drivers will not work, as in that case they will not have direct access to the host libraries.
The solution is to refactor those drivers into a top and a bottom. The bottom, the part which does the host accesses, is built separately from the rest of Zephyr (in the same context as the native simulator "runner", with the host libraries and include paths, but without the Zephyr include paths). The top is built in Zephyr context.

For the most trivial accesses to the host, the runner already includes a few host call trampolines, so drivers/test code can call directly from the "embedded world" into the host via those trampolines.

This list keeps track of the progress for native (posix/sim) drivers which are not yet supported with the embedded C libraries:

The whole list of drivers and backends can be found here:
https://docs.zephyrproject.org/latest/boards/posix/native_sim/doc/index.html#native-sim-peripherals

CC: @jhedberg @MarkoSagadin @henrikbrixandersen @martinjaeger @tmon-nordic @jfischer-no @finikorg @jukkar @tbursztyka @nvlsianpu @vanwinkeljan @de-nordic @nordic-krch @Laczen

@aescolar aescolar added Enhancement Changes/Updates/Additions to existing features area: native port Host native arch port (native_posix) labels Jul 6, 2023
@aescolar
Copy link
Member Author

aescolar commented Jul 6, 2023

Help with the pending ones would be very welcome.
You can see in the currently queued PRs that the changes needed to support building them with embedded libC are relatively straight-forward, but it would be of course easier for those who are already familiar with the drivers code.
For drivers that require HW, specially if that HW is not too normal ( CAN :) ) a voluntary with the HW who could also try it out would be necessary.

@tmon-nordic
Copy link
Contributor

I don't think the porting of USB native posix makes sense - it has broken design and does not really implement what USBIP expects. We could however, aim with the new stack (device-next) USBIP implementation to be supported with embedded C libraries.

@aescolar
Copy link
Member Author

aescolar commented Jul 7, 2023

@tmon-nordic Up to you guys (USB maintainers).

aescolar added a commit to aescolar/zephyr that referenced this issue Oct 23, 2023
Defaulting to picolibc when selecting GETOPT is a bit nicer for users
in some cases, but not required.
But too many things require GETOPT (for ex. some SHELL configurations)
in combinations with native posix drivers which do not support
yet embedded libcs (for ex. the native USB driver)
(see zephyrproject-rtos#60096 )

Which leads to configurations in those cases which cannot be built.
Keep defaulting to the external libC in this case.

This reverts the getop part of this commit:
5f8057e

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
aescolar added a commit that referenced this issue Oct 23, 2023
Defaulting to picolibc when selecting GETOPT is a bit nicer for users
in some cases, but not required.
But too many things require GETOPT (for ex. some SHELL configurations)
in combinations with native posix drivers which do not support
yet embedded libcs (for ex. the native USB driver)
(see #60096 )

Which leads to configurations in those cases which cannot be built.
Keep defaulting to the external libC in this case.

This reverts the getop part of this commit:
5f8057e

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
coreboot-org-bot pushed a commit to coreboot/zephyr-cros that referenced this issue Oct 24, 2023
Defaulting to picolibc when selecting GETOPT is a bit nicer for users
in some cases, but not required.
But too many things require GETOPT (for ex. some SHELL configurations)
in combinations with native posix drivers which do not support
yet embedded libcs (for ex. the native USB driver)
(see zephyrproject-rtos/zephyr#60096 )

Which leads to configurations in those cases which cannot be built.
Keep defaulting to the external libC in this case.

This reverts the getop part of this commit:
5f8057e

(cherry picked from commit f97ac47)

Original-Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
GitOrigin-RevId: f97ac47
Change-Id: Ic3cf21e2d768024c99ff8f5c87bff328f22718ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/4964727
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Tested-by: Al Semjonovs <asemjonovs@google.com>
Reviewed-by: Al Semjonovs <asemjonovs@google.com>
Commit-Queue: Al Semjonovs <asemjonovs@google.com>
fredrikdanebjer pushed a commit to MicImbriani/zephyr that referenced this issue Oct 25, 2023
Defaulting to picolibc when selecting GETOPT is a bit nicer for users
in some cases, but not required.
But too many things require GETOPT (for ex. some SHELL configurations)
in combinations with native posix drivers which do not support
yet embedded libcs (for ex. the native USB driver)
(see zephyrproject-rtos#60096 )

Which leads to configurations in those cases which cannot be built.
Keep defaulting to the external libC in this case.

This reverts the getop part of this commit:
5f8057e

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: native port Host native arch port (native_posix) Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

No branches or pull requests

2 participants