tools: idf.py: default to board/esp32s2-kaluga-1.cfg for ESP32-S2

NFC. Kaluga-1 config is same as devkitj + esp32s2.
This commit is contained in:
Ivan Grokhotkov
2020-07-03 18:20:08 +02:00
parent b7760cf269
commit 964f041269

View File

@ -155,16 +155,19 @@ def action_extensions(base_actions, project_path):
""" """
Execute openocd as external tool Execute openocd as external tool
""" """
OPENOCD_TAGET_CONFIG = {
"esp32": "-f board/esp32-wrover-kit-3.3v.cfg",
"esp32s2": "-f board/esp32s2-kaluga-1.cfg",
}
if os.getenv("OPENOCD_SCRIPTS") is None: if os.getenv("OPENOCD_SCRIPTS") is None:
raise FatalError("OPENOCD_SCRIPTS not found in the environment: Please run export.sh/export.bin", ctx) raise FatalError("OPENOCD_SCRIPTS not found in the environment: Please run export.sh/export.bat", ctx)
openocd_arguments = os.getenv("OPENOCD_COMMANDS") if openocd_commands is None else openocd_commands openocd_arguments = os.getenv("OPENOCD_COMMANDS") if openocd_commands is None else openocd_commands
project_desc = get_project_desc(args, ctx) project_desc = get_project_desc(args, ctx)
if openocd_arguments is None: if openocd_arguments is None:
# use default value if commands not defined in the environment nor command line # use default value if commands not defined in the environment nor command line
if project_desc["target"] == "esp32": target = project_desc["target"]
openocd_arguments = "-f board/esp32-wrover-kit-3.3v.cfg" default_args = "-f interface/ftdi/esp32_devkitj_v1.cfg -f target/{}.cfg".format(target)
else: openocd_arguments = OPENOCD_TAGET_CONFIG.get(target, default_args)
openocd_arguments = "-f interface/ftdi/esp32_devkitj_v1.cfg -f target/{}.cfg".format(project_desc["target"])
print('Note: OpenOCD cfg not found (via env variable OPENOCD_COMMANDS nor as a --openocd-commands argument)\n' print('Note: OpenOCD cfg not found (via env variable OPENOCD_COMMANDS nor as a --openocd-commands argument)\n'
'OpenOCD arguments default to: "{}"'.format(openocd_arguments)) 'OpenOCD arguments default to: "{}"'.format(openocd_arguments))
# script directory is taken from the environment by OpenOCD, update only if command line arguments to override # script directory is taken from the environment by OpenOCD, update only if command line arguments to override