Open josesimoes opened 1 year ago
Trying to add a workaround on that, I found out the there is another check that colides with this:
#if (UX_SLAVE_REQUEST_DATA_MAX_LENGTH < USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_ACTIVE_PROFILE_LENGTH) ...
@ line 295 common\usbx_device_classes\src\ux_device_class_storage_get_configuration.c
Thanks for the feedback. We will discuss and fix the issue in next release.
BTW it's safe to exclude classes files that you don't need while building.
Thanks for the feedback. We will discuss and fix the issue in next release.
Great! Appreciate you looking into this.
BTW it's safe to exclude classes files that you don't need while building.
Sure. The thing is that for accomplish that it requires hacking into CMake list of build files for the USBX being build as a library. Unless there is another recommended way for doing this that you can suggest. If that's the case can you please share that?
Plan to fix compile time error in unused classes:
It should have been fixed in 6.3.0
Describe the bug
When trying to define
UX_SLAVE_REQUEST_DATA_MAX_LENGTH
in us_user.h to low value in order to save memory, it hits on a check ofUX_DEVICE_CLASS_RNDIS_MAX_MSG_LENGTH
.This is on the latest v6.2.0_rel.
To Reproduce Steps to reproduce the behavior:
UX_SLAVE_REQUEST_DATA_MAX_LENGTH
to 64 for example#error "Error: the maximum-sized RNDIS response cannot fit inside the control endpoint's data buffer. Increase UX_SLAVE_REQUEST_DATA_MAX_LENGTH."
Expected behavior It should be possible to save memory (even aggressively) by use of
UX_SLAVE_REQUEST_DATA_MAX_LENGTH
.Impact Mild impact as this is wasting memory for nothing.
Logs and console output N/A
Additional context A nice approach to fix this would be to have configuration options in ux_user.h to enable (or disable) the slave (and master, if that's the case) classes that should be added to the build. As it is now, everything gets added (which is a bit of a waste if you ask me).
Maybe a quicker fix would be to have a specific config to signal that RNDIS is not used and therefore it wouldn't hit that check.