Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
45e0468e
Commit
45e0468e
authored
7 years ago
by
Hauke Petersen
Browse files
Options
Downloads
Patches
Plain Diff
tools/jlink: add RTT terminal support (term_rtt)
parent
8587ba0e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dist/tools/jlink/jlink.sh
+46
-0
46 additions, 0 deletions
dist/tools/jlink/jlink.sh
dist/tools/jlink/term.seg
+1
-0
1 addition, 0 deletions
dist/tools/jlink/term.seg
with
47 additions
and
0 deletions
dist/tools/jlink/jlink.sh
+
46
−
0
View file @
45e0468e
...
@@ -57,6 +57,9 @@ _JLINK=JLinkExe
...
@@ -57,6 +57,9 @@ _JLINK=JLinkExe
_JLINK_SERVER
=
JLinkGDBServer
_JLINK_SERVER
=
JLinkGDBServer
_JLINK_IF
=
SWD
_JLINK_IF
=
SWD
_JLINK_SPEED
=
2000
_JLINK_SPEED
=
2000
# default terminal frontend
_JLINK_TERMPROG
=
${
RIOTBASE
}
/dist/tools/pyterm/pyterm
_JLINK_TERMFLAGS
=
"-ts 19021"
#
#
# a couple of tests for certain configuration options
# a couple of tests for certain configuration options
...
@@ -135,6 +138,15 @@ test_dbg() {
...
@@ -135,6 +138,15 @@ test_dbg() {
fi
fi
}
}
test_term
()
{
if
[
-z
"
${
JLINK_TERMPROG
}
"
]
;
then
JLINK_TERMPROG
=
"
${
_JLINK_TERMPROG
}
"
fi
if
[
-z
"
${
JLINK_TERMFLAGS
}
"
]
;
then
JLINK_TERMFLAGS
=
"
${
_JLINK_TERMFLAGS
}
"
fi
}
#
#
# now comes the actual actions
# now comes the actual actions
#
#
...
@@ -209,6 +221,36 @@ do_reset() {
...
@@ -209,6 +221,36 @@ do_reset() {
-commandfile '
${
RIOTBASE
}
/dist/tools/jlink/reset.seg'"
-commandfile '
${
RIOTBASE
}
/dist/tools/jlink/reset.seg'"
}
}
do_term
()
{
test_config
test_serial
test_term
# temporary file that save the JLink pid
JLINK_PIDFILE
=
$(
mktemp
-t
"jilnk_pid.XXXXXXXXXX"
)
# will be called by trap
cleanup
()
{
JLINK_PID
=
"
$(
cat
${
JLINK_PIDFILE
}
)
"
kill
${
JLINK_PID
}
rm
-r
"
${
JLINK_PIDFILE
}
"
exit
0
}
# cleanup after script terminates
trap
"cleanup
${
JLINK_PIDFILE
}
"
EXIT
# don't trapon Ctrl+C, because JLink keeps running
trap
''
INT
# start Jlink as RTT server
setsid sh
-c
"
${
JLINK
}
${
JLINK_SERIAL
}
\
-device '
${
JLINK_DEVICE
}
'
\
-speed '
${
JLINK_SPEED
}
'
\
-if '
${
JLINK_IF
}
'
\
-jtagconf -1,-1
\
-commandfile '
${
RIOTBASE
}
/dist/tools/jlink/term.seg' &
\
echo
\$
! >
$JLINK_PIDFILE
"
&
sh
-c
"
${
JLINK_TERMPROG
}
${
JLINK_TERMFLAGS
}
"
}
#
#
# parameter dispatching
# parameter dispatching
#
#
...
@@ -233,6 +275,10 @@ case "${ACTION}" in
...
@@ -233,6 +275,10 @@ case "${ACTION}" in
echo
"### Resetting Target ###"
echo
"### Resetting Target ###"
do_reset
"
$@
"
do_reset
"
$@
"
;;
;;
term_rtt
)
echo
"### Starting RTT terminal ###"
do_term
;;
*
)
*
)
echo
"Usage:
$0
{flash|debug|debug-server|reset}"
echo
"Usage:
$0
{flash|debug|debug-server|reset}"
;;
;;
...
...
This diff is collapsed.
Click to expand it.
dist/tools/jlink/term.seg
0 → 100644
+
1
−
0
View file @
45e0468e
connect
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment