feat(tools/efuse): Make port mandatory for eFuse commands

BREAKING CHANGE:

Autodetection was removed from idf.py efuse* commands to prevent accidental use of the wrong port.
This commit is contained in:
Peter Dragun
2025-07-02 13:05:19 +02:00
parent 4bdd6b6f7b
commit b184766aa4
2 changed files with 12 additions and 2 deletions

View File

@@ -23,3 +23,10 @@ On Linux or MacOS, you can use Python 3.11 or 3.12 and gdbgui version 0.15.2.0.
Please be aware that these recommendations may change over time and for an up-to-date list of issues refer to `the official issue tracker <https://github.com/cs01/gdbgui/issues>`_.
We recommend to use ``idf.py gdb`` instead of ``idf.py gdbgui``, or debug in Eclipse/Vscode if you encounter an issue with the installation.
``idf.py efuse*`` Commands Require Port
---------------------------------------
All commands with eFuse functionality now require a serial port to be specified. This was done to prevent accidental use of the wrong port, as these operations are irreversible.
For all ``idf.py efuse*`` commands, you now need to specify the serial port with the ``--port`` argument (or ``ESPPORT`` environment variable). If the port is not specified, the command will fail with an error message.

View File

@@ -515,7 +515,10 @@ def action_extensions(base_actions: Dict, project_path: str) -> Dict:
if args.port:
efuse_args += ['-p', args.port]
elif not args.port and not extra_args['virt']: # if --virt, no port will be found and it would cause error
efuse_args += ['-p', get_default_serial_port()]
raise FatalError(
'Error: Port is required for espefuse. '
'Please specify the port with the --port argument.'
)
efuse_args += ['--chip', _get_project_desc(ctx, args)['target']]
if extra_args['virt']:
efuse_args += ['--virt']
@@ -712,7 +715,7 @@ def action_extensions(base_actions: Dict, project_path: str) -> Dict:
},
{
'names': ['--flash-crypt-conf'],
'help': ('Override FLASH_CRYPT_CONF efuse value (default is 0XF).'),
'help': ('Override FLASH_CRYPT_CONF eFuse value (default is 0XF).'),
},
],
'arguments': [