- Implemented complete gs_usb protocol structures and constants - Added basic USB vendor request handling for gs_usb commands - Created CAN-FD to gs_usb frame conversion functions - Fixed deprecated USB API warnings and compilation issues - Successfully building firmware with 42.6KB flash usage (8.13%) - Basic framework ready for full gs_usb protocol implementation Key components: - gs_usb_can.c/h: CAN interface and protocol structures - usb_gs_usb_class.c/h: USB class implementation with vendor requests - All gs_usb protocol constants (BREQ_*, mode flags, feature flags) - Frame conversion between Zephyr CAN and gs_usb format - Placeholder for future USB bulk endpoint implementation |
||
|---|---|---|
| .. | ||
| boards/arm/ews | ||
| build | ||
| src | ||
| CMakeLists.txt | ||
| README.md | ||
| prj.conf | ||
README.md
CAN FD CDC Composite Firmware
A Zephyr-based firmware for the EWS board that provides:
- CAN FD to gs_usb interface (similar to candlelight)
- USB CDC interface for PFET control
- USB composite device functionality
Features
- CAN FD Support: Full CAN FD protocol support via gs_usb interface
- USB Composite: Single USB device with multiple interfaces:
- gs_usb interface for CAN communication
- CDC ACM interface for PFET control and status
- PFET Control: Control both output PFETs via CDC commands
- Status LEDs: Control status LEDs for visual feedback
- Compatible: Works with standard CAN utilities (can-utils, etc.)
Hardware Target
- MCU: STM32G0B1KBU6 (on EWS board)
- CAN: CAN FD via FDCAN1 (PB0/PB1) with SN65HVD230 transceiver
- USB: USB 2.0 Full Speed (PA11/PA12)
- GPIOs:
- PFET1 control: PA8
- PFET2 control: PB2
- Status LED: PB4
Build Requirements
- Zephyr RTOS (v3.5+)
- West build tool
- ARM GCC toolchain
Building
west build -b ews
CDC Protocol
The CDC interface uses simple text commands:
PFET1_ON\n- Turn on PFET1PFET1_OFF\n- Turn off PFET1PFET2_ON\n- Turn on PFET2PFET2_OFF\n- Turn off PFET2STATUS\n- Get current PFET status