{"id":"3d02cbfd-72b5-4daa-866e-fd8f2bcde3a5","shortId":"QCnUTy","kind":"skill","title":"connectivity-usb-can","tagline":"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 c","description":"# Zephyr Connectivity: USB & CAN\n\nBuild versatile hardware interfaces using Zephyr's modular USB device stack and robust CAN controller support.\n\n## Core Workflows\n\n### 1. USB Device Stack\nConfigure and enable standard USB classes for host communication.\n- **Reference**: **[usb_device_stack.md](references/usb_device_stack.md)**\n- **Key Tools**: `CONFIG_USB_DEVICE_STACK`, `usb_enable()`, CDC ACM, HID.\n\n### 2. USB-to-CAN Integration\nImplement high-performance bridge patterns for CAN bus diagnostics and adapters.\n- **Reference**: **[usb_to_can.md](references/usb_to_can.md)**\n- **Key Tools**: `can_send()`, `k_msgq`, binary packetization, CAN filtering.\n\n## Quick Start (USB CDC ACM)\n```kconfig\n# prj.conf\nCONFIG_USB_DEVICE_STACK=y\nCONFIG_USB_CDC_ACM=y\n```\n```c\n#include <zephyr/usb/usb_device.h>\n\nvoid main(void) {\n    usb_enable(NULL);\n}\n```\n\n## Professional Patterns (Adapter Design)\n- **Binary Protocols**: Use established protocols like `gs_usb` for robust data transfer over the USB-to-CAN bridge.\n- **Hardware Filtering**: Rely on the CAN controller's hardware filters to minimize CPU overhead from irrelevant bus traffic.\n- **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.\n\n## Automation Tools\n- **[can_filter_lint.py](scripts/can_filter_lint.py)**: Validate CAN filter ID/mask tables from CSV.\n\n## Examples & Templates\n- **[can_filters_template.csv](assets/can_filters_template.csv)**: Starter CAN filter table for adapter firmware.\n\n## Validation Checklist\n- [ ] USB enumeration succeeds and the host sees the expected class interface.\n- [ ] CAN frames can be transmitted and received on a known-good test bus.\n- [ ] Bridge buffering prevents frame loss under burst traffic conditions.\n- [ ] Protocol framing between USB endpoint and CAN payload is decoded consistently on both sides.\n\n## Resources\n\n- **[References](references/)**:\n  - `usb_device_stack.md`: Configuring USB classes and descriptors.\n  - `usb_to_can.md`: Adapter patterns and buffering strategies.\n- **[Scripts](scripts/)**:\n  - `can_filter_lint.py`: CAN filter table consistency checker.\n- **[Assets](assets/)**:\n  - `can_filters_template.csv`: Sample filter definitions.","tags":["connectivity","usb","can","zephyr","agent","skills","beriberikix","agent-skills","agentic-coding","zephyr-rtos"],"capabilities":["skill","source-beriberikix","skill-connectivity-usb-can","topic-agent-skills","topic-agentic-coding","topic-zephyr-rtos"],"categories":["zephyr-agent-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/beriberikix/zephyr-agent-skills/connectivity-usb-can","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add beriberikix/zephyr-agent-skills","source_repo":"https://github.com/beriberikix/zephyr-agent-skills","install_from":"skills.sh"}},"qualityScore":"0.462","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 25 github stars · SKILL.md body (2,256 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-24T07:01:41.795Z","embedding":null,"createdAt":"2026-04-18T23:04:53.861Z","updatedAt":"2026-04-24T07:01:41.795Z","lastSeenAt":"2026-04-24T07:01:41.795Z","tsv":"'1':68 '2':95 'acm':18,93,130,141 'ad':39 'adapt':30,112,154,239,301 'asset':314,315 'assets/can_filters_template.csv':233 'autom':219 'binari':122,156 'bridg':105,174,268 'buffer':33,269,304 'build':50 'burst':274 'bus':44,109,191,267 'c':45,143 'can_filter_lint.py':221,308 'can_filters_template.csv':232,316 'cdc':17,92,129,140 'checker':313 'checklist':242 'class':77,252,297 'communic':80 'condit':276 'config':86,133,138 'configur':16,72,295 'connect':2,8,47 'connectivity-usb-can':1 'consist':287,312 'control':22,64,181 'core':66 'cover':12 'cpu':187 'csv':229 'data':166,207 'decod':286 'definit':319 'descriptor':299 'design':155 'devic':14,59,70,88,135 'diagnost':110 'enabl':74,91,150 'endpoint':281 'enumer':244 'establish':159 'exampl':230 'expect':251 'fifo':203 'filter':125,176,184,225,236,310,318 'firmwar':240 'frame':255,271,278 'good':265 'gs':162 'hardwar':52,175,183 'hid':19,94 'high':103,210 'high-perform':102 'high-prior':209 'host':79,248 'id/mask':226 'implement':42,101 'includ':32,144 'integr':23,100 'interfac':41,53,253 'interrupt':213 'ipc':199 'irrelev':190 'k':120,200,202 'kconfig':131 'kernel':198 'key':84,116 'known':264 'known-good':263 'like':161 'loss':272 'main':147 'minim':186 'modular':57 'move':206 'msc':20 'msgq':121,201 'null':151 'overhead':188 'packet':36,123 'pattern':31,106,153,302 'payload':284 'perform':104 'prevent':270 'prioriti':211 'prj.conf':132 'process':217 'profession':25,152 'protocol':35,157,160,277 'quick':126 'receiv':260 'refer':81,113,292,293 'references/usb_device_stack.md':83 'references/usb_to_can.md':115 'reli':177 'resourc':291 'robust':62,165 'rtos':11 'safe':205 'safeti':194 'sampl':317 'script':306,307 'scripts/can_filter_lint.py':222 'see':249 'send':119 'side':290 'skill' 'skill-connectivity-usb-can' 'source-beriberikix' 'stack':15,60,71,89,136 'standard':75 'start':127 'starter':234 'strategi':305 'succeed':245 'support':65 'tabl':227,237,311 'templat':231 'test':266 'thread':193,218 'tool':85,117,220 'topic-agent-skills' 'topic-agentic-coding' 'topic-zephyr-rtos' 'traffic':192,275 'transfer':167 'transmit':258 'trigger':37 'usb':3,5,13,27,40,48,58,69,76,87,90,97,128,134,139,149,163,171,216,243,280,296 'usb-to-can':26,96,170 'usb_device_stack.md':82,294 'usb_to_can.md':114,300 'use':54,158,195 'valid':223,241 'versatil':51 'void':146,148 'workflow':67 'y':137,142 'zephyr':10,46,55,196 'zephyr/usb/usb_device.h':145","prices":[{"id":"2b03520d-729f-4ce8-947c-c3583acc81d4","listingId":"3d02cbfd-72b5-4daa-866e-fd8f2bcde3a5","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"beriberikix","category":"zephyr-agent-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T23:04:53.861Z"}],"sources":[{"listingId":"3d02cbfd-72b5-4daa-866e-fd8f2bcde3a5","source":"github","sourceId":"beriberikix/zephyr-agent-skills/connectivity-usb-can","sourceUrl":"https://github.com/beriberikix/zephyr-agent-skills/tree/main/skills/connectivity-usb-can","isPrimary":false,"firstSeenAt":"2026-04-18T23:04:53.861Z","lastSeenAt":"2026-04-24T07:01:41.795Z"}],"details":{"listingId":"3d02cbfd-72b5-4daa-866e-fd8f2bcde3a5","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"beriberikix","slug":"connectivity-usb-can","github":{"repo":"beriberikix/zephyr-agent-skills","stars":25,"topics":["agent-skills","agentic-coding","zephyr-rtos"],"license":"apache-2.0","html_url":"https://github.com/beriberikix/zephyr-agent-skills","pushed_at":"2026-04-20T21:40:18Z","description":"A complete catalog of Agent Skills (agentskills.io) for Zephyr RTOS development.","skill_md_sha":"c9a4ce7492cc39c879c41b86615601de08c71aa4","skill_md_path":"skills/connectivity-usb-can/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/beriberikix/zephyr-agent-skills/tree/main/skills/connectivity-usb-can"},"layout":"multi","source":"github","category":"zephyr-agent-skills","frontmatter":{"name":"connectivity-usb-can","description":"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."},"skills_sh_url":"https://skills.sh/beriberikix/zephyr-agent-skills/connectivity-usb-can"},"updatedAt":"2026-04-24T07:01:41.795Z"}}