Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
6f19b9c0
Commit
6f19b9c0
authored
Aug 26, 2021
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stm32/boards/LEGO_HUB_NO6: Add make commands to backup/restore firmware.
Signed-off-by:
Damien George
<
damien@micropython.org
>
parent
bac791c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
1 deletion
+44
-1
ports/stm32/boards/LEGO_HUB_NO6/README.md
ports/stm32/boards/LEGO_HUB_NO6/README.md
+21
-1
ports/stm32/boards/LEGO_HUB_NO6/mpconfigboard.mk
ports/stm32/boards/LEGO_HUB_NO6/mpconfigboard.mk
+23
-0
No files found.
ports/stm32/boards/LEGO_HUB_NO6/README.md
View file @
6f19b9c0
...
...
@@ -28,6 +28,26 @@ firmware at 0x08010000. When mboot is installed it can be entered programatical
via machine.bootloader(), or by holding down the left arrow button when powering
on the Hub and waiting until the display says "B" before releasing the button.
Backing up original Hub firmware
--------------------------------
Before install MicroPython it is advised to backup the original LEGO firmware that
the Hub comes installed with. To do this, enter the built-in bootloader by holding
down the Bluetooth button for 5 seconds while powering up the Hub via USB. Then
run the following command from the root of this repository:
$ cd ports/stm32
$ make BOARD=LEGO_HUB_NO6 backup-hub-firmware
This will create a file called
`lego_hub_firmware.dfu`
. Put this file in a safe
location. To restore it, enter the built-in bootloader again and run:
$ make BOARD=LEGO_HUB_NO6 restore-hub-firmware
This will restore the original firmware but not the filesystem. To recreate the
original filesystem the Hub must be updated using the appropriate LEGO PC
application.
Installing MicroPython
----------------------
...
...
@@ -76,4 +96,4 @@ To scan for BLE devices:
>>> ble.active(1)
>>> ble.gap_scan(2000, 625, 625)
Use help("modules") to see available built-in modules.
\ No newline at end of file
Use help("modules") to see available built-in modules.
ports/stm32/boards/LEGO_HUB_NO6/mpconfigboard.mk
View file @
6f19b9c0
...
...
@@ -20,3 +20,26 @@ endif
# Bootloader settings
MBOOT_TEXT0_ADDR
=
0x08008000
MBOOT_LD_FILES
=
../boards/LEGO_HUB_NO6/mboot_memory.ld stm32_sections.ld
# Backup/restore original Hub firmware
HUB_FIRMWARE
=
lego_hub_firmware.dfu
HUB_FIRMWARE_ADDR
=
$(MBOOT_TEXT0_ADDR)
HUB_FIRMWARE_SIZE
=
0xf8000
backup-hub-firmware
:
$(Q)$(DFU_UTIL)
-a
0
\
-d
$(BOOTLOADER_DFU_USB_VID)
:
$(BOOTLOADER_DFU_USB_PID)
\
-U
$(HUB_FIRMWARE)
.bin
\
-s
$(HUB_FIRMWARE_ADDR)
:
$(HUB_FIRMWARE_SIZE)
$(Q)$(PYTHON)
$(DFU)
\
-b
$(HUB_FIRMWARE_ADDR)
:
$(HUB_FIRMWARE)
.bin
\
-D
$(BOOTLOADER_DFU_USB_VID)
:
$(BOOTLOADER_DFU_USB_PID)
\
$(HUB_FIRMWARE)
$(Q)$(RM)
$(HUB_FIRMWARE)
.bin
$(ECHO)
"Backup created in
$(HUB_FIRMWARE)
"
restore-hub-firmware
:
$(Q)$(DFU_UTIL)
-a
0
\
-d
$(BOOTLOADER_DFU_USB_VID)
:
$(BOOTLOADER_DFU_USB_PID)
\
-D
$(HUB_FIRMWARE)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment