Skip to content

Conversation

@jfischer-no
Copy link
Contributor

Allow to use RTU server sample on any board that has supported
USB device controller. Although it is only a point to point
connection and does not represent a bus, it can, apart from
testing the server implementation, also be used practically
for example to control relays or to read ADC values via
USB connection without implementing custom USB class or driver.

Resolves: #45938

We cannot implement configure API because there is
no notification of configuration changes provided
for the Abstract Control Model and the UART controller
is only emulated.
However, it allows us to use CDC ACM UART together with
subsystems like Modbus which require configure API for
real controllers.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Node is not a bus controller,
use DT_INST_PARENT instead of DT_INST_BUS.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Copy link
Contributor

@aurel32 aurel32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than that overlay-cdc-acm.conf issue, that looks good to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that needed? The shell is not activated in this sample, causing a warning:

warning: SHELL_BACKEND_SERIAL_CHECK_DTR (defined at subsys/shell/backends/Kconfig.backends:75) was
assigned the value 'y' but got the value 'n'. Check these unsatisfied dependencies:
SHELL_BACKEND_SERIAL (=n), SHELL_BACKENDS (=n), SHELL (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_SHELL_BACKEND_SERIAL_CHECK_DTR and/or look
up SHELL_BACKEND_SERIAL_CHECK_DTR in the menuconfig/guiconfig interface. The Application Development
Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual
might be helpful too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the hint. It is copy&paste error (config overlay from samples/subsys/shell/shell_module).

@carlescufi carlescufi requested a review from aurel32 July 11, 2022 12:28
@jfischer-no jfischer-no force-pushed the pr-cdc-acm-add-configure branch from 1a0624f to 37a2f00 Compare July 12, 2022 09:39
Allow to use RTU server sample on any board that has supported
USB device controller. Although it is only a point to point
connection and does not represent a bus, it can, apart from
testing the server implementation, also be used practically
for example to control relays or to read ADC values via
USB connection without implementing custom USB class or driver.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
@jfischer-no jfischer-no force-pushed the pr-cdc-acm-add-configure branch from 37a2f00 to 34cd8cd Compare July 12, 2022 09:42
Copy link
Contributor

@aurel32 aurel32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update, LGTM

@carlescufi carlescufi merged commit a1bfd83 into zephyrproject-rtos:main Jul 13, 2022
@jfischer-no jfischer-no deleted the pr-cdc-acm-add-configure branch July 13, 2022 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: modbus area: Samples Samples area: USB Universal Serial Bus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to combine USB CDC-ACM and Modbus Serial due to dependecy on uart_configure().

4 participants