hcf
Still Fresh
Note: There is a new version of this package. DO NOT use the old package's "USBSerialDown.gpe" script, it will require reflashing your firmware to recover from. Please see the bottom of this message for the ugprade details.
There is a fine guide on this board that details how to make a USB Serial console cable for the GP2X Wiz by cannibalizing two other cables. It costs money, it takes time, and that makes it a barrier for some people to really get in and start enjoying hacking with their Wiz. It's really quite clever tho because it can expose the host-side controller hidden inside the Wiz, so you can hook up a keyboard or mouse or joystick or even a USB Serial dongle to connect to your PC (so you can hack on the Wiz while your program is running).
But I had to wonder: If the Wiz can pretend to be a block device USB client, why can't it pretend to be a serial converter?
It turns out there is a USB Serial client ("gadget" in linux kernel parlance) in the Linux-2.6.24 source tree. So I compiled it so you don't have to, then mucked about with Wiz'ness to get it to work without having to fuss with Termula.
Step 1: Fetch my USBSerial software minipack:
http://www.mercenary.net/OpenWiz/USBSerial-1.1.0p1.tar.bz2
Step 2: Untar this package onto an SD card.
Step 3: Unmount the SD card safely and use the Wiz's built-in 'Launcher to run "USBSerial/USBSerialUp.gpe".
Step 4: Connect your Wiz to the host computer (make sure it has a comfy keyboard) with the USB cable that came with your wiz.
IMPORTANT: Do not modify your Wiz USB cable in any way. Put the soldering iron down.
By this time you should see the following in your dmesg on the host system (presuming you are using Linux):
Step 5: In order to present the USB dongle to your host operating system, you need to load the 'usbserial' module, with flags to identify its (default g_serial.ko) idVendor and idProduct values:
By this time you should see the following in your dmesg:
Step 6: You may now use the ttyUSB0 interface (or whatever was actually assigned) with any serial management application of your liking - minicom, rtty...I like kermit, so I'll use quotes from my shell history as an example:
And now you're done. Or you've just begun?
Baud speeds aren't important (and you may get errors trying to set them). I haven't tested to see how fast it actually runs, been having too much fun poking at things without having to suffer Termula2x hunt and pecking.
When you are done, you only have to restart your Wiz to clean up. Note that while the serial gadget is installed, it seems to interfere with the menu's USB block device mounting...nothing bad happens if you try to let it mount the NAND or SD from the menu system, but it seems to quietly fail to work. I haven't looked closely at this issue, and it hasn't bothered me particularly. Just FYI (but it may be a good argument for continuing work on the g_ether gadget, as g_ether would likely have the same limitation but would allow network rcp/scp/ftp access to the SD/NAND).
UPGRADING from USBSerial-1.1.0:
Under no circumstances should you run the USBSerialDown.gpe script.
First, delete the USBSerial directory on your SD. Install the new USBSerial directory using the sources above. Run the USBSerialUP.gpe script from the launcher and follow the instructions normally.
Once you've got a comfortable serial shell again, use vi to edit /etc/inittab and remove the line(s) starting with "G0", they should be at the bottom of the file. Once you've saved that change to inittab, "kill -HUP 1", this asks init to re-read inittab. Next, rm /usr/bin/loginpass.sh, which is installed by the old software.
That's it. From now on, to uninstall the new serial software simply restart the Wiz.
Edit 1: New version update.
Edit 2: s/SDRAM/SD card/ (correcting finger macro)
There is a fine guide on this board that details how to make a USB Serial console cable for the GP2X Wiz by cannibalizing two other cables. It costs money, it takes time, and that makes it a barrier for some people to really get in and start enjoying hacking with their Wiz. It's really quite clever tho because it can expose the host-side controller hidden inside the Wiz, so you can hook up a keyboard or mouse or joystick or even a USB Serial dongle to connect to your PC (so you can hack on the Wiz while your program is running).
But I had to wonder: If the Wiz can pretend to be a block device USB client, why can't it pretend to be a serial converter?
It turns out there is a USB Serial client ("gadget" in linux kernel parlance) in the Linux-2.6.24 source tree. So I compiled it so you don't have to, then mucked about with Wiz'ness to get it to work without having to fuss with Termula.
Step 1: Fetch my USBSerial software minipack:
http://www.mercenary.net/OpenWiz/USBSerial-1.1.0p1.tar.bz2
Step 2: Untar this package onto an SD card.
Code:
cd /media/disk # (or wherever)
tar xjf ~/Desktop/USBSerial-1.1.0.tar.bz2 # (or wherever)
Step 3: Unmount the SD card safely and use the Wiz's built-in 'Launcher to run "USBSerial/USBSerialUp.gpe".
Step 4: Connect your Wiz to the host computer (make sure it has a comfy keyboard) with the USB cable that came with your wiz.
IMPORTANT: Do not modify your Wiz USB cable in any way. Put the soldering iron down.
By this time you should see the following in your dmesg on the host system (presuming you are using Linux):
Code:
usb X-Y: new high speed USB device using ehci_hcd and address 49
usb X-Y: configuration #1 chosen from 1 choice
usb X-Y: New USB device found, idVendor=0525, idProduct=a4a6
usb X-Y: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb X-Y: Product: OpenGP2X Wiz Serial Shell Access
usb X-Y: Manufacturer: Linux 2.6.24 with lf1000_udc
usb X-Y: SerialNumber: 0
Step 5: In order to present the USB dongle to your host operating system, you need to load the 'usbserial' module, with flags to identify its (default g_serial.ko) idVendor and idProduct values:
Code:
modprobe usbserial vendor=0x0525 product=0xA4A6
By this time you should see the following in your dmesg:
Code:
usb X-Y: generic converter now attached to ttyUSB0
Step 6: You may now use the ttyUSB0 interface (or whatever was actually assigned) with any serial management application of your liking - minicom, rtty...I like kermit, so I'll use quotes from my shell history as an example:
Code:
# kermit
(...) C-Kermit>set line /dev/ttyUSB0
(...) C-Kermit>connect
Connecting to /dev/ttyUSB0, speed 9600
Escape character: Ctrl-\ (ASCII 28, FS): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.
----------------------------------------------------
Welcome to the AESOP S3C2440A world !!!(0.1)
You may now login as 'root'.
wiz login: root
/dev #
And now you're done. Or you've just begun?
Baud speeds aren't important (and you may get errors trying to set them). I haven't tested to see how fast it actually runs, been having too much fun poking at things without having to suffer Termula2x hunt and pecking.
When you are done, you only have to restart your Wiz to clean up. Note that while the serial gadget is installed, it seems to interfere with the menu's USB block device mounting...nothing bad happens if you try to let it mount the NAND or SD from the menu system, but it seems to quietly fail to work. I haven't looked closely at this issue, and it hasn't bothered me particularly. Just FYI (but it may be a good argument for continuing work on the g_ether gadget, as g_ether would likely have the same limitation but would allow network rcp/scp/ftp access to the SD/NAND).
UPGRADING from USBSerial-1.1.0:
Under no circumstances should you run the USBSerialDown.gpe script.
First, delete the USBSerial directory on your SD. Install the new USBSerial directory using the sources above. Run the USBSerialUP.gpe script from the launcher and follow the instructions normally.
Once you've got a comfortable serial shell again, use vi to edit /etc/inittab and remove the line(s) starting with "G0", they should be at the bottom of the file. Once you've saved that change to inittab, "kill -HUP 1", this asks init to re-read inittab. Next, rm /usr/bin/loginpass.sh, which is installed by the old software.
That's it. From now on, to uninstall the new serial software simply restart the Wiz.
Edit 1: New version update.
Edit 2: s/SDRAM/SD card/ (correcting finger macro)