- /* no valid interface was found (i.e. the configuration option,
- * didn't match one of the compiled-in interfaces
- */
- LOG_ERROR("The specified JTAG interface was not found (%s)", args[0]);
- handle_interface_list_command(cmd_ctx, cmd, args, argc);
- return ERROR_JTAG_INVALID_INTERFACE;
-}
-
-static int handle_interface_list_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
-{
- if (strcmp(cmd, "interface_list") == 0 && argc > 0)
- return ERROR_COMMAND_SYNTAX_ERROR;
-
- command_print(cmd_ctx, "The following JTAG interfaces are available:");
- for (unsigned i = 0; NULL != jtag_interfaces[i]; i++)
- {
- const char *name = jtag_interfaces[i]->name;
- command_print(cmd_ctx, "%u: %s", i + 1, name);
- }
-
- return ERROR_OK;
-}
-
-static int handle_jtag_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
-{
- int e;
- char buf[1024];
- Jim_Obj *newargs[ 10 ];
- /*
- * CONVERT SYNTAX
- * argv[-1] = command
- * argv[ 0] = ir length
- * argv[ 1] = ir capture
- * argv[ 2] = ir mask
- * argv[ 3] = not actually used by anything but in the docs
- */
-
- if( argc < 4 ){
- command_print( cmd_ctx, "OLD DEPRECATED SYNTAX: Please use the NEW syntax");
- return ERROR_OK;
- }
- command_print( cmd_ctx, "OLD SYNTAX: DEPRECATED - translating to new syntax");
- command_print( cmd_ctx, "jtag newtap CHIP TAP -irlen %s -ircapture %s -irvalue %s",
- args[0],
- args[1],
- args[2] );
- command_print( cmd_ctx, "Example: STM32 has 2 taps, the cortexM3(len4) + boundaryscan(len5)");
- command_print( cmd_ctx, "jtag newtap stm32 cortexm3 ....., thus creating the tap: \"stm32.cortexm3\"");
- command_print( cmd_ctx, "jtag newtap stm32 boundary ....., and the tap: \"stm32.boundary\"");
- command_print( cmd_ctx, "And then refer to the taps by the dotted name.");
-
- newargs[0] = Jim_NewStringObj( interp, "jtag", -1 );
- newargs[1] = Jim_NewStringObj( interp, "newtap", -1 );
- sprintf( buf, "chip%d", jtag_tap_count() );
- newargs[2] = Jim_NewStringObj( interp, buf, -1 );
- sprintf( buf, "tap%d", jtag_tap_count() );
- newargs[3] = Jim_NewStringObj( interp, buf, -1 );
- newargs[4] = Jim_NewStringObj( interp, "-irlen", -1 );
- newargs[5] = Jim_NewStringObj( interp, args[0], -1 );
- newargs[6] = Jim_NewStringObj( interp, "-ircapture", -1 );
- newargs[7] = Jim_NewStringObj( interp, args[1], -1 );
- newargs[8] = Jim_NewStringObj( interp, "-irmask", -1 );
- newargs[9] = Jim_NewStringObj( interp, args[2], -1 );
-
- command_print( cmd_ctx, "NEW COMMAND:");
- sprintf( buf, "%s %s %s %s %s %s %s %s %s %s",
- Jim_GetString( newargs[0], NULL ),
- Jim_GetString( newargs[1], NULL ),
- Jim_GetString( newargs[2], NULL ),
- Jim_GetString( newargs[3], NULL ),
- Jim_GetString( newargs[4], NULL ),
- Jim_GetString( newargs[5], NULL ),
- Jim_GetString( newargs[6], NULL ),
- Jim_GetString( newargs[7], NULL ),
- Jim_GetString( newargs[8], NULL ),
- Jim_GetString( newargs[9], NULL ) );
-
- e = jim_jtag_command( interp, 10, newargs );
- if( e != JIM_OK ){
- command_print( cmd_ctx, "%s", Jim_GetString( Jim_GetResult(interp), NULL ) );
- }
- return e;