summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2022-07-01 11:24:38 -0500
committerAlex Elder <elder@linaro.org>2022-07-01 11:24:38 -0500
commit2c4bfa60de85ccfc8352abfdc05e165d5b44c8f1 (patch)
tree34652a5e9a606271fd21feef04734c8559e9306f
parent7c5fd6d0c87d65af76a8fd009eea5d5660671fba (diff)
Add loopback_nv_read and loopback_nv_writemain
I was able to update the NV configuration for modem loopback mode without using a Windows system. So this adds two scripts, one which reads and the other which writes the loopback configuration. The README file is updated as well. Signed-off-by: Alex Elder <elder@linaro.org>
-rw-r--r--README49
-rwxr-xr-xloopback_nv_read26
-rwxr-xr-xloopback_nv_write34
3 files changed, 109 insertions, 0 deletions
diff --git a/README b/README
index 9eb9c68..1f8b90b 100644
--- a/README
+++ b/README
@@ -1,3 +1,52 @@
+Fri Jul 1 11:15:46 AM CDT 2022
+
+I am now able to configure the NV data with the loopback
+configuration without the use of the Windows laptop (using
+"diag-router" and "send_data").
+
+I have created two new shell scripts for this. Both require
+"diag-router" to be running when they are run:
+
+ diag-router &
+
+The first is "loopback_nv_read". On a newly-installed system,
+running it will produce something like this:
+
+ 75 19 39 0 255 255 255 255 2 0 0 0 5 0
+
+The "255 255 255 255" is an indicator that the NV item is not
+defined. To save the NV data loopback configuration, run:
+
+ loopback_nv_write
+
+And when successful, that outputs something like this:
+
+ 75 19 38 0 5 0 0 0 0 0
+
+You can immediately re-read the written value:
+
+ loopback_nv_read
+
+That will produce:
+
+ 75 19 39 0 82 0 0 0 0 0 0 0 5 0 76 79
+ 79 80 66 65 67 75 95 69 78 65 66 76 69 68 58 49
+ 59 10 76 50 95 76 79 79 80 66 65 67 75 95 69 78
+ 65 66 76 69 68 58 48 59 10 83 89 83 32 77 79 68
+ 69 58 57 59 10 82 69 80 95 70 65 67 84 79 82 58
+ 49 59 10 78 82 53 71 95 79 78 76 89 58 49 59 10
+
+However, note that this configuration does not take effect until the
+system is rebooted.
+
+ sync; sync; sync; reboot
+
+After a reboot, you can run this to verify loopback mode works (it
+still tests it, then brings down the interface):
+
+ loopback_config
+
+--------------------
Thu Jun 30 05:43:09 PM CDT 2022
To put the modem in loopback mode, you must configure it using "NV"
diff --git a/loopback_nv_read b/loopback_nv_read
new file mode 100755
index 0000000..1d29f2b
--- /dev/null
+++ b/loopback_nv_read
@@ -0,0 +1,26 @@
+# 54 bytes path length
+# /nv/item_files/modem/data/3gpp/ps/loopback_config.txt
+
+# 85 bytes file content (original--all but last end in \r\n)
+# LOOPBACK_ENABLED:1;
+# L2_LOOPBACK_ENABLED:0;
+# SYS MODE:9;
+# REP_FACTOR:1;
+# NR5G_ONLY:1;
+#
+# Experimentation showed that last line *can* end in \r\n. And all
+# lines can end in \n only.
+#
+# The REP_FACTOR says how many replicas are looped back; 1 means
+# simple loopback, while 2 means echo back two copies of each
+# received packet.
+
+# Read the "loopback_config.txt" NV data (length must be right)
+send_data 75 19 39 0 82 0 0 0 54 0 0 0 5 0 \
+ 47 110 118 \
+ 47 105 116 101 109 95 102 105 108 101 115 \
+ 47 109 111 100 101 109 \
+ 47 100 97 116 97 \
+ 47 51 103 112 112 \
+ 47 112 115 \
+ 47 108 111 111 112 98 97 99 107 95 99 111 110 102 105 103 46 116 120 116 0
diff --git a/loopback_nv_write b/loopback_nv_write
new file mode 100755
index 0000000..bc5f2ef
--- /dev/null
+++ b/loopback_nv_write
@@ -0,0 +1,34 @@
+# 54 bytes path length
+# /nv/item_files/modem/data/3gpp/ps/loopback_config.txt
+
+# 85 bytes file content (original--all but last end in \r\n)
+# LOOPBACK_ENABLED:1;
+# L2_LOOPBACK_ENABLED:0;
+# SYS MODE:9;
+# REP_FACTOR:1;
+# NR5G_ONLY:1;
+#
+# Experimentation showed that last line *can* end in \r\n. And all
+# lines can end in \n only.
+#
+# The REP_FACTOR says how many replicas are looped back; 1 means
+# simple loopback, while 2 means echo back two copies of each
+# received packet.
+
+# Write the "loopback_config.txt" NV data
+# data length path length
+send_data 75 19 38 0 82 0 0 0 64 0 8 0 5 0 \
+ 76 79 79 80 66 65 67 75 95 69 78 65 66 76 69 68 58 49 59 10 \
+ 76 50 95 76 79 79 80 66 65 67 75 95 69 78 65 66 76 69 68 58 48 59 10 \
+ 83 89 83 32 77 79 68 69 58 57 59 10 \
+ 82 69 80 95 70 65 67 84 79 82 58 49 59 10 \
+ 78 82 53 71 95 79 78 76 89 58 49 59 10 \
+ \
+ 47 110 118 \
+ 47 105 116 101 109 95 102 105 108 101 115 \
+ 47 109 111 100 101 109 \
+ 47 100 97 116 97 \
+ 47 51 103 112 112 \
+ 47 112 115 \
+ 47 108 111 111 112 98 97 99 107 95 99 111 110 102 105 103 46 116 120 116 0
+