Project

General

Profile

Osmocon » History » Version 27

steve-m, 02/19/2016 10:49 PM
typo

1 27 steve-m
{{>toc}}
2 1 laforge
3 27 steve-m
<pre>
4 1 laforge
5
6 27 steve-m
<pre>
7 1 laforge
8 27 steve-m
It is also used to download a firmware or bootloader into the phone over the serial line, which is currently implemented for the [[MotorolaC123|CompalE88 (C118C120C121C123)] the [wikiMotorolaC155 CompalE99 (C155)]].
9
10
11
Supported Bootloaders are currently the [[CompalRamloader]] and the [[HardwareCalypsoRomloader]].
12
13 1 laforge
After uploading a firmware, it turns into an HDLC mulitplexer/demultiplexer, allowing for multichannel communication with the device.
14
15
The phones console is on one such channel and will be redirected to the terminal (stdout) on which osmocom runs.
16 8 laforge
17 23 laforge
Several other HDLC channels are accessible by means of the following unix domain sockets:
18 27 steve-m
* /tmp/osmocom_l2 for the [[L1A_L23_Interface]] as used by [[mobile]], [[ccch_scan]] and other host programs
19
* /tmp/osmocon_loader for the [[Bootloader]]
20 14 laforge
21 27 steve-m
<pre>
22
<code class="graphviz">
23 14 laforge
digraph G {
24 1 laforge
  graph [rankdir = LR];
25 27 steve-m
  Phone -> [[SerialPort]] [ label = "RS232" dir=both ];
26
  [[SerialPort]] -> osmocon [ label = "/dev/ttyUSB*" dir=both ];
27 1 laforge
  layer23 -> osmocon [label = "unix socket" dir=both ];
28
  osmoload -> osmocon [label = "unix socket" dir=both ];
29
  firmware -> osmocon [label = "file read" ];
30 18 laforge
  osmocon -> terminal [label = "stdout" ];
31 19 laforge
  osmocon [ shape = doublecircle ];
32 14 laforge
  layer23 [ shape = circle label = "mobile"];
33
  osmoload [ shape = circle];
34 1 laforge
  { rank = same; terminal layer23 osmoload firmware }
35 9 laforge
}
36 27 steve-m
</code></pre>
37 20 laforge
38
39 27 steve-m
h2. General Usage
40
41
42
* *Connect your phone* UART to a serial port of your PC, using a [[HardwareSerialCable]] (3.3V RS232 on 2.5mm headphone jack)
43
* *Choose firmware* you have to load, depending on a host program you want to run (see [[Applications]])
44
* *Load firmware* to the phone, running osmocon like below. Fill in phone type and firmware name with your values. See [[HardwarePhones]] if you need to look up the phone type.
45
<pre>
46 9 laforge
$ ./osmocon -p /dev/ttyUSB0 -m c123xor ../../target/firmware/board/PHONE_TYPE/FIRMWARE.compalram.bin
47 27 steve-m
</code></pre>
48
* Make sure your phone is off.  *Briefly press the power-on button* of your phone (short push, not like a regular phone boot!). Avoid charging the phone while using osmocon, this can inhibit the loader.
49
* Observe output resembling the following
50
<pre>
51 13 laforge
got 2 bytes from modem, data looks like: 2f c8 
52 1 laforge
got 5 bytes from modem, data looks like: 1b f6 02 00 41 
53
got 1 bytes from modem, data looks like: 01 
54
got 1 bytes from modem, data looks like: 40 
55
Received PROMPT1 from phone, responding with CMD
56
read_file(../../target/firmware/board/compal_e88/loader.compalram.bin): file_size=13404, hdr_len=4, dnload_len=13411
57
got 1 bytes from modem, data looks like: 1b 
58
got 1 bytes from modem, data looks like: f6 
59
got 1 bytes from modem, data looks like: 02 
60 9 laforge
got 1 bytes from modem, data looks like: 00 
61
got 1 bytes from modem, data looks like: 41 
62
got 1 bytes from modem, data looks like: 02 
63
got 1 bytes from modem, data looks like: 43 
64
Received PROMPT2 from phone, starting download
65
handle_write(): 1023 bytes (1023/13411)
66
handle_write(): 768 bytes (1791/13411)
67
handle_write(): 768 bytes (2559/13411)
68
handle_write(): 768 bytes (3327/13411)
69
handle_write(): 768 bytes (4095/13411)
70
handle_write(): 768 bytes (4863/13411)
71
handle_write(): 768 bytes (5631/13411)
72
handle_write(): 768 bytes (6399/13411)
73
handle_write(): 768 bytes (7167/13411)
74
handle_write(): 768 bytes (7935/13411)
75 1 laforge
handle_write(): 768 bytes (8703/13411)
76
handle_write(): 768 bytes (9471/13411)
77
handle_write(): 768 bytes (10239/13411)
78
handle_write(): 768 bytes (11007/13411)
79
handle_write(): 768 bytes (11775/13411)
80
handle_write(): 768 bytes (12543/13411)
81
handle_write(): 768 bytes (13311/13411)
82
handle_write(): 100 bytes (13411/13411)
83
handle_write(): finished
84
got 1 bytes from modem, data looks like: 1b 
85
got 1 bytes from modem, data looks like: f6 
86
got 1 bytes from modem, data looks like: 02 
87
got 1 bytes from modem, data looks like: 00 
88
got 1 bytes from modem, data looks like: 41 
89
got 1 bytes from modem, data looks like: 03 
90 23 laforge
got 1 bytes from modem, data looks like: 42 
91 1 laforge
Received DOWNLOAD ACK from phone, your code is running now!
92
93
94
OSMOCOM Calypso loader (revision f45c5ee-modified)
95
======================================================================
96
Running on compal_e88 in environment ramload
97
98 27 steve-m
</code></pre>
99
* You can now interact with the phone through application programs like [[mobile]], [[ccch_scan]], [[osmoload]], and others, depending on the firmware you loaded.
100 1 laforge
101 27 steve-m
102
h2. Command Line Parameters
103
104
<pre>
105 1 laforge
Usage: ./osmocon [ -v | -h ] [ -d [t][r] ] [ -p /dev/ttyXXXX ]
106
                 [ -s /tmp/osmocom_l2 ]
107
                 [ -l /tmp/osmocom_loader ]
108
                 [ -m {c123,c123xor,c140,c140xor,c155,romload,mtk} ]
109
                 [ -c /to-be-chainloaded-file.bin ]
110
                 [ -i beacon-interval (mS) ]
111
                  file.bin
112 27 steve-m
</code></pre>
113 1 laforge
114 27 steve-m
115
<pre>
116
117 1 laforge
Show the version of the program
118
119 27 steve-m
120
<pre>
121
122 15 laforge
Get a short help message
123
124
125 27 steve-m
<pre>
126
127
<pre>
128
129
130
<pre>
131
132 15 laforge
Specify the Serial Port to which your phone is connected, e.g. /dev/ttyUSB0 for the first USB-Serial converter in your system
133
134 27 steve-m
135
<pre>
136
137 15 laforge
Specify the file system path for the unix domain socket to be used for L1CTL
138
139 17 laforge
140 27 steve-m
<pre>
141
142
Specify the file system path for the unix domain socket to be used for interaction with [[osmoload]]
143
144
145
<pre>
146
147 15 laforge
Specify the beacon interval. On some devices default value should be adjusted in order for loading to work (for example Neo Freerunner works wit -i 13)
148
149 27 steve-m
150
<pre>
151
152 1 laforge
Select the protocol to be used for interaction with the phone:
153 27 steve-m
<pre>
154
<pre>
155
<pre>
156
<pre>
157
<pre>
158
<pre>
159
<pre>
160 1 laforge
161
162 27 steve-m
h2. Known Problems
163
164
165
<pre>
Add picture from clipboard (Maximum size: 48.8 MB)