File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -940,6 +940,18 @@ COMMAND_HANDLER(samd_handle_eeprom_command)
940
940
return res ;
941
941
}
942
942
943
+ COMMAND_HANDLER (samd_handle_restore_safe_command )
944
+ {
945
+ uint32_t user_row_0_dfl = 0xD9FEC7FF ;
946
+ uint32_t user_row_1_dfl = 0xFFFFFE5D ;
947
+ int res = ERROR_OK ;
948
+
949
+ struct target * target = get_current_target (CMD_CTX );
950
+ res = samd_modify_user_row (target , user_row_0_dfl , 0 , 31 );
951
+ res |= samd_modify_user_row (target , user_row_1_dfl , 32 , 63 );
952
+ return res ;
953
+ }
954
+
943
955
COMMAND_HANDLER (samd_handle_bootloader_command )
944
956
{
945
957
int res = ERROR_OK ;
@@ -1047,6 +1059,12 @@ static const struct command_registration at91samd_exec_command_handlers[] = {
1047
1059
"Changes are stored immediately but take affect after the MCU is"
1048
1060
"reset." ,
1049
1061
},
1062
+ {
1063
+ .name = "restore" ,
1064
+ .handler = samd_handle_restore_safe_command ,
1065
+ .mode = COMMAND_EXEC ,
1066
+ .help = "Restores safe USER ROW (FUSES) values" ,
1067
+ },
1050
1068
COMMAND_REGISTRATION_DONE
1051
1069
};
1052
1070
You can’t perform that action at this time.
0 commit comments