Adding cross-library support for DFU#129
Conversation
0e7a6c9 to
87afa09
Compare
There was a problem hiding this comment.
Pull request overview
This pull request adds cross-library support for Device Firmware Update (DFU) functionality to lib_device_control, enabling integration with lib_dfu. It introduces a new DFU control server that implements the control interface to handle DFU commands over various transport protocols (I2C, USB, SPI, XSCOPE).
Changes:
- Added dfu_control_server implementation that wraps DFU API calls in the control interface protocol
- Introduced CONTROL_CMD_VALUE macro to extract command values by clearing the read/write bit
- Added optional configuration header mechanism for DFU resource ID customization
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| lib_device_control/lib_build_info.cmake | Conditionally includes dfu_control_server.xc when CONTROL_APP_DFU is set and declares control_dfu_conf.h as optional header |
| lib_device_control/inc/dfu_control_server.h | Declares the dfu_control_server function that implements the control interface for DFU |
| lib_device_control/inc/control_transport_shared.h | Adds CONTROL_CMD_VALUE macro to extract command value by masking out read/write bit |
| lib_device_control/inc/control_default_dfu_conf.h | Provides default RESOURCE_ID_DFU definition with optional override mechanism |
| lib_device_control/apps/dfu_control_server.xc | Implements DFU control server that translates control interface calls to DFU API requests with custom header handling |
| lib_device_control/api/control.h | Includes control_default_dfu_conf.h to make DFU resource ID available |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
691da93 to
8041db9
Compare
8041db9 to
9c6a821
Compare
| par { | ||
| on tile[0]: { | ||
| i2c_master(i_i2c, 1, p_scl, p_sda, 10); | ||
| i2c_master(i_i2c, 1, p_scl, p_sda, 100); |
There was a problem hiding this comment.
Good update. I always though 10kbps was a bit mean
| #if (CONTROL_TEST_HEADLESS + USE_USB + USE_I2C + USE_SPI + USE_XSCOPE) > 1 | ||
| #error "Multiple USB transport types defined. Please ensure only one of USE_USB, USE_I2C, USE_SPI, or USE_XSCOPE is set to 1." | ||
| #elif ((CONTROL_TEST_HEADLESS + USE_USB + USE_I2C + USE_SPI + USE_XSCOPE) == 0) | ||
| #error "No USB transport type defined. Please ensure one of USE_USB, USE_I2C, USE_SPI, or USE_XSCOPE is set to 1." |
There was a problem hiding this comment.
I think it should say "No transport defined.."
ed-xmos
left a comment
There was a problem hiding this comment.
Looks good - one small typo
Adds dfu_control_server for lib_device_control interface to lib_dfu
Adds optional header control_default_conf.h and control_default_dfu_conf.h
Replaced CMake device build selection parameters with optional header defines (same as host).