1 local getopt
= require('getopt')
2 local ansicolors
= require('ansicolors')
3 local utils
= require('utils')
9 This script attempts to reset the password
13 script run lf_t55xx_reset
16 script run lf_t55xx_reset -h
24 -- A debug printout-function
25 local function dbg(args
)
26 if not DEBUG
then return end
27 if type(args
) == 'table' then
38 -- This is only meant to be used when errors occur
39 local function oops(err
)
41 core
.clearCommandBuffer()
51 print(ansicolors
.cyan
..'Usage'..ansicolors
.reset
)
53 print(ansicolors
.cyan
..'Arguments'..ansicolors
.reset
)
55 print(ansicolors
.cyan
..'Example usage'..ansicolors
.reset
)
59 -- The main entry point
61 local dash
= string.rep('--', 20)
67 -- Read the parameters
68 for o
, a
in getopt
.getopt(args
, 'h') do
69 if o
== 'h' then return help() end
72 print('Attempting T55xx chip reset')
74 -- core.console('lf t55 write -b 0 -d 000880E0 --r0 -t')
75 -- core.console('lf t55 write -b 0 -d 000880E0 --r1 -t')
76 -- core.console('lf t55 write -b 0 -d 000880E0 --r2 -t')
77 -- core.console('lf t55 write -b 0 -d 000880E0 --r3 -t')
78 core
.console('lf t55 write -b 0 -d 000880E0 --r0')
79 core
.console('lf t55 write -b 0 -d 000880E0 --r1')
80 core
.console('lf t55 write -b 0 -d 000880E0 --r2')
81 core
.console('lf t55 write -b 0 -d 000880E0 --r3')
82 core
.console('lf t55 wipe')
83 core
.console('lf t55 detect')