diff --git a/ports/zephyr/main.c b/ports/zephyr/main.c index a3f0d5b9d6..e0e50196b3 100644 --- a/ports/zephyr/main.c +++ b/ports/zephyr/main.c @@ -34,6 +34,10 @@ #include #endif +#ifdef CONFIG_USB +#include +#endif + #include "py/mperrno.h" #include "py/compile.h" #include "py/runtime.h" @@ -133,6 +137,10 @@ soft_reset: mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_)); // current dir (or base dir of the script) mp_obj_list_init(mp_sys_argv, 0); + #ifdef CONFIG_USB + usb_enable(NULL); + #endif + #if MICROPY_VFS vfs_init(); #endif diff --git a/ports/zephyr/prj_mimxrt1050_evk.conf b/ports/zephyr/prj_mimxrt1050_evk.conf index 23066977f3..051ab7e60b 100644 --- a/ports/zephyr/prj_mimxrt1050_evk.conf +++ b/ports/zephyr/prj_mimxrt1050_evk.conf @@ -1,3 +1,9 @@ # Required for zephyr.DiskAccess block devices CONFIG_DISK_ACCESS=y CONFIG_DISK_ACCESS_SDHC=y + +CONFIG_USB=y +CONFIG_USB_DEVICE_STACK=y +CONFIG_USB_DEVICE_PRODUCT="Zephyr MicroPython" +CONFIG_USB_MASS_STORAGE=y +CONFIG_MASS_STORAGE_DISK_NAME="SDHC"