summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/zephyr/main.c8
-rw-r--r--ports/zephyr/prj_mimxrt1050_evk.conf6
2 files changed, 14 insertions, 0 deletions
diff --git a/ports/zephyr/main.c b/ports/zephyr/main.c
index a3f0d5b9d..e0e50196b 100644
--- a/ports/zephyr/main.c
+++ b/ports/zephyr/main.c
@@ -34,6 +34,10 @@
#include <net/net_context.h>
#endif
+#ifdef CONFIG_USB
+#include <usb/usb_device.h>
+#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 23066977f..051ab7e60 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"