Skip to content

Commit af4cac6

Browse files
committed
WIP: usbd_net & mimx
Signed-off-by: Andrew Leech <[email protected]>
1 parent b158955 commit af4cac6

File tree

16 files changed

+392
-57
lines changed

16 files changed

+392
-57
lines changed

ports/mimxrt/Makefile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,9 @@ INC += -I$(TOP)/lib/tinyusb/src
8080
INC += -I$(TOP)/shared/tinyusb
8181
INC += -I.
8282
INC += -Ihal
83-
84-
# All settings for Ethernet support are controller by the value of MICROPY_PY_LWIP
85-
ifeq ($(MICROPY_PY_LWIP),1)
8683
INC += -Ilwip_inc
84+
85+
ifeq ($(MICROPY_HW_ETHERNET),1)
8786
INC += -Ihal/phy
8887
endif
8988

@@ -106,8 +105,10 @@ SRC_TINYUSB_C += \
106105
lib/tinyusb/src/portable/chipidea/ci_hs/dcd_ci_hs.c \
107106
lib/tinyusb/src/tusb.c
108107

109-
# All settings for Ethernet support are controller by the value of MICROPY_PY_LWIP
110-
ifeq ($(MICROPY_PY_LWIP),1)
108+
# All settings for Ethernet support are controlled by the value of MICROPY_HW_ETHERNET
109+
ifeq ($(MICROPY_HW_ETHERNET),1)
110+
MICROPY_PY_LWIP = 1
111+
111112
SRC_ETH_C += \
112113
$(MCUX_SDK_DIR)/drivers/enet/fsl_enet.c \
113114
hal/phy/device/phydp83825/fsl_phydp83825.c \
@@ -281,6 +282,7 @@ SHARED_SRC_C += \
281282
shared/timeutils/timeutils.c \
282283
shared/tinyusb/mp_usbd.c \
283284
shared/tinyusb/mp_usbd_cdc.c \
285+
shared/tinyusb/mp_usbd_net.c \
284286
shared/tinyusb/mp_usbd_descriptor.c \
285287

286288
# Set flash driver name, base address and internal flash flag, based on the flash type.
@@ -447,8 +449,8 @@ else
447449
endif
448450

449451

450-
# All settings for Ethernet support are controller by the value of MICROPY_PY_LWIP
451-
ifeq ($(MICROPY_PY_LWIP),1)
452+
# All settings for Ethernet support are controlled by the value of MICROPY_HW_ETHERNET
453+
ifeq ($(MICROPY_HW_ETHERNET),1)
452454
CFLAGS += \
453455
-DFSL_FEATURE_PHYKSZ8081_USE_RMII50M_MODE=1
454456
endif
@@ -470,7 +472,8 @@ LDFLAGS += \
470472
--gc-sections \
471473
--print-memory-usage \
472474
-Map=$@.map \
473-
--wrap=LPUART_TransferHandleIRQ
475+
--wrap=LPUART_TransferHandleIRQ \
476+
--wrap=dcd_event_handler
474477

475478
# LDDEFINES are used for link time adaptation of linker scripts, utilizing
476479
# the C preprocessor. Therefore keep LDDEFINES separated from LDFLAGS!

ports/mimxrt/boards/MIMXRT1010_EVK/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ MICROPY_FLOAT_IMPL = single
55
MICROPY_HW_FLASH_TYPE = qspi_nor_flash
66
MICROPY_HW_FLASH_SIZE = 0x1000000 # 16MB
77

8+
MICROPY_PY_LWIP = 0
9+
810
JLINK_PATH ?= /media/RT1010-EVK/
911
JLINK_COMMANDER_SCRIPT = $(BUILD)/script.jlink
1012

ports/mimxrt/boards/MIMXRT1020_EVK/mpconfigboard.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ MICROPY_HW_FLASH_SIZE = 0x800000 # 8MB
88
MICROPY_HW_SDRAM_AVAIL = 1
99
MICROPY_HW_SDRAM_SIZE = 0x2000000 # 32MB
1010

11-
MICROPY_PY_LWIP = 1
11+
MICROPY_HW_ETHERNET = 1
12+
1213
MICROPY_PY_SSL = 1
1314
MICROPY_SSL_MBEDTLS = 1
1415

ports/mimxrt/boards/MIMXRT1050_EVK/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ MICROPY_HW_FLASH_SIZE = 0x4000000 # 64MB
88
MICROPY_HW_SDRAM_AVAIL = 1
99
MICROPY_HW_SDRAM_SIZE = 0x2000000 # 32MB
1010

11-
MICROPY_PY_LWIP = 1
11+
MICROPY_HW_ETHERNET = 1
1212
MICROPY_PY_SSL = 1
1313
MICROPY_SSL_MBEDTLS = 1
1414

ports/mimxrt/boards/MIMXRT1060_EVK/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ MICROPY_HW_FLASH_SIZE = 0x800000 # 8MB
88
MICROPY_HW_SDRAM_AVAIL = 1
99
MICROPY_HW_SDRAM_SIZE = 0x2000000 # 32MB
1010

11-
MICROPY_PY_LWIP = 1
11+
MICROPY_HW_ETHERNET = 1
1212
MICROPY_PY_SSL = 1
1313
MICROPY_SSL_MBEDTLS = 1
1414

ports/mimxrt/boards/MIMXRT1064_EVK/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ MICROPY_HW_FLASH_SIZE = 0x400000 # 4MB
88
MICROPY_HW_SDRAM_AVAIL = 1
99
MICROPY_HW_SDRAM_SIZE = 0x2000000 # 32MB
1010

11-
MICROPY_PY_LWIP = 1
11+
MICROPY_HW_ETHERNET = 1
1212
MICROPY_PY_SSL = 1
1313
MICROPY_SSL_MBEDTLS = 1
1414

ports/mimxrt/boards/MIMXRT1170_EVK/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ MICROPY_HW_FLASH_RESERVED ?= 0x100000 # 1MB CM4 Code address space
1010
MICROPY_HW_SDRAM_AVAIL = 1
1111
MICROPY_HW_SDRAM_SIZE = 0x4000000 # 64MB
1212

13-
MICROPY_PY_LWIP = 1
13+
MICROPY_HW_ETHERNET = 1
1414
MICROPY_PY_SSL = 1
1515
MICROPY_SSL_MBEDTLS = 1
1616
MICROPY_PY_OPENAMP = 1

ports/mimxrt/boards/SEEED_ARCH_MIX/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ MICROPY_HW_FLASH_SIZE = 0x800000 # 8MB
88
MICROPY_HW_SDRAM_AVAIL = 1
99
MICROPY_HW_SDRAM_SIZE = 0x2000000 # 32MB
1010

11-
MICROPY_PY_LWIP = 1
11+
MICROPY_HW_ETHERNET = 1
1212
MICROPY_PY_SSL = 1
1313
MICROPY_SSL_MBEDTLS = 1
1414

ports/mimxrt/boards/TEENSY41/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ MICROPY_HW_FLASH_TYPE = qspi_nor_flash
66
MICROPY_HW_FLASH_SIZE = 0x800000 # 8MB
77
MICROPY_HW_FLASH_RESERVED ?= 0x1000 # 4KB
88

9-
MICROPY_PY_LWIP = 1
9+
MICROPY_HW_ETHERNET = 1
1010
MICROPY_PY_SSL = 1
1111
MICROPY_SSL_MBEDTLS = 1
1212

ports/mimxrt/modules/_boot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import vfs
77
import sys
88
import mimxrt
9-
from machine import Pin
9+
from machine import Pin, UART
1010

1111
bdev = mimxrt.Flash()
1212
try:
@@ -19,6 +19,9 @@
1919
sys.path.append("/flash")
2020
sys.path.append("/flash/lib")
2121

22+
os.dupterm(UART(0))
23+
24+
2225
# do not mount the SD card if SKIPSD exists.
2326
try:
2427
os.stat("SKIPSD")

0 commit comments

Comments
 (0)