File tree Expand file tree Collapse file tree 2 files changed +44
-1
lines changed
ports/stm32/boards/LEGO_HUB_NO6 Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,26 @@ firmware at 0x08010000. When mboot is installed it can be entered programatical
28
28
via machine.bootloader(), or by holding down the left arrow button when powering
29
29
on the Hub and waiting until the display says "B" before releasing the button.
30
30
31
+ Backing up original Hub firmware
32
+ --------------------------------
33
+
34
+ Before install MicroPython it is advised to backup the original LEGO firmware that
35
+ the Hub comes installed with. To do this, enter the built-in bootloader by holding
36
+ down the Bluetooth button for 5 seconds while powering up the Hub via USB. Then
37
+ run the following command from the root of this repository:
38
+
39
+ $ cd ports/stm32
40
+ $ make BOARD=LEGO_HUB_NO6 backup-hub-firmware
41
+
42
+ This will create a file called ` lego_hub_firmware.dfu ` . Put this file in a safe
43
+ location. To restore it, enter the built-in bootloader again and run:
44
+
45
+ $ make BOARD=LEGO_HUB_NO6 restore-hub-firmware
46
+
47
+ This will restore the original firmware but not the filesystem. To recreate the
48
+ original filesystem the Hub must be updated using the appropriate LEGO PC
49
+ application.
50
+
31
51
Installing MicroPython
32
52
----------------------
33
53
@@ -76,4 +96,4 @@ To scan for BLE devices:
76
96
>>> ble.active(1)
77
97
>>> ble.gap_scan(2000, 625, 625)
78
98
79
- Use help("modules") to see available built-in modules.
99
+ Use help("modules") to see available built-in modules.
Original file line number Diff line number Diff line change 20
20
# Bootloader settings
21
21
MBOOT_TEXT0_ADDR = 0x08008000
22
22
MBOOT_LD_FILES = ../boards/LEGO_HUB_NO6/mboot_memory.ld stm32_sections.ld
23
+
24
+ # Backup/restore original Hub firmware
25
+
26
+ HUB_FIRMWARE = lego_hub_firmware.dfu
27
+ HUB_FIRMWARE_ADDR = $(MBOOT_TEXT0_ADDR )
28
+ HUB_FIRMWARE_SIZE = 0xf8000
29
+
30
+ backup-hub-firmware :
31
+ $(Q )$(DFU_UTIL ) -a 0 \
32
+ -d $(BOOTLOADER_DFU_USB_VID ) :$(BOOTLOADER_DFU_USB_PID ) \
33
+ -U $(HUB_FIRMWARE ) .bin \
34
+ -s $(HUB_FIRMWARE_ADDR ) :$(HUB_FIRMWARE_SIZE )
35
+ $(Q )$(PYTHON ) $(DFU ) \
36
+ -b $(HUB_FIRMWARE_ADDR ) :$(HUB_FIRMWARE ) .bin \
37
+ -D $(BOOTLOADER_DFU_USB_VID ) :$(BOOTLOADER_DFU_USB_PID ) \
38
+ $(HUB_FIRMWARE )
39
+ $(Q )$(RM ) $(HUB_FIRMWARE ) .bin
40
+ $(ECHO ) " Backup created in $( HUB_FIRMWARE) "
41
+
42
+ restore-hub-firmware :
43
+ $(Q )$(DFU_UTIL ) -a 0 \
44
+ -d $(BOOTLOADER_DFU_USB_VID ) :$(BOOTLOADER_DFU_USB_PID ) \
45
+ -D $(HUB_FIRMWARE )
You can’t perform that action at this time.
0 commit comments