Skip to content

Commit a57349f

Browse files
authored
Fix Ethos-U driver build. (#2643)
The updated Ethos-U driver v24.05 (introduced in #2626), contains a second set of device functions for the U85. This can cause the linker to link the functions of the U85, instead of the U55-U65, if they're both included in the driver's sources files. Therefore a glob pattern can no longer be used to collect the driver's source files in the Makefile. BUG=#2639
1 parent fff7b50 commit a57349f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tensorflow/lite/micro/tools/make/ext_libs/ethos_u.inc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,14 @@ endif
3838

3939
THIRD_PARTY_CC_HDRS += $(shell find $(ETHOSU_DRIVER_PATH)/include -name "*.h")
4040
ifeq (,$(ETHOSU_DRIVER_LIBS))
41-
THIRD_PARTY_CC_SRCS += $(shell find $(ETHOSU_DRIVER_PATH)/src -name "*.c")
41+
THIRD_PARTY_CC_SRCS = $(ETHOSU_DRIVER_PATH)/src/ethosu_pmu.c \
42+
$(ETHOSU_DRIVER_PATH)/src/ethosu_driver.c
43+
# Add the Ethos-U device-specific driver source.
44+
ifeq ($(ETHOSU_ARCH), u85)
45+
THIRD_PARTY_CC_SRCS += $(ETHOSU_DRIVER_PATH)/src/ethosu_device_u85.c
46+
else
47+
THIRD_PARTY_CC_SRCS += $(ETHOSU_DRIVER_PATH)/src/ethosu_device_u55_u65.c
48+
endif
4249
else
4350
MICROLITE_LIBS += $(ETHOSU_DRIVER_LIBS)
4451
endif

0 commit comments

Comments
 (0)