$npx -y skills add easyzoom/aix-skills --skill canbus-integrationUse when integrating, porting, configuring, or debugging CAN bus libraries, CANBus-Triple, MCP2515, CAN frames, bit timing, filters, or embedded automotive communication
| 1 | # CANBus Integration |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Use this skill for embedded CAN bus libraries and CANBus-Triple style projects. CAN failures are often physical-layer, bit-timing, termination, transceiver, or filter problems before they are application protocol problems. |
| 6 | |
| 7 | ## When To Use |
| 8 | |
| 9 | Use this skill when: |
| 10 | |
| 11 | - The user mentions CAN, CANBus-Triple, MCP2515, SocketCAN, CANopen, J1939, UDS, OBD-II, ISO-TP, or automotive messages. |
| 12 | - Frames are missing, bus-off occurs, IDs are wrong, filters reject messages, or bit timing is unreliable. |
| 13 | - The task involves adapting a CAN example project or Arduino-style CAN platform to another board. |
| 14 | |
| 15 | Do not use this skill when the target is only a generic UART/SPI issue with no CAN layer. |
| 16 | |
| 17 | ## First Questions |
| 18 | |
| 19 | Ask for: |
| 20 | |
| 21 | - CAN controller/transceiver and board, such as internal CAN, FDCAN, MCP2515, or CANBus-Triple. |
| 22 | - Bus speed, oscillator frequency, sample point, and whether CAN FD is involved. |
| 23 | - Wiring, termination, transceiver voltage, and whether another known-good node is present. |
| 24 | - Frame IDs, standard/extended format, filters, masks, and expected traffic. |
| 25 | - Library/project source and current error counters, bus state, or capture. |
| 26 | |
| 27 | ## Integration Checklist |
| 28 | |
| 29 | 1. Verify physical layer. |
| 30 | Confirm CANH/CANL wiring, 120-ohm termination, common ground, transceiver enable/standby, and voltage compatibility. |
| 31 | |
| 32 | 1. Confirm bit timing. |
| 33 | Controller clock, prescaler, segments, sample point, and bus speed must match the network. |
| 34 | |
| 35 | 1. Start with listen or loopback. |
| 36 | Use internal loopback or listen-only mode before transmitting onto a live bus. |
| 37 | |
| 38 | 1. Configure filters deliberately. |
| 39 | Disable filters temporarily or accept all frames to prove RX path before narrowing IDs. |
| 40 | |
| 41 | 1. Separate transport and protocol. |
| 42 | First prove raw CAN frames, then add ISO-TP, UDS, OBD-II, J1939, or application decoding. |
| 43 | |
| 44 | 1. Protect live systems. |
| 45 | Do not transmit on vehicle or production buses without explicit approval and a safe test plan. |
| 46 | |
| 47 | ## Common Failures |
| 48 | |
| 49 | - Missing termination or wrong transceiver standby pin. |
| 50 | - MCP2515 oscillator frequency differs from library assumption. |
| 51 | - Standard versus extended ID mismatch. |
| 52 | - Filters silently drop expected frames. |
| 53 | - Bus-off caused by transmitting at wrong bit rate. |
| 54 | - SPI-to-CAN driver works in loopback but fails due to transceiver wiring. |
| 55 | |
| 56 | ## Verification |
| 57 | |
| 58 | Before claiming CAN works: |
| 59 | |
| 60 | - State controller, transceiver, bus speed, clock, ID format, and filter mode. |
| 61 | - Confirm physical termination and transceiver enable state. |
| 62 | - Confirm loopback or known-good RX before live TX. |
| 63 | - Report error counters, bus state, and captured frame evidence. |
| 64 | - State whether transmission on a live bus was skipped or explicitly approved. |
| 65 | |
| 66 | ## Example |
| 67 | |
| 68 | User: |
| 69 | |
| 70 | ```text |
| 71 | CANBus-Triple 例程烧进去后收不到车上的 CAN 帧。 |
| 72 | ``` |
| 73 | |
| 74 | Agent: |
| 75 | |
| 76 | 1. Asks for bus speed, MCP2515 oscillator, termination, transceiver state, and expected IDs. |
| 77 | 1. Tests listen-only or accept-all filters. |
| 78 | 1. Confirms raw frames before decoding OBD-II or UDS traffic. |