-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Check that we can compute the value of USB_DEVICES #3037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
These are already disabled via the USB_DEVICES setting, but the code is included anyway.
ah -- I was puzzled by why the pewpew10 build worked as it is currently written - it does not set USB_DEVICES.. ii turns out, it does not! I just built it for the current main and it does not boot to a CIRCUITPY drive -- similar to what I saw on the m0_rfm9x adding |
@tannewt I think that for the cases that are failing here, what we actually want to do is bring the CIRCUITPY_USB_yyy macros in line with the USB_DEVICES, rather than the other way around; they seem to be situations where some element of USB is disabled to cope with a board-specific limitation, whether it's memory or USB endpoints available. The failed doc build pointed the way to quick checking for all ports locally.
import os
import subprocess
SUPPORTED_PORTS = ['atmel-samd', 'esp32s2', 'litex', 'mimxrt10xx', 'nrf', 'stm']
def check_makefile(port_dir, board_name):
""" Invoke make in a mode which prints the database, then parse it for
settings.
This means that the effect of all Makefile directives is taken
into account, without having to re-encode the logic that sets them
in this script, something that has proved error-prone
"""
contents = subprocess.run(
["make", "-C", port_dir, f"BOARD={board_name}", "-qp", "print-CC"],
encoding="utf-8",
errors="replace",
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
# Make signals errors with exit status 2; 0 and 1 are "non-error" statuses
if contents.returncode not in (0, 1):
print(f"{port_dir} - {board_name}: {contents.stderr.strip()}")
for port in SUPPORTED_PORTS:
port_dir = "ports/{}/boards".format(port)
for entry in os.scandir(port_dir):
if not entry.is_dir():
continue
check_makefile(f'ports/{port}', entry.name) |
This is probably a newer issue because I "fixed" the CIRCUITPY_ directives to remove TinyUSB code here: dcb0e50 |
@jepler Yes, for cases where the compute is a superset, we should disable the corresponding CIRCUITPY define. That will free up code space. |
.. it was not in the USB descriptors anyway (lack of enough endpoints?)
.. it was not in the USB descriptors anyway (lack of enough endpoints?)
.. it was not in the USB descriptors anyway (lack of enough endpoints?)
This makes them all overridable on the board level, tersely
Rather than requiring that USB_DEVICES be changed when CIRCUITPY_USB_HID and CIRCUITPY_USB_MIDI are changed.
If this passes the CI, then it will be okay to accept a different PR which actually uses the computed value. However, this PR is only being prepared so that the CI can check the intermediate state in which USB_DEVICES_COMPUTED is checked against USB_DEVICES.