agentsclimarketplace

Connectivity usb can

Skill beriberikix/zephyr-agent-skills/skills/connectivity-usb-can

A complete catalog of Agent Skills (agentskills.io) for Zephyr RTOS development.

Install
npx -y skills add beriberikix/zephyr-agent-skills --skill connectivity-usb-can

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its author says it does

Copied from the file, not written here

USB and CAN connectivity for Zephyr RTOS. Covers USB device stack configuration (CDC ACM, HID, MSC), CAN controller integration, and professional USB-to-CAN adapter patterns including buffering and protocol packetization. Trigger when adding USB interfaces, implementing CAN bus communication, or building hardware diagnostic tools.

SKILL.md

2.6 KB, as published. Nobody here has run it

Zephyr Connectivity: USB & CAN

Build versatile hardware interfaces using Zephyr's modular USB device stack and robust CAN controller support.

Core Workflows

1. USB Device Stack

Configure and enable standard USB classes for host communication.

  • Reference: usb_device_stack.md
  • Key Tools: CONFIG_USB_DEVICE_STACK, usb_enable(), CDC ACM, HID.

2. USB-to-CAN Integration

Implement high-performance bridge patterns for CAN bus diagnostics and adapters.

  • Reference: usb_to_can.md
  • Key Tools: can_send(), k_msgq, binary packetization, CAN filtering.

Quick Start (USB CDC ACM)

# prj.conf
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_CDC_ACM=y
#include <zephyr/usb/usb_device.h>

void main(void) {
    usb_enable(NULL);
}

Professional Patterns (Adapter Design)

  • Binary Protocols: Use established protocols like gs_usb for robust data transfer over the USB-to-CAN bridge.
  • Hardware Filtering: Rely on the CAN controller's hardware filters to minimize CPU overhead from irrelevant bus traffic.
  • Thread Safety: Use Zephyr's kernel IPCs (k_msgq, k_fifo) to safely move data between high-priority CAN interrupts and the USB processing thread.

Automation Tools

Examples & Templates

Validation Checklist

  • USB enumeration succeeds and the host sees the expected class interface.
  • CAN frames can be transmitted and received on a known-good test bus.
  • Bridge buffering prevents frame loss under burst traffic conditions.
  • Protocol framing between USB endpoint and CAN payload is decoded consistently on both sides.

Resources

  • References:
    • usb_device_stack.md: Configuring USB classes and descriptors.
    • usb_to_can.md: Adapter patterns and buffering strategies.
  • Scripts:
    • can_filter_lint.py: CAN filter table consistency checker.
  • Assets:
    • can_filters_template.csv: Sample filter definitions.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.