Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ west build -b lpcxpresso55s16/lpc55s16 cannectivity/app/ -- -DFILE_SUFFIX=releas

After building, the firmware can be flashed to the board by running the `west flash` command.

> **Note:** Build configurations for using the experimental `device_next` USB device stack in
> Zephyr are also provided. These can be selected by setting either `FILE_SUFFIX=usbd_next` or
> `FILE_SUFFIX=usbd_next_release`.
> **Note:** Build configurations for using the legacy USB device stack in Zephyr are also
> provided. These can be selected by setting either `FILE_SUFFIX=legacy` or
> `FILE_SUFFIX=legacy_release`.

## USB Device Firmware Upgrade (DFU) Mode

Expand Down
4 changes: 2 additions & 2 deletions app/boards/canbardo_same70n20b.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) 2024-2025 Henrik Brix Andersen <henrik@brixandersen.dk>
# Copyright (c) 2026 Henrik Brix Andersen <henrik@brixandersen.dk>
# SPDX-License-Identifier: Apache-2.0

CONFIG_CANNECTIVITY_USB_SELF_POWERED=n
CONFIG_USB_DEVICE_GS_USB_COMPATIBILITY_MODE=n
CONFIG_USBD_GS_USB_COMPATIBILITY_MODE=n
5 changes: 5 additions & 0 deletions app/boards/canbardo_same70n20b_legacy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2024-2025 Henrik Brix Andersen <henrik@brixandersen.dk>
# SPDX-License-Identifier: Apache-2.0

CONFIG_CANNECTIVITY_USB_SELF_POWERED=n
CONFIG_USB_DEVICE_GS_USB_COMPATIBILITY_MODE=n
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# SPDX-License-Identifier: Apache-2.0

CONFIG_CANNECTIVITY_USB_SELF_POWERED=n
CONFIG_USBD_GS_USB_COMPATIBILITY_MODE=n
CONFIG_USB_DEVICE_GS_USB_COMPATIBILITY_MODE=n
23 changes: 13 additions & 10 deletions app/boards/native_sim.overlay
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Henrik Brix Andersen <henrik@brixandersen.dk>
* Copyright (c) 2024-2025 Henrik Brix Andersen <henrik@brixandersen.dk>
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -48,42 +48,45 @@

channel0 {
compatible = "cannectivity-channel";
can-controller = <&can_loopback0>;
can-controller = <&cannectivity0>;
termination-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
state-led = <&led_ch0_state>;
activity-leds = <&led_ch0_activity>;
};

channel1 {
compatible = "cannectivity-channel";
can-controller = <&can_loopback1>;
can-controller = <&cannectivity1>;
termination-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
state-led = <&led_ch1_state>;
activity-leds = <&led_ch1_activity>;
};

channel2 {
compatible = "cannectivity-channel";
can-controller = <&can_loopback2>;
can-controller = <&cannectivity2>;
termination-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
state-led = <&led_ch2_state>;
activity-leds = <&led_ch2_activity>;
};
};

can_loopback0: can_loopback0 {
cannectivity0: cannectivity0 {
status = "okay";
compatible = "zephyr,can-loopback";
compatible = "zephyr,native-linux-can";
host-interface = "cannectivity0";
};

can_loopback1: can_loopback1 {
cannectivity1: cannectivity1 {
status = "okay";
compatible = "zephyr,can-loopback";
compatible = "zephyr,native-linux-can";
host-interface = "cannectivity1";
};

can_loopback2: can_loopback2 {
cannectivity2: cannectivity2 {
status = "okay";
compatible = "zephyr,can-loopback";
compatible = "zephyr,native-linux-can";
host-interface = "cannectivity2";
};

};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024-2025 Henrik Brix Andersen <henrik@brixandersen.dk>
* Copyright (c) 2024 Henrik Brix Andersen <henrik@brixandersen.dk>
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -48,45 +48,42 @@

channel0 {
compatible = "cannectivity-channel";
can-controller = <&cannectivity0>;
can-controller = <&can_loopback0>;
termination-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
state-led = <&led_ch0_state>;
activity-leds = <&led_ch0_activity>;
};

channel1 {
compatible = "cannectivity-channel";
can-controller = <&cannectivity1>;
can-controller = <&can_loopback1>;
termination-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
state-led = <&led_ch1_state>;
activity-leds = <&led_ch1_activity>;
};

channel2 {
compatible = "cannectivity-channel";
can-controller = <&cannectivity2>;
can-controller = <&can_loopback2>;
termination-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
state-led = <&led_ch2_state>;
activity-leds = <&led_ch2_activity>;
};
};

cannectivity0: cannectivity0 {
can_loopback0: can_loopback0 {
status = "okay";
compatible = "zephyr,native-linux-can";
host-interface = "cannectivity0";
compatible = "zephyr,can-loopback";
};

cannectivity1: cannectivity1 {
can_loopback1: can_loopback1 {
status = "okay";
compatible = "zephyr,native-linux-can";
host-interface = "cannectivity1";
compatible = "zephyr,can-loopback";
};

cannectivity2: cannectivity2 {
can_loopback2: can_loopback2 {
status = "okay";
compatible = "zephyr,native-linux-can";
host-interface = "cannectivity2";
compatible = "zephyr,can-loopback";
};

};
7 changes: 7 additions & 0 deletions app/boards/native_sim_legacy_release.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2026 Henrik Brix Andersen <henrik@brixandersen.dk>
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "native_sim_legacy.overlay"
2 changes: 1 addition & 1 deletion app/boards/native_sim_native_64.overlay
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Henrik Brix Andersen <henrik@brixandersen.dk>
* Copyright (c) 2025-2026 Henrik Brix Andersen <henrik@brixandersen.dk>
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down
7 changes: 7 additions & 0 deletions app/boards/native_sim_native_64_legacy.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2024-2026 Henrik Brix Andersen <henrik@brixandersen.dk>
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "native_sim_legacy.overlay"
7 changes: 7 additions & 0 deletions app/boards/native_sim_native_64_legacy_release.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2026 Henrik Brix Andersen <henrik@brixandersen.dk>
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "native_sim_native_64_legacy.overlay"
7 changes: 0 additions & 7 deletions app/boards/native_sim_native_64_usbd_next.overlay

This file was deleted.

10 changes: 4 additions & 6 deletions app/prj.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# This is using the deprecated USB device stack
CONFIG_DEPRECATION_TEST=y
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_STACK_NEXT=y

# Logging configuration
CONFIG_LOG=y
CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_GS_USB_LOG_LEVEL_DBG=y
CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y
CONFIG_USBD_LOG_LEVEL_WRN=y
CONFIG_USBD_GS_USB_LOG_LEVEL_DBG=y
CONFIG_CANNECTIVITY_LOG_LEVEL_DBG=y
10 changes: 10 additions & 0 deletions app/prj_legacy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This is using the deprecated USB device stack
CONFIG_DEPRECATION_TEST=y
CONFIG_USB_DEVICE_STACK=y

# Logging configuration
CONFIG_LOG=y
CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_GS_USB_LOG_LEVEL_DBG=y
CONFIG_CANNECTIVITY_LOG_LEVEL_DBG=y
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
CONFIG_USB_DEVICE_STACK_NEXT=y
# This is using the deprecated USB device stack
CONFIG_DEPRECATION_TEST=y
CONFIG_USB_DEVICE_STACK=y

# Hardened configuration
CONFIG_BOOT_BANNER=n
Expand Down
4 changes: 1 addition & 3 deletions app/prj_release.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# This is using the deprecated USB device stack
CONFIG_DEPRECATION_TEST=y
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_STACK_NEXT=y

# Hardened configuration
CONFIG_BOOT_BANNER=n
Expand Down
8 changes: 0 additions & 8 deletions app/prj_usbd_next.conf

This file was deleted.

30 changes: 15 additions & 15 deletions app/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ common:
regex:
- "CANnectivity firmware initialized with .*"
tests:
app.cannectivity:
app.cannectivity.legacy:
depends_on:
- can
- usb_device
extra_args:
- FILE_SUFFIX=legacy
integration_platforms:
- canbardo
- candlelight
Expand All @@ -30,20 +32,22 @@ tests:
- nucleo_h723zg
- ucan
- usb2canfdv1
app.cannectivity.sof:
app.cannectivity.legacy.sof:
depends_on:
- can
- usb_device
extra_args:
- FILE_SUFFIX=legacy
integration_platforms:
- nucleo_h723zg
extra_configs:
- CONFIG_USB_DEVICE_GS_USB_TIMESTAMP_SOF=y
app.cannectivity.release:
app.cannectivity.legacy.release:
depends_on:
- can
- usb_device
extra_args:
- FILE_SUFFIX=release
- FILE_SUFFIX=legacy_release
integration_platforms:
- canbardo
- candlelight
Expand All @@ -57,12 +61,10 @@ tests:
- ucan
- usb2canfdv1
build_only: true
app.cannectivity.usbd_next:
app.cannectivity:
depends_on:
- can
- usbd
extra_args:
- FILE_SUFFIX=usbd_next
integration_platforms:
- canbardo
- candlelightfd
Expand All @@ -72,23 +74,21 @@ tests:
- lpcxpresso55s16
- nucleo_h723zg
- usb2canfdv1
app.cannectivity.usbd_next.sof:
app.cannectivity.sof:
depends_on:
- can
- usbd
extra_args:
- FILE_SUFFIX=usbd_next
integration_platforms:
- lpcxpresso55s16
- nucleo_h723zg
extra_configs:
- CONFIG_USBD_GS_USB_TIMESTAMP_SOF=y
app.cannectivity.usbd_next.release:
app.cannectivity.release:
depends_on:
- can
- usbd
extra_args:
- FILE_SUFFIX=usbd_next_release
- FILE_SUFFIX=release
integration_platforms:
- canbardo
- candlelight
Expand All @@ -102,7 +102,7 @@ tests:
- ucan
- usb2canfdv1
build_only: true
app.cannectivity.dfu:
app.cannectivity.legacy.dfu:
sysbuild: true
depends_on:
- can
Expand All @@ -112,8 +112,9 @@ tests:
- lpcxpresso55s16
- canbardo
extra_args:
- FILE_SUFFIX=legacy
- SB_CONF_FILE=sysbuild-dfu.conf
app.cannectivity.usbd_next.dfu:
app.cannectivity.dfu:
sysbuild: true
depends_on:
- can
Expand All @@ -124,5 +125,4 @@ tests:
- frdm_mcxn947/mcxn947/cpu0
- lpcxpresso55s16
extra_args:
- FILE_SUFFIX=usbd_next_release
- SB_CONF_FILE=sysbuild-dfu.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2024-2026 Henrik Brix Andersen <henrik@brixandersen.dk>
# SPDX-License-Identifier: Apache-2.0

# This is using the deprecated USB device stack
CONFIG_DEPRECATION_TEST=y

CONFIG_MCUBOOT_INDICATION_LED=y
CONFIG_BOOT_USB_DFU_GPIO=y
CONFIG_USB_DEVICE_MANUFACTURER="CANnectivity"
CONFIG_USB_DEVICE_PRODUCT="CANnectivity USB to CAN adapter (MCUboot DFU)"
CONFIG_USB_DEVICE_VID=0x1209
CONFIG_USB_DEVICE_PID=0xca02
CONFIG_USB_DEVICE_DFU_PID=0xca02

This file was deleted.

12 changes: 12 additions & 0 deletions app/sysbuild/mcuboot/boards/frdm_k64f_mk64f12_legacy_release.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2024-2026 Henrik Brix Andersen <henrik@brixandersen.dk>
# SPDX-License-Identifier: Apache-2.0

# This is using the deprecated USB device stack
CONFIG_DEPRECATION_TEST=y

CONFIG_BOOT_USB_DFU_GPIO=y
CONFIG_USB_DEVICE_MANUFACTURER="CANnectivity"
CONFIG_USB_DEVICE_PRODUCT="CANnectivity USB to CAN adapter (MCUboot DFU)"
CONFIG_USB_DEVICE_VID=0x1209
CONFIG_USB_DEVICE_PID=0xca02
CONFIG_USB_DEVICE_DFU_PID=0xca02
5 changes: 0 additions & 5 deletions app/sysbuild/mcuboot/boards/frdm_k64f_mk64f12_usbd_next.conf

This file was deleted.

Loading
Loading