Skip to content

Commit d5a2dd5

Browse files
committed
bricks/ev3rt: Make bootable firmware.zip.
This can be deployed with Pybricksdev.
1 parent ae25771 commit d5a2dd5

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

bricks/ev3rt/Makefile

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ INC += -I$(PBTOP)
6464
INC += -I$(BUILD)
6565

6666
GIT = git
67+
ZIP = zip
68+
PYBRICKSDEV = pybricksdev
69+
METADATA = $(PBTOP)/tools/metadata.py
6770

6871
CFLAGS_MCU =
6972
CFLAGS_WARN = -Wall -Werror -Wextra -Wno-unused-parameter -Wno-maybe-uninitialized
@@ -165,13 +168,9 @@ export EV3RT_BRICK_DIR
165168
export EV3RT_LIB_DIR
166169
export APPLDIRS
167170

168-
all: uImage firmware.bin
171+
all: uImage firmware
169172

170-
#TODO: Build our own u-boot image. Use any official firmware for now. u-boot will be extracted from it.
171-
UBOOT_FILE = $(EV3RT_BRICK_DIR)/officialfw.bin
172-
173-
firmware.bin: uImage
174-
python $(EV3RT_BRICK_DIR)/make_bootable_image.py $(UBOOT_FILE) $(BUILD)/uImage $(BUILD)/firmware.bin
173+
firmware: $(BUILD)/firmware.zip
175174

176175
ev3rt-config: $(EV3RT_BRICK_DIR) $(BUILD)/libkernel.a prepare-obj-folder
177176
make -C $(BUILD) offset.h kernel_cfg.h
@@ -196,3 +195,25 @@ prepare-obj-folder:
196195
mkdir -p $(EV3RT_BRICK_DIR)/build
197196
mkdir -p $(EV3RT_BRICK_DIR)/build/objs
198197
cp $(EV3RT_BRICK_DIR)/ev3rt.mk $(EV3RT_BRICK_DIR)/build/Makefile
198+
199+
#TODO: Build our own u-boot image. Use any official firmware for now. u-boot will be extracted from it.
200+
UBOOT_FILE = $(EV3RT_BRICK_DIR)/officialfw.bin
201+
202+
$(BUILD)/firmware-base.bin: uImage
203+
python $(EV3RT_BRICK_DIR)/make_bootable_image.py $(UBOOT_FILE) $(BUILD)/uImage $(BUILD)/firmware-base.bin
204+
205+
$(BUILD)/firmware.metadata.json: $(BUILD)/firmware-base.bin $(METADATA)
206+
$(ECHO) "META creating firmware metadata"
207+
$(Q)$(METADATA) $(FW_VERSION) $(PBIO_PLATFORM) $< $@
208+
209+
ZIP_FILES := \
210+
$(BUILD)/firmware-base.bin \
211+
$(BUILD)/firmware.metadata.json \
212+
ReadMe_OSS.txt \
213+
214+
$(BUILD)/firmware.zip: $(ZIP_FILES)
215+
$(ECHO) "ZIP creating firmware package"
216+
$(Q)$(ZIP) -j $@ $^
217+
218+
deploy: $(BUILD)/firmware.zip
219+
$(Q)$(PYBRICKSDEV) flash $<

bricks/ev3rt/ReadMe_OSS.txt

Whitespace-only changes.

tools/metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"essential_hub": {"device-id": 0x83, "checksum-type": "crc32"},
5353
"rcx": {"device-id": 0xE0, "checksum-type": "none"},
5454
"nxt": {"device-id": 0xE1, "checksum-type": "none"},
55-
"ev3": {"device-id": 0xE2, "checksum-type": "none"},
55+
"ev3rt": {"device-id": 0xE2, "checksum-type": "none"},
5656
}
5757

5858

0 commit comments

Comments
 (0)