FreeCalypso > hg > freecalypso-tools
comparison doc/High-speed-serial @ 1008:2b4c3e0f73fc
doc/High-speed-serial: update for current situation
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 10 Dec 2023 23:42:12 +0000 |
parents | 9edb7c07bb29 |
children |
comparison
equal
deleted
inserted
replaced
1007:85ea82ce21d5 | 1008:2b4c3e0f73fc |
---|---|
3 standard frequency in the GSM world), these UARTs can produce non-standard | 3 standard frequency in the GSM world), these UARTs can produce non-standard |
4 (outside of the GSM world) baud rates of 203125, 406250 and 812500 bps. Even | 4 (outside of the GSM world) baud rates of 203125, 406250 and 812500 bps. Even |
5 though these high baud rates aren't supported by "standard" RS-232 serial ports | 5 though these high baud rates aren't supported by "standard" RS-232 serial ports |
6 on PCs, they *are* supported by some of the better USB to serial adapters, | 6 on PCs, they *are* supported by some of the better USB to serial adapters, |
7 namely CP2102 (USB to single UART) and the FT2232x family (USB to two UARTs). | 7 namely CP2102 (USB to single UART) and the FT2232x family (USB to two UARTs). |
8 The Pirelli DP-L10 phone supported by FreeCalypso host tools has a CP2102 built | 8 Both FTDI and CP2102 USB-serial adapters are officially endorsed in FreeCalypso |
9 in, the officially recommended 2.5 mm headset jack USB-serial cables for working | 9 queendom: |
10 with Motorola C1xx and Openmoko GTA01/02 phones also use CP2102 adapters, | 10 |
11 whereas our FreeCalypso development boards (FCDEV3B) are typically used with an | 11 * FreeCalypso DUART28 adapter (USB to dual UART at 2.8V, electrically optimized |
12 FT2232D or other FT2232x USB to dual UART adapter. | 12 for direct connection to Calypso UARTs) is based on FT2232D; |
13 | |
14 * For working with older Calypso devboards such as TI D-Sample and iWOW DSK | |
15 (two RS-232 UARTs), FTDI board USB-COM232-PLUS2 (based on FT2232H) is | |
16 officially recommended; | |
17 | |
18 * Future FreeCalypso development boards will likely include a built-in FT2232H | |
19 subsystem; | |
20 | |
21 * For working with Motorola C1xx and Openmoko GTA01/02 phones (Calypso UART | |
22 access via 2.5 mm headset jack), the cable we officially recommend is based | |
23 on CP2102; | |
24 | |
25 * Pirelli DP-L10 is a Calypso phone with a built-in CP2102 USB-serial interface, | |
26 supported since the beginning of FreeCalypso project. | |
13 | 27 |
14 FreeCalypso tools can use these high serial baud rates in the following ways: | 28 FreeCalypso tools can use these high serial baud rates in the following ways: |
15 | 29 |
16 * When you use fc-loadtool to dump and program GSM device flash memory | 30 * When you use fc-loadtool to dump and program GSM device flash memory |
17 (flashing firmware images), the transfers get annoyingly slow at 115200 baud | 31 (flashing firmware images), the transfers get annoyingly slow at 115200 baud |
31 with D-Sample-targeting UI (176x220 pix LCD, 16 bits per pixel) send its | 45 with D-Sample-targeting UI (176x220 pix LCD, 16 bits per pixel) send its |
32 virtual LCD raster blits out the serial port. Our rvtdump and rvinterf | 46 virtual LCD raster blits out the serial port. Our rvtdump and rvinterf |
33 utilities support this mode of operation by providing options to select | 47 utilities support this mode of operation by providing options to select |
34 different baud rates. | 48 different baud rates. |
35 | 49 |
36 Recent changes for better FTDI adapter support | 50 FreeCalypso host tools approach to FTDI adapter support |
37 ============================================== | 51 ======================================================= |
38 | 52 |
39 There is one fundamental difference between the way CP2102 adapters support | 53 There is one fundamental difference between the way CP2102 adapters support |
40 non-standard baud rates (like the high GSM baud rates of interest to us) and | 54 non-standard baud rates (like the high GSM baud rates of interest to us) and |
41 the way in which FTDI adapters support them. CP2102 chips have a built-in | 55 the way in which FTDI adapters support them. CP2102 chips have a built-in |
42 EEPROM that contains (among other things) a 32-entry table in which the | 56 EEPROM that contains (among other things) a 32-entry table in which the |
56 original FC host tools implementation required "magic" baud rate remapping | 70 original FC host tools implementation required "magic" baud rate remapping |
57 somewhere below, usually in form of CP2102 EEPROM programming but also possibly | 71 somewhere below, usually in form of CP2102 EEPROM programming but also possibly |
58 by way of a hacky patch to the ftdi_sio driver in the Linux kernel to achieve | 72 by way of a hacky patch to the ftdi_sio driver in the Linux kernel to achieve |
59 the same effect with rarely-needed FTDI adapters. | 73 the same effect with rarely-needed FTDI adapters. |
60 | 74 |
61 The situation has changed with the introduction of our own FreeCalypso | 75 The situation has changed as our project transitioned from hacking on Motorola, |
62 development boards (currently FCDEV3B, possibly others in the future) which | 76 Openmoko and Pirelli phones to proper Calypso GSM MS development boards, |
63 bring out both Calypso UARTs to the user, rather than just one. The most | 77 bringing out both Calypso UARTs rather than just one. The most convenient |
64 convenient serial adapters for working with these dual UARTs are FT2232x (our | 78 serial adapters for working with these dual UARTs are FT2232x, thus we now have |
65 current official adapter is FT2232D), thus we now have a strong need to support | 79 a strong need to support the use of these FTDI adapters, including the use of |
66 the use of these FTDI adapters, including the use of high GSM baud rates, in a | 80 high GSM baud rates, in a manner which does not fight against the mainline |
67 manner which does not fight against the mainline Linux kernel. | 81 Linux kernel. |
68 | 82 |
69 In a radical change from fc-host-tools-r6 and earlier, the present version of | 83 In a radical change from fc-host-tools-r6 and earlier, the present version of |
70 FreeCalypso host tools uses new libserial code that differs from the old code | 84 FreeCalypso host tools uses new libserial code that differs from the old code |
71 as follows: | 85 as follows: |
72 | 86 |
76 port setup; | 90 port setup; |
77 | 91 |
78 * When the user requests 203125, 406250 or 812500 baud, these are the actual | 92 * When the user requests 203125, 406250 or 812500 baud, these are the actual |
79 baud rates requested from the kernel, not 230400/460800/921600 baud. | 93 baud rates requested from the kernel, not 230400/460800/921600 baud. |
80 | 94 |
81 This change is expected to have no adverse effect on the existing CP2102 users, | 95 This change is expected to have no adverse effect on existing CP2102 users, |
82 as the cp210x driver in Linux appears to cope fine with the strange baud rate | 96 as the cp210x driver in Linux appears to cope fine with the strange baud rate |
83 requests from userspace and the correct CP2102 EEPROM baud rate entry still | 97 requests from userspace and the correct CP2102 EEPROM baud rate entry still |
84 gets selected (tested on Slackware 13.37 and Debian 9), but when working with | 98 gets selected (tested on Slackware 13.37, Slackware 14.2 and Debian 9), but |
85 FTDI adapters such as our FT2232D adapter for the FCDEV3B this change makes the | 99 when working with FTDI adapters, this change makes our high GSM baud rates work |
86 high GSM baud rates work without needing the dirty kernel patch which the | 100 without needing the dirty kernel patch which we used in the early part of 2017. |
87 Mother has been using up until now. | |
88 | 101 |
89 Support for other Unix flavors | 102 Support for other Unix flavors |
90 ============================== | 103 ============================== |
91 | 104 |
92 The serial port handling code for all of FC host tools has been factored out | 105 The serial port handling code for all of FC host tools has been factored out |
108 baud rates from the underlying drivers under your OS, and create your own | 121 baud rates from the underlying drivers under your OS, and create your own |
109 version of libserial ported to use that method. | 122 version of libserial ported to use that method. |
110 | 123 |
111 * If you don't need high GSM baud rates or need them only with CP2102 adapters | 124 * If you don't need high GSM baud rates or need them only with CP2102 adapters |
112 which "magically" remap them, you should be able to use libserial-posix. You | 125 which "magically" remap them, you should be able to use libserial-posix. You |
113 can also completely remove the entries for the high GSM baud rates from | 126 can also completely remove the entries for high GSM baud rates from |
114 libserial-posix/baudtab.c if you don't need these high baud rates and your | 127 libserial-posix/baudtab.c if you don't need these high baud rates and your |
115 version of termios does not have B230400/B460800/B921600 baud rate constants. | 128 version of termios does not have B230400/B460800/B921600 baud rate constants. |
116 | 129 |
117 It is assumed that any system on which someone may desire to run our FC host | 130 It is assumed that any system on which someone may desire to run our FC host |
118 tools supports at least 115200 baud. The Mother remembers the days when this | 131 tools supports at least 115200 baud. The Mother remembers the days when this |
123 firmwares including our own use the 115200 baud rate. | 136 firmwares including our own use the 115200 baud rate. |
124 | 137 |
125 Using CP2102 adapters with Mot C1xx and Openmoko phones | 138 Using CP2102 adapters with Mot C1xx and Openmoko phones |
126 ======================================================= | 139 ======================================================= |
127 | 140 |
141 For the special USB-serial cable that connects to the 2.5 mm headset jack on | |
142 these phones, our current official recommendation is this one: | |
143 | |
144 https://shop.sysmocom.de/Sysmocom-USB-serial-cable-CP2102-with-2.5mm-stereo-jack/cp2102-25 | |
145 | |
146 (In the past we also worked with a different vendor, UberWaves, but that vendor | |
147 appears to be no longer active as of 2023-12.) | |
148 | |
128 As already mentioned above, CP2102 chips have a built-in EEPROM that contains | 149 As already mentioned above, CP2102 chips have a built-in EEPROM that contains |
129 (among other things) a 32-entry table in which the supported serial baud rates | 150 (among other things) a 32-entry table in which the supported serial baud rates |
130 are programmed. In order to support the special GSM baud rates, these rates | 151 are programmed. In order to support the special GSM baud rates, these rates |
131 need to be added to that table, displacing some other entries. The convention | 152 need to be added to that table, displacing some other entries. The convention |
132 established by the Pirelli DP-L10 phone (has a CP2102 built in and programmed | 153 established by the Pirelli DP-L10 phone (has a CP2102 built in and programmed |
133 at the factory for GSM baud rates) is that 203120 baud takes the place of | 154 at the factory for GSM baud rates) is that 203120 baud takes the place of |
134 230400, 406250 takes the place of 460800, and 812500 takes the place of 921600. | 155 230400, 406250 takes the place of 460800, and 812500 takes the place of 921600. |
135 | 156 |
136 Because you need a special cable anyway to make the necessary physical | 157 If you are working with CP2102 adapters from any vendor, or headset jack serial |
137 connection to the debug/programming serial port presented on a 2.5 mm headset | 158 cables that incorporate such adapters, you should install this companion tools |
138 jack, you will probably be buying the requisite cable from a specialized | 159 package from FreeCalypso: |
139 professional vendor. In that case it is that vendor's responsibility to sell | |
140 you the cable with the CP2102 chip already programmed with GSM baud rates: | |
141 because the physical construction of the cable (2.5 mm headset jack on the | |
142 serial end) makes it specific to GSM devices, and all known GSM devices use a | |
143 13 MHz clock or some integer multiple thereof, it is pointless for a | |
144 physically-GSM-specific cable to be set up for 230400/460800/921600 baud when | |
145 all known GSM devices will need 203125/406250/812500 baud instead. | |
146 | 160 |
147 If you are making a CP2102-based serial cable yourself (either for your own | 161 https://www.freecalypso.org/pub/GSM/FreeCalypso/fc-usbser-tools-latest.tar.bz2 |
148 personal use or professionally/commercially), please follow these instructions | |
149 for baud rate programming: | |
150 | 162 |
151 http://osmocom.org/projects/baseband/wiki/HardwareCP210xTutorial | 163 Because Sysmocom CP2102-25 adapters have been repurposed for various other uses |
164 "in the Osmocom universe" (literal quote from the vendor's product description | |
165 page) beyond the original purpose of connecting to Mot C1xx and Openmoko | |
166 GTA01/02 phones, the shipping state of the adapter's internal EEPROM cannot be | |
167 depended on: they may ship with the EEPROM programmed for 203125/406250/812500 | |
168 baud or for 230400/460800/921600 baud depending on which year you bought the | |
169 product and other unknown factors. Fortunately though, our cp2102-read-baudtab | |
170 utility (included in fc-usbser-tools package linked above) replaces guesswork | |
171 with clarity: you run this command, and it shows you the current programming of | |
172 the baud rate table in the EEPROM. Programming this EEPROM to the desired | |
173 configuration is then as simple as: | |
152 | 174 |
153 If you follow the procedure given on that page, your CP2102 will be programmed | 175 cp2102-update-eeprom -b gsm # program EEPROM for high GSM baud rates |
154 the same way as the one in the Pirelli DP-L10 (Foxconn's original factory | 176 |
155 programming). | 177 or |
178 | |
179 cp2102-update-eeprom -b std # program EEPROM for "standard" baud rates | |
156 | 180 |
157 Using adapters built into phones | 181 Using adapters built into phones |
158 ================================ | 182 ================================ |
159 | 183 |
160 The Calypso chip has no native USB capabilities, thus if a Calypso phone | 184 The Calypso chip has no native USB capabilities, thus if a Calypso phone |