diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index c3f935348e..095e8424c5 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1536,6 +1536,10 @@ msgstr "" msgid "No timer available" msgstr "" +#: shared-module/usb/core/Device.c +msgid "No usb host port initialized" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c msgid "Nordic system firmware out of memory" msgstr "" diff --git a/ports/raspberrypi/link.ld b/ports/raspberrypi/link.ld index 0e584c94ac..0e0e7a3c5c 100644 --- a/ports/raspberrypi/link.ld +++ b/ports/raspberrypi/link.ld @@ -211,7 +211,7 @@ SECTIONS _ld_dtcm_data_flash_copy = LOADADDR(.dtcm_data); _ld_dtcm_data_size = SIZEOF(.dtcm_data); - .dtcm_bss : + .dtcm_bss (NOLOAD) : { . = ALIGN(4); diff --git a/shared-module/usb/core/Device.c b/shared-module/usb/core/Device.c index faed49e383..b8c4e4fcd1 100644 --- a/shared-module/usb/core/Device.c +++ b/shared-module/usb/core/Device.c @@ -51,6 +51,10 @@ void tuh_umount_cb(uint8_t dev_addr) { STATIC xfer_result_t _xfer_result; STATIC size_t _actual_len; bool common_hal_usb_core_device_construct(usb_core_device_obj_t *self, uint8_t device_number) { + if (!tuh_inited()) { + mp_raise_RuntimeError(translate("No usb host port initialized")); + } + if (device_number == 0 || device_number > CFG_TUH_DEVICE_MAX + CFG_TUH_HUB) { return false; }