Project

General

Profile

Osmocon » History » Version 23

Anonymous, 02/19/2016 10:49 PM
The layer23 application is now called ccch_scan.

1 2 laforge
[[PageOutline]]
2 15 laforge
= {{{osmocon}}} =
3 1 laforge
4 15 laforge
{{{osmocon}}} is a console tool for interfacing our baseband firmware on the phone with applications on the host PC.
5 8 laforge
6 15 laforge
It is also used to download a firmware or bootloader into the phone over the serial line, which is currently implemented for the [http://bb.osmocom.org/trac/wiki/MotorolaC123 CompalE88 (C118/C120/C121/C123)], the [http://bb.osmocom.org/trac/wiki/MotorolaC155 CompalE99 (C155)].[[BR]]
7
8 21 laforge
Supported Bootloaders are currently the [wiki:CompalRamloader] and the [wiki:Hardware/CalypsoRomloader].
9 1 laforge
10 15 laforge
After uploading a firmware, it turns into an HDLC mulitplexer/demultiplexer, allowing for multichannel communication with the device.
11 8 laforge
12 15 laforge
The phones console is on one such channel and will be redirected to the terminal (stdout) on which osmocom runs.
13 8 laforge
14
Several other HDLC channels are accessible by means of the following unix domain sockets:
15 23 laforge
 * /tmp/osmocom_l2 for the [wiki:L1A_L23_Interface] as used by [wiki:mobile], [wiki:ccch_scan] and other host programs
16 8 laforge
 * /tmp/osmocon_loader for the [wiki:Bootloader]
17
18 14 laforge
{{{
19
#!graphviz
20
digraph G {
21
  graph [rankdir = LR];
22
  Phone -> SerialPort [ label = "RS232" dir=both ];
23
  SerialPort -> osmocon [ label = "/dev/ttyUSB*" dir=both ];
24
  layer23 -> osmocon [label = "unix socket" dir=both ];
25
  osmoload -> osmocon [label = "unix socket" dir=both ];
26
  firmware -> osmocon [label = "file read" ];
27
  osmocon -> terminal [label = "stdout" ];
28
  osmocon [ shape = doublecircle ];
29 18 laforge
  layer23 [ shape = circle label = "mobile"];
30
  osmoload [ shape = circle];
31 19 laforge
  { rank = same; terminal layer23 osmoload firmware }
32 14 laforge
}
33
}}}
34 1 laforge
35 9 laforge
== General Usage ==
36 1 laforge
37 20 laforge
 * '''Connect your phone''' UART to a serial port of your PC, using a [wiki:Hardware/SerialCable] (3.3V RS232 on 2.5mm headphone jack)
38
 * '''Choose firmware''' you have to load, depending on a host program you want to run (see [wiki:Applications])
39 22 laforge
 * '''Load firmware''' to the phone, running osmocon like below. Fill in phone type and firmware name with your values. See [wiki:Hardware/Phones] if you need to look up the phone type.
40 1 laforge
{{{
41 20 laforge
$ ./osmocon -p /dev/ttyUSB0 -m c123xor ../../target/firmware/board/PHONE_TYPE/FIRMWARE.compalram.bin
42 1 laforge
}}}
43 22 laforge
 * 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.
44 9 laforge
 * Observe output resembling the following
45 1 laforge
{{{
46 9 laforge
got 2 bytes from modem, data looks like: 2f c8 
47
got 5 bytes from modem, data looks like: 1b f6 02 00 41 
48 1 laforge
got 1 bytes from modem, data looks like: 01 
49
got 1 bytes from modem, data looks like: 40 
50
Received PROMPT1 from phone, responding with CMD
51 13 laforge
read_file(../../target/firmware/board/compal_e88/loader.compalram.bin): file_size=13404, hdr_len=4, dnload_len=13411
52 1 laforge
got 1 bytes from modem, data looks like: 1b 
53
got 1 bytes from modem, data looks like: f6 
54
got 1 bytes from modem, data looks like: 02 
55
got 1 bytes from modem, data looks like: 00 
56
got 1 bytes from modem, data looks like: 41 
57
got 1 bytes from modem, data looks like: 02 
58
got 1 bytes from modem, data looks like: 43 
59
Received PROMPT2 from phone, starting download
60 9 laforge
handle_write(): 1023 bytes (1023/13411)
61
handle_write(): 768 bytes (1791/13411)
62
handle_write(): 768 bytes (2559/13411)
63
handle_write(): 768 bytes (3327/13411)
64
handle_write(): 768 bytes (4095/13411)
65
handle_write(): 768 bytes (4863/13411)
66
handle_write(): 768 bytes (5631/13411)
67
handle_write(): 768 bytes (6399/13411)
68
handle_write(): 768 bytes (7167/13411)
69
handle_write(): 768 bytes (7935/13411)
70
handle_write(): 768 bytes (8703/13411)
71
handle_write(): 768 bytes (9471/13411)
72
handle_write(): 768 bytes (10239/13411)
73
handle_write(): 768 bytes (11007/13411)
74
handle_write(): 768 bytes (11775/13411)
75
handle_write(): 768 bytes (12543/13411)
76
handle_write(): 768 bytes (13311/13411)
77
handle_write(): 100 bytes (13411/13411)
78
handle_write(): finished
79 1 laforge
got 1 bytes from modem, data looks like: 1b 
80
got 1 bytes from modem, data looks like: f6 
81
got 1 bytes from modem, data looks like: 02 
82
got 1 bytes from modem, data looks like: 00 
83
got 1 bytes from modem, data looks like: 41 
84
got 1 bytes from modem, data looks like: 03 
85
got 1 bytes from modem, data looks like: 42 
86
Received DOWNLOAD ACK from phone, your code is running now!
87
88
89
OSMOCOM Calypso loader (revision f45c5ee-modified)
90
======================================================================
91
Running on compal_e88 in environment ramload
92
93
}}}
94 23 laforge
 * You can now interact with the phone through application programs like [wiki:mobile], [wiki:ccch_scan], [wiki:osmoload], and others, depending on the firmware you loaded.
95 1 laforge
96 15 laforge
== Command Line Parameters ==
97
{{{
98
Usage: ./osmocon [ -v | -h ] [ -d [t][r] ] [ -p /dev/ttyXXXX ]
99
                 [ -s /tmp/osmocom_l2 ]
100
                 [ -l /tmp/osmocom_loader ]
101
                 [ -m {c123,c123xor,c140,c140xor,c155,romload,mtk} ]
102
                 [ -c /to-be-chainloaded-file.bin ]
103
                 [ -i beacon-interval (mS) ]
104
                  file.bin
105
}}}
106
107
=== {{{-v}}} Version ===
108
Show the version of the program
109
110
=== {{{-h}}} Help ===
111
Get a short help message
112
113
=== {{{-d [t][r]}}} Debug flags ===
114
Enable debug output of transmitted {{{t}}} and/or received {{{r}}} serial data
115
116
=== {{{-p /dev/ttyXXXX}}} Serial Device ===
117
Specify the Serial Port to which your phone is connected, e.g. /dev/ttyUSB0 for the first USB-Serial converter in your system
118
119
=== {{{-s /path/to/socket}}} Path of L1CTL socket ===
120
Specify the file system path for the unix domain socket to be used for L1CTL
121
122
=== {{{-l /path/to/socket}}} Path to Loader socket ===
123
Specify the file system path for the unix domain socket to be used for interaction with [wiki:osmoload]
124
125 17 laforge
=== {{{-i time}}} beacon interval, in milliseconds ===
126
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)
127
128 15 laforge
=== {{{-m {c123,c123xor,c140,c140xor,c155,romload,mtk} }}} Download protocol mode ===
129
Select the protocol to be used for interaction with the phone:
130
 * {{{c123}}} use the variant implemented by C118/C121/C123
131
 * {{{c123xor}}} use the variant implemented by C118/C121/C123 including XOR checksum
132
 * {{{c140}}} use the variant implemented by C139/C140
133
 * {{{c140xor}}} use the variant implemented by C139/C140 including XOR checksum
134
 * {{{c155}}} use the variant implemented by C155
135
 * {{{romlaod}}} use the variant implemented by the Ti Calypso rom-loader (aka {{{fluid}}})
136
 * {{{mtk}}} use the protocol used by Mediatek DBB
137 1 laforge
138
== Known Problems ==
139 4 roh
140 9 laforge
In some situations (like, apparently, using FTDI serial cables), you might need the {{{-m c123}}} mode for your [wiki:MotorolaC123] instead of the normal {{{-m c123xor}}}.
Add picture from clipboard (Maximum size: 48.8 MB)