Skip to content

Commit 18d430a

Browse files
committed
OpenBLT: fix compilation without NET enabled
1 parent f9667c3 commit 18d430a

3 files changed

Lines changed: 33 additions & 15 deletions

File tree

firmware/bootloader/Makefile

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -203,26 +203,12 @@ CSRC = $(ALLCSRC) \
203203
$(PROJECT_DIR)/ext/openblt/Target/Source/backdoor.c \
204204
$(PROJECT_DIR)/ext/openblt/Target/Source/boot.c \
205205
$(PROJECT_DIR)/ext/openblt/Target/Source/com.c \
206-
$(PROJECT_DIR)/ext/openblt/Target/Source/net.c \
207206
$(PROJECT_DIR)/ext/openblt/Target/Source/xcp.c \
208207
$(PROJECT_DIR)/ext/openblt/Target/Source/cop.c \
209208
$(PROJECT_DIR)/bootloader/openblt_chibios/nvm.c \
210209
$(PROJECT_DIR)/bootloader/openblt_chibios/clock-arch.c \
211210
$(PROJECT_DIR)/hw_layer/openblt/hooks.c
212211

213-
UIP_DIR = $(PROJECT_DIR)/ext/openblt/Target/Source/third_party/uip
214-
215-
# Collect UIP third party library files
216-
UIP_CSRC = \
217-
$(UIP_DIR)/uip/uip.c \
218-
$(UIP_DIR)/uip/uip_arp.c \
219-
$(UIP_DIR)/uip/uip_timer.c \
220-
$(UIP_DIR)/uip/uiplib.c \
221-
$(UIP_DIR)/apps/dhcpc/dhcpc.c \
222-
$(PROJECT_DIR)/hw_layer/openblt/netdev.c
223-
224-
CSRC += $(UIP_CSRC)
225-
226212
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
227213
# todo: reduce code duplication with primary Makefile!!!
228214
# setting.
@@ -312,6 +298,27 @@ INCDIR += $(ALLINC) \
312298
$(UIP_DIR)/apps/dhcpc \
313299
config
314300

301+
ifeq ($(EFI_ETHERNET),yes)
302+
UIP_DIR = $(PROJECT_DIR)/ext/openblt/Target/Source/third_party/uip
303+
304+
# Collect network and UIP third party library files
305+
UIP_CSRC = \
306+
$(UIP_DIR)/uip/uip.c \
307+
$(UIP_DIR)/uip/uip_arp.c \
308+
$(UIP_DIR)/uip/uip_timer.c \
309+
$(UIP_DIR)/uip/uiplib.c \
310+
$(UIP_DIR)/apps/dhcpc/dhcpc.c \
311+
$(PROJECT_DIR)/hw_layer/openblt/netdev.c
312+
313+
CSRC += \
314+
$(PROJECT_DIR)/ext/openblt/Target/Source/net.c \
315+
$(UIP_CSRC)
316+
317+
INCDIR += \
318+
$(UIP_DIR)/uip \
319+
$(UIP_DIR)/apps/dhcpc
320+
endif
321+
315322
BUILDDIR=blbuild
316323

317324
#

firmware/config/boards/nucleo_f767/board.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ DDEFS += -DEFI_FILE_LOGGING=FALSE -DEFI_ALTERNATOR_CONTROL=FALSE -DEFI_LOGIC_ANA
99
DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::B14
1010

1111
# Enable ethernet
12+
EFI_ETHERNET = yes
1213
ifeq (,$(findstring EFI_BOOTLOADER,$(DDEFS)))
1314
LWIP = yes
1415
DDEFS += -DCH_CFG_USE_DYNAMIC=TRUE

firmware/hw_layer/openblt/blt_conf.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,15 @@
121121
/** only USB supported, this is ignored but required */
122122
#define BOOT_COM_RS232_CHANNEL_INDEX 0
123123

124-
#if (EFI_ETHERNET==TRUE)
124+
// TODO:
125+
//#define FALSE 0
126+
//#define TRUE 1
127+
128+
#ifndef EFI_ETHERNET
129+
#define EFI_ETHERNET 0
130+
#endif
131+
132+
#if (EFI_ETHERNET==1)
125133
/* The NET communication interface for firmware updates via TCP/IP is selected by setting
126134
* the BOOT_COM_NET_ENABLE configurable to 1. The maximum amount of data bytes in a
127135
* message for data transmission and reception is set through BOOT_COM_NET_TX_MAX_DATA
@@ -176,6 +184,8 @@
176184
* by calling ComDeferredInit().
177185
*/
178186
#define BOOT_COM_NET_DEFERRED_INIT_ENABLE (1)
187+
#else
188+
#define BOOT_COM_NET_ENABLE (0)
179189
#endif // EFI_ETHERNET
180190

181191
/****************************************************************************************

0 commit comments

Comments
 (0)