connectivity-usb-can
Skill68 starsChanged 7 months agoApache-2.0View on GitHub
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.
In this repository21 other files it gives its agents.
- zephyr-agent-skillsSkill
- board-bringupSkill
- build-systemSkill
- connectivity-bleSkill
- connectivity-ipSkill
- devicetreeSkill
- hardware-ioSkill
- industrialSkill
- iot-protocolsSkill
- kernel-basicsSkill
- kernel-servicesSkill
- multicoreSkill
- native-simSkill
- power-performanceSkill
- security-updatesSkill
- specializedSkill
- storageSkill
- testing-debuggingSkill
- zephyr-foundationsSkill
- zephyr-indexSkill
- zephyr-moduleSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 37
Binary Protocols: Use established protocols like gs_usb for robust data transfer over the USB-to-CAN bridge.
- Very specific: line 39
Thread Safety: Use Zephyr's kernel IPCs (k_msgq, k_fifo) to safely move data between high-priority CAN interrupts and the USB processing …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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_usbfor 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
- can_filter_lint.py: Validate CAN filter ID/mask tables from CSV.
Examples & Templates
- can_filters_template.csv: Starter CAN filter table for adapter firmware.
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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

