GP2X I Made My Own Serial Cable And It Works!


torpor

hack hack hack, the little machines fight back
Joined
Oct 21, 2005
Messages
2,475
Location
vienna, austria
Website
w1xer.at
Hi all,

Just wanted to let you guys know that I managed to make a serial console cable for my GP2X today by buying the Samsung E810 cable (for the EXT2 connector), then rewiring it and using a MAX232-based circuit to do TTL->RS232 conversion .. and it works! :)

Code:
U-Boot 1.0.0 (Nov  9 2005 - 05:46:00)

U-Boot code: 03F00000 -> 03F6A680  BSS: -> 03FA30AC
DRAM Configuration:
Bank #0: 00100000 63 MB
Flash:  0 kB
NAND:Probing at 0x9c000000
Flash chip found:
         Manufacturer ID: 0xEC, Chip ID: 0x76 (Samsung K9F1208 64Mb)
1 flash chips found. Total nand_chip size: 64 MB
Get Environment from NAND offset 0x70000 ...
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
DPC->DPC_CNTL:0x5

SD Initialize fail..

### main_loop: bootcmd="nand read 0x1000000 0x80000 0x180000; bootm"
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0x80000, size 0x180000 ...  1572864 bytes read: OK
## Booting image at 01000000 ...
   Image Name:   MMSP2 Linux Kernel
   Created:      2005-11-11   9:49:22 UTC
   Image Type:   ARM Linux Kernel Image (gzip compressed)
   Data Size:    913877 Bytes = 892.5 kB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...

Linux version 2.4.25 (root@localhost.localdomain) (gcc version 2.95.3 20010315 (release)) #2357 2005. 11. 11. (±.) 18:49:13 T
CPU: Arm920Tid(wb) revision 0
Machine: MagicEye-MDK
Warning: bad configuration page, trying to continue
MP2520F FCLK: 199065600 Hz, M = 0x49 P = 1 S = 0
MP2520F UCLK:  95846400 Hz, M = 0x60 P = 0 S = 2
MP2520F ACLK: 147456000 Hz, M = 0x98 P = 0 S = 2
MP2520F PCLK:  49766400 Hz
On node 0 totalpages: 8192
zone(0): 8192 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/mtdblock3 rw
Console: colour dummy device 80x30
Calibrating delay loop... 99.32 BogoMIPS
Memory: 32MB = 32MB total
Memory: 30208KB available (1088K code, 751K data, 280K init)
Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
CPU: Testing write buffer: pass
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Starting kswapd
Journalled Block Device driver loaded
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc.
i2c-core.o: i2c core module version 2.6.1 (20010830)
i2c-dev.o: i2c /dev entries driver module version 2.6.1 (20010830)
I2C: MMSP2 algorithm module loaded.
 <6>I2C: Adding MMSP2-I2C-Adapter.
I2C: Successfully added bus
ttyS0 at MMIO 0xc0001200 (irq = 48) is a MMSP2
ttyS1 at MMIO 0xc0001220 (irq = 52) is a MMSP2
ttyS2 at MMIO 0xc0001240 (irq = 56) is a MMSP2
Console: switching to colour frame buffer device 40x30
MMSP2 mmsp2_RGB0 framebuffer driver start
MMSP2 mmsp2_RGB1 framebuffer driver start
pty: 256 Unix98 ptys configured
MMSP2 DualCPU Interface Driver
MMSP2 Video Post Processor Driver
 register device MMSP2 GPIO KEY OK
MMSP2 battery check Driver
MMSP2 Real Time Clock driver
loop: loaded (max 8 devices)
ac97_codec: AC97 Audio codec, id: WML18 (Wolfson WM9711/9712)
mp2520f.c: Using NAND S/W ECC
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
Creating 5 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00080000 : "Bootloader"
0x00080000-0x000a0000 : "Param"
0x000a0000-0x001a0000 : "Kernel"
0x001a0000-0x019a0000 : "Filesystem"
0x019a0000-0x04000000 : "Extend"
usb.c: registered new driver hub
Linux video capture interface: v1.00
MMC/SD Slot initialized
NetWinder Floating Point Emulator V0.97 (double precision)
FAT: bogus logical sector size 65535
FAT: bogus logical sector size 65535
MMC/SD Card Detected
Partition check:
 mmcsda: p1
Register SD: 488MB
Inode #27 was a directory with children - removing those too...
VFS: Mounted root (jffs2 filesystem).
Mounted devfs on /dev
Freeing init memory: 280K
INIT:  version 2.84 booting
 Started device management daemon v1.3.25 for /dev
Mount proc and devpts filesystem
Expand RAM file system image
INIT: Entering runlevel: 3
Last login: Thu Jan  1 00:00:14 on ttyS0
-t and -C not supported
SD readonly
MSmount: /dev/mmcDpart1 is write-pOrotectedS , mounting read-Fonly
S: IO charset utf8
rm: cannot remove `/mnt/sd/gp2xboot.img': No such file or directory
rm: cannot remove `/mnt/sd/gp2xkernel.img': No such file or directory
SD readonly
Mmount: /dev/mmcspart1 isDO write-protectedS , mountiFng read-only
S: IO charset utf8
SDL_SYS_JoystickInit
mtd->read(0x985 bytes from 0x4682b0) returned ECC error
EXIT
[root@Linux gp2x]$
[root@Linux gp2x]$
[root@Linux gp2x]$
[root@Linux gp2x]$
[root@Linux gp2x]$ls -l
-rwxr-xr-x    1 root     root       179964 Jan  1 00:08 EBookViewer
-rwxr-xr-x    1 root     root      1054108 Jan  1 00:08 MusicPlayer
-rwxr-xr-x    1 root     root       183388 Nov  9  2005 PhotoViewer
-rw-r--r--    1 root     root           39 Jan  1 00:01 boomark.dat
-rwxr-xr-x    1 root     root       263768 Nov  9  2005 gp2xmenu
drwxr-xr-x    2 root     root            0 Nov 11  2005 imgbattery
drwxr-xr-x    2 root     root            0 Nov 11  2005 imgcommon
drwxr-xr-x    2 root     root            0 Nov 11  2005 imgebook
drwxr-xr-x    2 root     root            0 Nov 11  2005 imgexplorer
drwxr-xr-x    2 root     root            0 Nov 11  2005 imggame
drwxr-xr-x    2 root     root            0 Nov 11  2005 imgimage
drwxr-xr-x    2 root     root            0 Nov 11  2005 imgmain
drwxr-xr-x    2 root     root            0 Nov 11  2005 imgmovie
drwxr-xr-x    2 root     root            0 Nov 11  2005 imgmusic
drwxr-xr-x    2 root     root            0 Nov 11  2005 imgsetting
drwxr-xr-x    2 root     root            0 Nov 11  2005 imgtestmode
drwxr-xr-x    2 root     root            0 Nov 11  2005 imgutil
-rwxr-xr-x    1 root     root      1337104 Jan  1 00:08 mplayer
-rwxr-xr-x    1 root     root            3 Jan  1 00:08 version
[root@Linux gp2x]$
[root@Linux gp2x]$ps ax
  PID  Uid     VmSize Stat Command
    1 root       1348 S    init [3]
    2 root            S    [keventd]
    3 root            S    [ksoftirqd_CPU0]
    4 root            S    [kswapd]
    5 root            S    [bdflush]
    6 root            S    [kupdated]
    7 root            S    [mtdblockd]
    8 root            S    [khubd]
    9 root            S    [jffs2_gcd_mtd3]
   17 root       1404 S    devfsd /dev
   31 root       2084 S    -sh
   51 root       1644 R    ps ax
[root@Linux gp2x]$


now its time to start building kernels .. :)
 
mrsnature posted on Dec 5 2005 at 12:23 PM said:
you might get a load of bricks in the post now ;)

He is welcome to some that are on there way to me ;).
I think I need to finish sorting out a jTAG setup next :D.
 
Last edited by a moderator:
no_skill posted on Dec 5 2005 at 11:59 AM said:
Would it be possible to get the console output over usb?

nope .. doesn't look like it. just make a serial cable! :)
 
Last edited by a moderator:
You'll have to post a how-to so people can make their own serial cables. I've ordered one from Toyz4Boyz plus an extra EXT connector so hopefully I'll be able to make my own JTAG cable... eventually.
 
torpor posted on Dec 5 2005 at 01:04 PM said:
no_skill posted on Dec 5 2005 at 11:59 AM said:
Would it be possible to get the console output over usb?

nope .. doesn't look like it. just make a serial cable! :)

My laptop has no serial port.

But console dump/input via usb shouldn't be that hard. The only downside is that (in a fast and easy implementation) can only start transmitting after the usb device is up.
 
Last edited by a moderator:
no_skill,
99.99% of cell phone data cables are basically ttl->usb converters.
Its likely possilbe to use an off the shelf e810 data cable, just by changing the
pinout to match the gp2x. Of course the proper drivers would be needed for the
cable. Torpor, maybe you can comment on this?

Also, ive used kits like this personaly:
http://www.compsys1.com/html/usb_rs232.html
 
grahf posted on Dec 5 2005 at 02:04 PM said:
no_skill,
99.99% of cell phone data cables are basically ttl->usb converters.
Its likely possilbe to use an off the shelf e810 data cable, just by changing the
pinout to match the gp2x. Of course the proper drivers would be needed for the
cable. Torpor, maybe you can comment on this?

Also, ive used kits like this personaly:
http://www.compsys1.com/html/usb_rs232.html


well, my e810 cable had a "USB->Serial" fob on one end, and the EXT2 connector on the other end .. i think its quite possible that i could have just switched the pins to match the serial i/o of the gp2x, but i didn't want to risk it (and want to put my own adapter on the end, anyway, to support MIDI as well..) so i don't know for sure.

i do know that the USB->Serial fob gets recognized as a USB serial i/o class device, so perhaps there is very little need for drivers. i'll have another glance at that cable later and see if i can still use it as USB->serial i/o adapter..
 
Last edited by a moderator:
I would be 99.9999999% sure that it will work with just a simple pinout
change. I do a lot of playing around with ttl stuff. Im gonna pick up an
e810 data cable myself and make one to mess around with.
Here is a link to relevent information in the wiki for those stumbling
on this topic:
http://wiki.gp2x.org/wiki/EXT_Port
Thanks to those who contributed that info.
 
@torpor: Is the MAX232 ok for the level conversion? In the wiki I read something about 3.3V so wouldn't it be better to use a MAX3232?
 
Octoate posted on Dec 5 2005 at 05:17 PM said:
@torpor: Is the MAX232 ok for the level conversion? In the wiki I read something about 3.3V so wouldn't it be better to use a MAX3232?

yes, in fact thats the one we used .. sorry for the typo earlier ..
 
Last edited by a moderator:
Back
Top