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

DroneCAN add socketcan support, rename to DroneCAN #1558

Merged
merged 1 commit into from
Apr 25, 2023

Conversation

PetervdPerk-NXP
Copy link
Contributor

@PetervdPerk-NXP PetervdPerk-NXP commented Feb 10, 2023

Summary

Rename libcanardv0 library to libdronecan to avoid confusion and update the DroneCAN libcanard library.

Furthermore add SocketCAN backend support to both DroneCAN and the example application.
CAN FD is supported but should be considered experimental.

Furthermore renames libcanardv1 to libopencyphal and allows co-existance of DroneCAN and OpenCyphal Cyphal/CAN.

@PetervdPerk-NXP PetervdPerk-NXP force-pushed the dronecan_update branch 2 times, most recently from 6279d6b to ab43cf9 Compare February 10, 2023 09:21
canutils/libdronecan/Makefile Outdated Show resolved Hide resolved
canutils/libdronecan/Makefile Outdated Show resolved Hide resolved
@acassis
Copy link
Contributor

acassis commented Mar 17, 2023

ping @xiaoxiang781216

LIBDRONECAN_UNPACKNAME = libcanard-$(LIBDRONECAN_VERSION)
LIBDRONECAN_SRCNAME = libcanard

LIBDRONECAN_SRCDIR = $(WD)/$(LIBDRONECAN_SRCNAME)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why need $(WD)

canutils/libdronecan/Makefile Outdated Show resolved Hide resolved
ifeq ($(wildcard $(LIBDRONECAN_SRCNAME)/.git),)
$(LIBDRONECAN_PACKNAME):
@echo "Downloading: $@"
$(Q) curl -o $@ -L $(LIBDRONECAN_URL)$(DELIM)$(LIBDRONECAN_VERSION)$(PACKEXT)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use DOWNLOAD macro

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may have missed something, but where's this new DOWNLOAD macro documented?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reference: apache/nuttx#8759

canutils/libdronecan/Makefile Outdated Show resolved Hide resolved
$(Q) mv $(LIBDRONECAN_UNPACKNAME) $(LIBDRONECAN_SRCNAME)
$(Q) touch $@

$(LIBDRONECAN_SRCDIR)$(DELIM)canard.c: $(LIBDRONECAN_SRCNAME)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why need this rule

@PetervdPerk-NXP
Copy link
Contributor Author

I'm by all means not really comfortable with Makefile. So I don't want to spend more to time to fine tune this further.

Most of the things in this file are derived from existing in the upstream Makefiles i.e.

WD := ${shell echo $(CURDIR) | sed -e 's/ /\\ /g'}

$(Q) curl -O -L $(MBEDTLS_URL)/$(MBEDTLS_ZIP)

$(APPS_INCDIR)$(DELIM)canard.h: $(LIBCANARDV0_SRCDIR)$(DELIM)canard.h

I've tested it with upstream NuttX, with both libraries and the combinations of them.

canutils/libdronecan/Kconfig Outdated Show resolved Hide resolved
canutils/libdronecan/Make.defs Outdated Show resolved Hide resolved
canutils/libopencyphal/Make.defs Outdated Show resolved Hide resolved
examples/dronecan/canard_main.c Outdated Show resolved Hide resolved
examples/dronecan/canard_main.c Outdated Show resolved Hide resolved
examples/dronecan/canard_main.c Outdated Show resolved Hide resolved
examples/dronecan/canard_main.c Outdated Show resolved Hide resolved
examples/dronecan/canard_main.c Outdated Show resolved Hide resolved
examples/dronecan/canard_main.c Outdated Show resolved Hide resolved
examples/opencyphal/canard_main.c Outdated Show resolved Hide resolved
@xiaoxiang781216
Copy link
Contributor

@PetervdPerk-NXP do you provide the patch to fix nuttx side?

@PetervdPerk-NXP
Copy link
Contributor Author

No changes needed on NuttX side

@xiaoxiang781216
Copy link
Contributor

but the ci fail.

Rename canardv1 to OpenCyphal

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <[email protected]>
@PetervdPerk-NXP
Copy link
Contributor Author

@xiaoxiang781216
Ah I see, update created a PR for Nuttx to incoperate the naming changes.

@PetervdPerk-NXP
Copy link
Contributor Author

Hi I'm a bit lost on what to do get this PR and apache/nuttx#8967 into upstream?
Both are approved but we're going around with the circular dependency between nuttx and nuttx-apps to get the CI to succeed.

Any suggestion to progress further?

@btashton
Copy link
Contributor

@PetervdPerk-NXP unfortunately we don't have a clean way to run CI against cross-coupled changes. I had a few ideas in the past, but never had time to try and implement them. For now we rely on local testing and then merging both (usually I merge app first). Then if CI on master breaks we try to get a quick fix merge in, or just revert the changes. Not ideal I know.... Maybe I will be inspired back from vacation to do the work.

@xiaoxiang781216
Copy link
Contributor

@PetervdPerk-NXP let me merge both patch and fix the ci possible broken in the next couple hours.

@xiaoxiang781216 xiaoxiang781216 merged commit fa26bab into apache:master Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants