move all nrf boards into its family group

This commit is contained in:
hathach
2020-11-28 10:48:44 +07:00
parent f0ffe7b984
commit 630692d81b
15 changed files with 49 additions and 298 deletions
+4 -1
View File
@@ -1,7 +1,10 @@
MCU_VARIANT = nrf52840
CFLAGS += -DNRF52840_XXAA
$(BUILD)/$(BOARD)-firmware.zip: $(BUILD)/$(BOARD)-firmware.hex
adafruit-nrfutil dfu genpkg --dev-type 0x0052 --sd-req 0xFFFE --application $^ $@
# flash using adafruit-nrfutil dfu
flash-adafruit-nrfutil: $(BUILD)/$(BOARD)-firmware.zip
flash: $(BUILD)/$(BOARD)-firmware.zip
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
adafruit-nrfutil --verbose dfu serial --package $^ -p $(SERIAL) -b 115200 --singlebank --touch 1200
@@ -1,7 +1,10 @@
MCU_VARIANT = nrf52840
CFLAGS += -DNRF52840_XXAA
$(BUILD)/$(BOARD)-firmware.zip: $(BUILD)/$(BOARD)-firmware.hex
adafruit-nrfutil dfu genpkg --dev-type 0x0052 --sd-req 0xFFFE --application $^ $@
# flash using adafruit-nrfutil dfu
flash-adafruit-nrfutil: $(BUILD)/$(BOARD)-firmware.zip
flash: $(BUILD)/$(BOARD)-firmware.zip
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
adafruit-nrfutil --verbose dfu serial --package $^ -p $(SERIAL) -b 115200 --singlebank --touch 1200
@@ -1,7 +1,10 @@
MCU_VARIANT = nrf52840
CFLAGS += -DNRF52840_XXAA
$(BUILD)/$(BOARD)-firmware.zip: $(BUILD)/$(BOARD)-firmware.hex
adafruit-nrfutil dfu genpkg --dev-type 0x0052 --sd-req 0xFFFE --application $^ $@
# flash using adafruit-nrfutil dfu
flash-adafruit-nrfutil: $(BUILD)/$(BOARD)-firmware.zip
flash: $(BUILD)/$(BOARD)-firmware.zip
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
adafruit-nrfutil --verbose dfu serial --package $^ -p $(SERIAL) -b 115200 --singlebank --touch 1200
@@ -1,7 +1,10 @@
MCU_VARIANT = nrf52840
CFLAGS += -DNRF52840_XXAA
$(BUILD)/$(BOARD)-firmware.zip: $(BUILD)/$(BOARD)-firmware.hex
adafruit-nrfutil dfu genpkg --dev-type 0x0052 --sd-req 0xFFFE --application $^ $@
# flash using adafruit-nrfutil dfu
flash-adafruit-nrfutil: $(BUILD)/$(BOARD)-firmware.zip
flash: $(BUILD)/$(BOARD)-firmware.zip
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
adafruit-nrfutil --verbose dfu serial --package $^ -p $(SERIAL) -b 115200 --singlebank --touch 1200
@@ -1,7 +1,10 @@
MCU_VARIANT = nrf52840
CFLAGS += -DNRF52840_XXAA
$(BUILD)/$(BOARD)-firmware.zip: $(BUILD)/$(BOARD)-firmware.hex
adafruit-nrfutil dfu genpkg --dev-type 0x0052 --sd-req 0xFFFE --application $^ $@
# flash using adafruit-nrfutil dfu
flash-adafruit-nrfutil: $(BUILD)/$(BOARD)-firmware.zip
flash: $(BUILD)/$(BOARD)-firmware.zip
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
adafruit-nrfutil --verbose dfu serial --package $^ -p $(SERIAL) -b 115200 --singlebank --touch 1200
@@ -1,4 +1,7 @@
LD_FILE ?= $(BOARD_PATH)/$(BOARD).ld
MCU_VARIANT = nrf52840
CFLAGS += -DNRF52840_XXAA
LD_FILE = $(BOARD_PATH)/$(BOARD).ld
# flash using Nordic nrfutil (pip3 install nrfutil)
# make BOARD=nrf52840_mdk_dongle SERIAL=/dev/ttyACM0 all flash
+3
View File
@@ -1,3 +1,6 @@
MCU_VARIANT = nrf52840
CFLAGS += -DNRF52840_XXAA
LD_FILE = hw/mcu/nordic/nrfx/mdk/nrf52840_xxaa.ld
# flash using jlink
+3
View File
@@ -1,3 +1,6 @@
MCU_VARIANT = nrf52840
CFLAGS += -DNRF52840_XXAA
LD_FILE = $(BOARD_PATH)/$(BOARD).ld
# flash using Nordic nrfutil (pip2 install nrfutil)
+7
View File
@@ -0,0 +1,7 @@
MCU_VARIANT = nrf52833
CFLAGS += -DNRF52833_XXAA
LD_FILE = hw/mcu/nordic/nrfx/mdk/nrf52833_xxaa.ld
# flash using jlink
flash: flash-jlink
@@ -1,3 +1,6 @@
MCU_VARIANT = nrf52840
CFLAGS += -DNRF52840_XXAA
LD_FILE = hw/mcu/nordic/nrfx/mdk/nrf52840_xxaa.ld
# flash using jlink
+4 -3
View File
@@ -61,8 +61,8 @@ void board_init(void)
// stop LF clock just in case we jump from application without reset
NRF_CLOCK->TASKS_LFCLKSTOP = 1UL;
// Config clock source: XTAL or RC in sdk_config.h
NRF_CLOCK->LFCLKSRC = (uint32_t)((CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos) & CLOCK_LFCLKSRC_SRC_Msk);
// Use Internal OSC to compatible with all boards
NRF_CLOCK->LFCLKSRC = CLOCK_LFCLKSRC_SRC_RC;
NRF_CLOCK->TASKS_LFCLKSTART = 1UL;
// LED
@@ -121,7 +121,8 @@ void board_init(void)
nrfx_power_init(&pwr_cfg);
// Register tusb function as USB power handler
const nrfx_power_usbevt_config_t config = { .handler = (nrfx_power_usb_event_handler_t) tusb_hal_nrf_power_event };
// cause cast-function-type warning
const nrfx_power_usbevt_config_t config = { .handler = ((nrfx_power_usb_event_handler_t) tusb_hal_nrf_power_event) };
nrfx_power_usbevt_init(&config);
nrfx_power_usbevt_enable();
+5 -4
View File
@@ -1,3 +1,5 @@
include $(TOP)/$(BOARD_PATH)/board.mk
CFLAGS += \
-flto \
-mthumb \
@@ -6,7 +8,6 @@ CFLAGS += \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-DCFG_TUSB_MCU=OPT_MCU_NRF5X \
-DNRF52840_XXAA \
-DCONFIG_GPIO_AS_PINRESET
# suppress warning caused by vendor mcu driver
@@ -26,7 +27,7 @@ LDFLAGS += -L$(TOP)/hw/mcu/nordic/nrfx/mdk
SRC_C += \
hw/mcu/nordic/nrfx/drivers/src/nrfx_power.c \
hw/mcu/nordic/nrfx/drivers/src/nrfx_uarte.c \
hw/mcu/nordic/nrfx/mdk/system_nrf52840.c
hw/mcu/nordic/nrfx/mdk/system_$(MCU_VARIANT).c
INC += \
$(TOP)/$(BOARD_PATH) \
@@ -38,7 +39,7 @@ INC += \
$(TOP)/hw/mcu/nordic/nrfx/drivers/include \
$(TOP)/hw/mcu/nordic/nrfx/drivers/src \
SRC_S += hw/mcu/nordic/nrfx/mdk/gcc_startup_nrf52840.S
SRC_S += hw/mcu/nordic/nrfx/mdk/gcc_startup_$(MCU_VARIANT).S
ASFLAGS += -D__HEAP_SIZE=0
@@ -50,7 +51,7 @@ CHIP_FAMILY = nrf5x
FREERTOS_PORT = ARM_CM4F
# For flash-jlink target
JLINK_DEVICE = nRF52840_xxAA
JLINK_DEVICE = $(MCU_VARIANT)_xxaa
# For uf2 conversion
UF2_FAMILY = 0xADA52840