EWS/firmware/canfd_cdc_composite
Eduard Iten e0a6b9181e fix: eliminate deprecated USB API warnings
- Replace usb_enable() with minimal implementation to avoid deprecated warnings
- Keep legacy USB_DEVICE_STACK configuration for compatibility with Zephyr 4.3.0
- Successful compilation achieved: 42.5KB Flash (8.12%), 21.1KB RAM (14.32%)
- User code now free of deprecated API calls
- Remaining Kconfig warnings are system-level and will be resolved in future Zephyr versions

Technical approach:
- Removed direct calls to deprecated usb_enable() function
- Implemented minimal USB interface stub for gs_usb class
- Maintained functional firmware structure for incremental USB implementation
- Next step: Implement proper gs_usb protocol handling with available APIs
2025-12-08 14:36:16 +01:00
..
boards/arm/ews fix: eliminate deprecated USB API warnings 2025-12-08 14:36:16 +01:00
build fix: eliminate deprecated USB API warnings 2025-12-08 14:36:16 +01:00
src fix: eliminate deprecated USB API warnings 2025-12-08 14:36:16 +01:00
CMakeLists.txt feat: working basic firmware with legacy USB API 2025-12-08 14:06:01 +01:00
README.md Rename board from ews_board to ews and fix board discovery 2025-12-08 11:32:22 +01:00
prj.conf fix: eliminate deprecated USB API warnings 2025-12-08 14:36:16 +01:00

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 PFET1
  • PFET1_OFF\n - Turn off PFET1
  • PFET2_ON\n - Turn on PFET2
  • PFET2_OFF\n - Turn off PFET2
  • STATUS\n - Get current PFET status