Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vesta
meta-vesta
Commits
83be3621
Commit
83be3621
authored
Jul 05, 2018
by
David Mondou
Browse files
Removed 300 references. Add clear_swd function
parent
b2d9adbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
recipes-extended/openocd/files/bmd300_program.sh
View file @
83be3621
...
...
@@ -85,7 +85,7 @@ convert_bin_to_hex_files ()
#Check to see if nrf52 is protected
test_nrf52_protected
()
{
echo
"Checking BMD
300
lock status"
echo
"Checking BMD lock status"
openocd
-f
interface/imx-native.cfg
-c
\
"transport select swd; source [find target/nrf52.cfg]"
-c
init
\
-c
"dap apreg 1 0x0c"
-c
exit
2> junk
...
...
@@ -93,10 +93,10 @@ test_nrf52_protected() {
rm
junk
if
[
$APPROTECTSTATUS
=
"0x00000001"
]
then
echo
"BMD
300
NOT PROTECTED"
echo
"BMD NOT PROTECTED"
return
1
else
echo
"BMD
300
PROTECTED"
echo
"BMD PROTECTED"
return
0
fi
}
...
...
@@ -109,7 +109,7 @@ test_nrf52_for_protection ()
-c
"transport select swd; source [find target/nrf52.cfg]"
\
-c
init
\
-c
"dap apreg 1 0x04 0x01;
\
echo Unlocking
\
BMD
-300
...;
\
echo Unlocking
\
BMD...;
\
sleep 30000;
\
dap apreg 1 0x08;
\
dap apreg 1 0x00 0x01;
\
...
...
@@ -127,6 +127,23 @@ test_nrf52_for_protection ()
fi
}
# blow out swd lines to ensure SWD is in a good state
clear_swd
()
{
echo
78
>
/sys/class/gpio/export
echo
out
>
/sys/class/gpio/gpio78/direction
for
i
in
`
seq
1 9
`
;
do
echo
1
>
/sys/class/gpio/gpio78/value
usleep 100000
echo
0
>
/sys/class/gpio/gpio78/value
usleep 100000
done
echo
78
>
/sys/class/gpio/unexport
}
# Check for at least one option
if
[
$#
-eq
0
]
;
then
print_usage
...
...
@@ -173,8 +190,9 @@ if [ "${cmds}" == "" ]; then
fi
test_nrf52_for_protection
clear_swd
echo
"writing files
${
HEX_FILES
[@]
}
to BMD
300
. . . ."
echo
"writing files
${
HEX_FILES
[@]
}
to BMD . . . ."
#execute openocd command
eval
openocd
-f
interface/imx-native.cfg
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment