Osmocon » History » Version 18
Anonymous, 02/19/2016 10:49 PM
There is no layer23 app anymore, e.g. mobile or bcch_scan can be used, putting both as the label makes graphviz draw a huge circle...
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 | 12 | steve-m | Supported Bootloaders are currently the [wiki:CompalRamloader] and the [wiki: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 | 15 | laforge | * /tmp/osmocom_l2 for the [wiki:L1A_L23_Interface] as used by [wiki:mobile], [wiki:layer23] 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 | 14 | laforge | } |
32 | }}} |
||
33 | 1 | laforge | |
34 | 9 | laforge | == General Usage == |
35 | 1 | laforge | |
36 | 18 | 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) |
37 | 15 | laforge | * Determine what host program you want to run (see [wiki:Applications]) |
38 | 9 | laforge | * Start the console like this, filling in your phone type and binary path: |
39 | 1 | laforge | {{{ |
40 | 13 | laforge | $ ./osmocon -p /dev/ttyUSB0 -m c123xor ../../target/firmware/board/compal_e88/loader.compalram.bin |
41 | 1 | laforge | }}} |
42 | 16 | tsaitgaist | * 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. |
43 | 9 | laforge | * Observe output resembling the following |
44 | 1 | laforge | {{{ |
45 | 9 | laforge | got 2 bytes from modem, data looks like: 2f c8 |
46 | got 5 bytes from modem, data looks like: 1b f6 02 00 41 |
||
47 | 1 | laforge | got 1 bytes from modem, data looks like: 01 |
48 | got 1 bytes from modem, data looks like: 40 |
||
49 | Received PROMPT1 from phone, responding with CMD |
||
50 | 13 | laforge | read_file(../../target/firmware/board/compal_e88/loader.compalram.bin): file_size=13404, hdr_len=4, dnload_len=13411 |
51 | 1 | laforge | got 1 bytes from modem, data looks like: 1b |
52 | got 1 bytes from modem, data looks like: f6 |
||
53 | got 1 bytes from modem, data looks like: 02 |
||
54 | got 1 bytes from modem, data looks like: 00 |
||
55 | got 1 bytes from modem, data looks like: 41 |
||
56 | got 1 bytes from modem, data looks like: 02 |
||
57 | got 1 bytes from modem, data looks like: 43 |
||
58 | Received PROMPT2 from phone, starting download |
||
59 | 9 | laforge | handle_write(): 1023 bytes (1023/13411) |
60 | handle_write(): 768 bytes (1791/13411) |
||
61 | handle_write(): 768 bytes (2559/13411) |
||
62 | handle_write(): 768 bytes (3327/13411) |
||
63 | handle_write(): 768 bytes (4095/13411) |
||
64 | handle_write(): 768 bytes (4863/13411) |
||
65 | handle_write(): 768 bytes (5631/13411) |
||
66 | handle_write(): 768 bytes (6399/13411) |
||
67 | handle_write(): 768 bytes (7167/13411) |
||
68 | handle_write(): 768 bytes (7935/13411) |
||
69 | handle_write(): 768 bytes (8703/13411) |
||
70 | handle_write(): 768 bytes (9471/13411) |
||
71 | handle_write(): 768 bytes (10239/13411) |
||
72 | handle_write(): 768 bytes (11007/13411) |
||
73 | handle_write(): 768 bytes (11775/13411) |
||
74 | handle_write(): 768 bytes (12543/13411) |
||
75 | handle_write(): 768 bytes (13311/13411) |
||
76 | handle_write(): 100 bytes (13411/13411) |
||
77 | handle_write(): finished |
||
78 | 1 | laforge | got 1 bytes from modem, data looks like: 1b |
79 | got 1 bytes from modem, data looks like: f6 |
||
80 | got 1 bytes from modem, data looks like: 02 |
||
81 | got 1 bytes from modem, data looks like: 00 |
||
82 | got 1 bytes from modem, data looks like: 41 |
||
83 | got 1 bytes from modem, data looks like: 03 |
||
84 | got 1 bytes from modem, data looks like: 42 |
||
85 | Received DOWNLOAD ACK from phone, your code is running now! |
||
86 | |||
87 | |||
88 | OSMOCOM Calypso loader (revision f45c5ee-modified) |
||
89 | ====================================================================== |
||
90 | Running on compal_e88 in environment ramload |
||
91 | |||
92 | }}} |
||
93 | 15 | laforge | * You can now interact with the phone through application programs like [wiki:mobile], [wiki:layer23], [wiki:osmoload], and others, depending on the firmware you loaded. |
94 | 1 | laforge | |
95 | 15 | laforge | == Command Line Parameters == |
96 | {{{ |
||
97 | Usage: ./osmocon [ -v | -h ] [ -d [t][r] ] [ -p /dev/ttyXXXX ] |
||
98 | [ -s /tmp/osmocom_l2 ] |
||
99 | [ -l /tmp/osmocom_loader ] |
||
100 | [ -m {c123,c123xor,c140,c140xor,c155,romload,mtk} ] |
||
101 | [ -c /to-be-chainloaded-file.bin ] |
||
102 | [ -i beacon-interval (mS) ] |
||
103 | file.bin |
||
104 | }}} |
||
105 | |||
106 | === {{{-v}}} Version === |
||
107 | Show the version of the program |
||
108 | |||
109 | === {{{-h}}} Help === |
||
110 | Get a short help message |
||
111 | |||
112 | === {{{-d [t][r]}}} Debug flags === |
||
113 | Enable debug output of transmitted {{{t}}} and/or received {{{r}}} serial data |
||
114 | |||
115 | === {{{-p /dev/ttyXXXX}}} Serial Device === |
||
116 | Specify the Serial Port to which your phone is connected, e.g. /dev/ttyUSB0 for the first USB-Serial converter in your system |
||
117 | |||
118 | === {{{-s /path/to/socket}}} Path of L1CTL socket === |
||
119 | Specify the file system path for the unix domain socket to be used for L1CTL |
||
120 | |||
121 | === {{{-l /path/to/socket}}} Path to Loader socket === |
||
122 | Specify the file system path for the unix domain socket to be used for interaction with [wiki:osmoload] |
||
123 | |||
124 | 17 | laforge | === {{{-i time}}} beacon interval, in milliseconds === |
125 | 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) |
||
126 | |||
127 | 15 | laforge | === {{{-m {c123,c123xor,c140,c140xor,c155,romload,mtk} }}} Download protocol mode === |
128 | Select the protocol to be used for interaction with the phone: |
||
129 | * {{{c123}}} use the variant implemented by C118/C121/C123 |
||
130 | * {{{c123xor}}} use the variant implemented by C118/C121/C123 including XOR checksum |
||
131 | * {{{c140}}} use the variant implemented by C139/C140 |
||
132 | * {{{c140xor}}} use the variant implemented by C139/C140 including XOR checksum |
||
133 | * {{{c155}}} use the variant implemented by C155 |
||
134 | * {{{romlaod}}} use the variant implemented by the Ti Calypso rom-loader (aka {{{fluid}}}) |
||
135 | * {{{mtk}}} use the protocol used by Mediatek DBB |
||
136 | 1 | laforge | |
137 | == Known Problems == |
||
138 | 4 | roh | |
139 | 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}}}. |