From d18e1c5b39f66917f6ec200fc63e505932b84c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Thu, 11 Jan 2018 16:30:52 +0100 Subject: [PATCH] changed board in makefile, added default make target, removed hacks in hal_mac_lld.c --- eigener_ctrl/stm32f407-olimex/Makefile | 10 +++++++--- .../chibios/os/hal/ports/STM32/LLD/MACv1/hal_mac_lld.c | 8 ++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/eigener_ctrl/stm32f407-olimex/Makefile b/eigener_ctrl/stm32f407-olimex/Makefile index f4555a8..79dca77 100755 --- a/eigener_ctrl/stm32f407-olimex/Makefile +++ b/eigener_ctrl/stm32f407-olimex/Makefile @@ -11,7 +11,7 @@ endif # C specific options here (added to USE_OPT). ifeq ($(USE_COPT),) - USE_COPT = + USE_COPT = endif # C++ specific options here (added to USE_OPT). @@ -26,7 +26,7 @@ endif # Linker extra options here. ifeq ($(USE_LDOPT),) - USE_LDOPT = + USE_LDOPT = endif # Enable this if you want link time optimizations (LTO) @@ -93,7 +93,7 @@ include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.m # HAL-OSAL files (optional). include $(CHIBIOS)/os/hal/hal.mk include $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/platform.mk -include $(CHIBIOS)/os/hal/boards/OLIMEX_STM32_E407/board.mk +include $(CHIBIOS)/os/hal/boards/OLIMEX_STM32_E407_REV_D/board.mk include $(CHIBIOS)/os/hal/osal/rt/osal.mk # RTOS files (optional). include $(CHIBIOS)/os/rt/rt.mk @@ -225,6 +225,10 @@ ULIBS = # End of user defines ############################################################################## +build/$(PROJECT).bin: build/$(PROJECT).elf + $(BIN) build/$(PROJECT).elf build/$(PROJECT).bin + + upload-jlink: build/$(PROJECT).bin openocd -f interface/jlink.cfg -f target/stm32f4x.cfg -c "program build/$(PROJECT).elf verify reset exit" diff --git a/eigener_ctrl/stm32f407-olimex/chibios/os/hal/ports/STM32/LLD/MACv1/hal_mac_lld.c b/eigener_ctrl/stm32f407-olimex/chibios/os/hal/ports/STM32/LLD/MACv1/hal_mac_lld.c index 5770c46..c84b72c 100755 --- a/eigener_ctrl/stm32f407-olimex/chibios/os/hal/ports/STM32/LLD/MACv1/hal_mac_lld.c +++ b/eigener_ctrl/stm32f407-olimex/chibios/os/hal/ports/STM32/LLD/MACv1/hal_mac_lld.c @@ -270,11 +270,11 @@ void mac_lld_init(void) { rccEnableETH(false); /* PHY address setup.*/ -//#if defined(BOARD_PHY_ADDRESS) +#if defined(BOARD_PHY_ADDRESS) ETHD1.phyaddr = 0 << 11; -//#else -// mii_find_phy(ÐD1); -//#endif +#else + mii_find_phy(ÐD1); +#endif #if defined(BOARD_PHY_RESET) /* PHY board-specific reset procedure.*/