Automatically generate upload protocols based on debug tools
This commit is contained in:
+19
-17
@@ -37,31 +37,33 @@ class Espressif32Platform(PlatformBase):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
def _add_default_debug_tools(self, board):
|
def _add_default_debug_tools(self, board):
|
||||||
|
non_debug_protocols = ["esptool"]
|
||||||
|
supported_debug_tools = [
|
||||||
|
"esp-prog",
|
||||||
|
"iot-bus-jtag",
|
||||||
|
"jlink",
|
||||||
|
"minimodule",
|
||||||
|
"olimex-arm-usb-tiny-h",
|
||||||
|
"olimex-arm-usb-ocd-h",
|
||||||
|
"olimex-arm-usb-ocd",
|
||||||
|
"olimex-jtag-tiny",
|
||||||
|
"tumpa"
|
||||||
|
]
|
||||||
|
|
||||||
debug = board.manifest.get("debug", {})
|
debug = board.manifest.get("debug", {})
|
||||||
upload_protocol = board.manifest.get("upload", {}).get("protocol")
|
upload_protocol = board.manifest.get("upload", {}).get("protocol")
|
||||||
upload_protocols = board.manifest.get("upload", {}).get(
|
upload_protocols = board.manifest.get("upload", {}).get(
|
||||||
"protocols", [])
|
"protocols", [])
|
||||||
if "tools" not in debug:
|
|
||||||
debug['tools'] = {}
|
|
||||||
|
|
||||||
non_debug_protocols = ["esptool"]
|
|
||||||
supported_debu_tools = [
|
|
||||||
"esp-prog",
|
|
||||||
"iot-bus-jtag",
|
|
||||||
"jlink",
|
|
||||||
"minimodule",
|
|
||||||
"olimex-arm-usb-tiny-h",
|
|
||||||
"olimex-arm-usb-ocd-h",
|
|
||||||
"olimex-arm-usb-ocd",
|
|
||||||
"olimex-jtag-tiny",
|
|
||||||
"tumpa"
|
|
||||||
]
|
|
||||||
if debug:
|
if debug:
|
||||||
upload_protocols.extend(supported_debu_tools)
|
upload_protocols.extend(supported_debug_tools)
|
||||||
|
|
||||||
if upload_protocol and upload_protocol not in upload_protocols:
|
if upload_protocol and upload_protocol not in upload_protocols:
|
||||||
upload_protocols.append(upload_protocol)
|
upload_protocols.append(upload_protocol)
|
||||||
|
|
||||||
|
board.manifest['upload']['protocols'] = upload_protocols
|
||||||
|
|
||||||
|
if "tools" not in debug:
|
||||||
|
debug['tools'] = {}
|
||||||
|
|
||||||
# Only FTDI based debug probes
|
# Only FTDI based debug probes
|
||||||
for link in upload_protocols:
|
for link in upload_protocols:
|
||||||
if link in non_debug_protocols or link in debug['tools']:
|
if link in non_debug_protocols or link in debug['tools']:
|
||||||
|
|||||||
Reference in New Issue
Block a user