Skip to content

Commit

Permalink
Add Giga R1 board (#747)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewCapon authored Jul 30, 2024
1 parent f4972c5 commit 1692024
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 5 deletions.
59 changes: 59 additions & 0 deletions boards/giga_r1_m4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"build": {
"arduino":{
"ldscript": "linker_script.ld",
"flash_layout": "50_50"
},
"extra_flags": "-DARDUINO_GIGA -DARDUINO_GIGA_M4 -DGIGA_PINS",
"core": "arduino",
"cpu": "cortex-m4",
"f_cpu": "480000000L",
"mcu": "stm32h747xih6",
"variant": "GENERIC_STM32H747_M4",
"product_line": "STM32H747xx",
"hwids": [
[
"0x2341",
"0x0366"
],
[
"0x2341",
"0x0266"
],
[
"0x2341",
"0x0466"
]
]
},
"connectivity": [
"bluetooth",
"wifi"
],
"debug": {
"jlink_device": "STM32H747XI_M4",
"openocd_target": "stm32h7x_dual_bank"
},
"frameworks": [
"arduino"
],
"name": "Arduino Giga R1 (M4 core)",
"upload": {
"maximum_ram_size": 294248,
"maximum_size": 1048576,
"protocol": "dfu",
"protocols": [
"cmsis-dap",
"dfu",
"jlink",
"stlink",
"mbed"
],
"require_upload_port": true,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"offset_address": "0x08100000"
},
"url": "https://docs.arduino.cc/hardware/giga-r1-wifi",
"vendor": "Arduino"
}
59 changes: 59 additions & 0 deletions boards/giga_r1_m7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"build": {
"arduino":{
"ldscript": "linker_script.ld",
"flash_layout": "50_50"
},
"extra_flags": "-DARDUINO_GIGA -DARDUINO_GIGA_M7 -DGIGA_PINS",
"core": "arduino",
"cpu": "cortex-m7",
"f_cpu": "480000000L",
"mcu": "stm32h747xih6",
"variant": "GIGA",
"product_line": "STM32H747xx",
"hwids": [
[
"0x2341",
"0x0366"
],
[
"0x2341",
"0x0266"
],
[
"0x2341",
"0x0466"
]
]
},
"connectivity": [
"bluetooth",
"wifi"
],
"debug": {
"jlink_device": "STM32H747XI_M7",
"openocd_target": "stm32h7x_dual_bank"
},
"frameworks": [
"arduino"
],
"name": "Arduino Giga R1 (M7 core)",
"upload": {
"maximum_ram_size": 523624,
"maximum_size": 786432,
"protocol": "dfu",
"protocols": [
"cmsis-dap",
"dfu",
"jlink",
"stlink",
"mbed"
],
"require_upload_port": true,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"offset_address": "0x08040000"
},
"url": "https://docs.arduino.cc/hardware/giga-r1-wifi",
"vendor": "Arduino"
}
6 changes: 3 additions & 3 deletions builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def _jlink_cmd_script(env, source):
vid = hwids[0][0]
pid = hwids[0][1]

if env.subst("$BOARD").startswith(("portenta", "opta", "nicla")):
if env.subst("$BOARD").startswith(("portenta", "opta", "nicla", "giga")):
_upload_tool = '"%s"' % join(platform.get_package_dir(
"tool-dfuutil-arduino") or "", "dfu-util")
else:
Expand All @@ -230,7 +230,7 @@ def _jlink_cmd_script(env, source):
upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")]

if "arduino" in frameworks:
if env.subst("$BOARD").startswith(("portenta", "opta", "nicla")):
if env.subst("$BOARD").startswith(("portenta", "opta", "nicla", "giga")):
upload_actions.insert(
0,
env.VerboseAction(BeforeUpload, "Looking for upload port...")
Expand All @@ -255,7 +255,7 @@ def __configure_upload_port(env):
"Looking for upload port..."))

if "dfu-util" in _upload_tool:
if not env.subst("$BOARD").startswith(("portenta", "opta", "nicla")):
if not env.subst("$BOARD").startswith(("portenta", "opta", "nicla", "giga")):
# Add special DFU header to the binary image
env.AddPostAction(
join("$BUILD_DIR", "${PROGNAME}.bin"),
Expand Down
4 changes: 2 additions & 2 deletions platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def configure_default_packages(self, variables, targets):

frameworks = variables.get("pioframework", [])
if "arduino" in frameworks:
if board.startswith(("portenta", "opta", "nicla_vision")):
if board.startswith(("portenta", "opta", "nicla_vision", "giga")):
self.frameworks["arduino"]["package"] = "framework-arduino-mbed"
self.frameworks["arduino"][
"script"
Expand Down Expand Up @@ -72,7 +72,7 @@ def configure_default_packages(self, variables, targets):
default_protocol = board_config.get("upload.protocol") or ""
if variables.get("upload_protocol", default_protocol) == "dfu":
dfu_package = "tool-dfuutil"
if board.startswith(("portenta", "opta", "nicla")):
if board.startswith(("portenta", "opta", "nicla", "giga")):
dfu_package = "tool-dfuutil-arduino"
self.packages.pop("tool-dfuutil")
else:
Expand Down

0 comments on commit 1692024

Please sign in to comment.