wiki:serial

Version 11 (modified by matthijs, 8 years ago) (diff)

Replace 2.0g image

Serial Access / Flashing via UART

Both the 2.0g and the 2.0n Fonera have a serial port on board. These can be used to access the device directly, without going through the network. This also allows access to the device bootloader, which is especially useful when the bootloader configuration is broken or the device is otherwise completely inaccessible (but be sure to try the normal restore methods first!).

Hardware

I assume we are using an ark3116 based USB-UART adapter under Debian Linux. A Pl2303 based adapter is also reported to work, see http://www.mail-archive.com/development@fonosfera.org/msg00308.html (in fact, any serial port emulator should work here). Note that you should not use a real serial port, or an USB-to-serial convertor with an DB-9 connector. These use the RS232 protocol, which operates on a higher voltage (3-15V instead of 3.3V) and seems to have the voltage levels reversed. Using RS232 might cause garbage instead of actual text on the serial port, or might destroy your Fonera's serial port completely.

The UART adapter is refered to as device /dev/ttyUSB0 in this tutorial. This might be different for you. If you are using an ark3116 or similar UART adapter under Linux you can get its device file name by searching the kernel log for a message like converter now attached to ttyUSB0 after plugging in the adapter.

Terminal application

To access the serial port, you'll have to use a terminal emulator. Examples are cutecom and minicom under Linux, or HypterTerminal under Windows.

Debian users may execute aptitude install cutecom as root (or using sudo) to get cutecom. See below for the settings to use.

Windows users can use the builtin HypterTerminal command, see this tutorial. You should then use COM3 or similar instead of /dev/ttyUSB0 as device. You'll find the serial port name in your system device manager. However this tutorial will not cover the details of using HyperTerminal but things should be similar to the process described here.

2.0g specifics

2.0g connected to UART

The 2.0g has a header, labeled JP1, that offers access to the serial lines.

2.0g pinout

PinFunctionWire color in image
1 3.3V Not connected
2 TXD White
3 RXD Red
4 GND Black

Pin 1 is the pin closest to the ethernet sockets.

Remember to cross over TXD and RXD on both ends (though it seems some USB serial converters, like the one in the picture, are labeled so that you just connect TXD to TXD and RXD to RXD, so you might have to try both configurations).

Some USB -> serial adapters don't have a 3.3V line. It should be fine to leave that one unconnected, then.

2.0g settings

Baud Rate:9600
Data Bits:8
Stop Bits:1
Parity:none
Handshake:none
Transfer Protocol:YModem
RedBoot Commands:load -r -v -b %{FREEMEMLO} -m ymodem
### YModem transfer
fis delete image
fis create image
reset

2.0g Redboot Access

  1. Make sure your Fonera is not plugged in yet.
    Connect your UART-Adapter to your Fonera as shown.
    Then connect your UART-Adapter to your Computer.
  1. Open CuteCom and adjust the settings as noted then hit Open device and place the cursor in the Input field.

Screenshot of CuteCom connected to Fonera 2

  1. Power on your Fonera. You should get some output in the terminal as show, hit CTRL+C on your keyboard to cancel the normal boot process.
    You should get the RedBoot> prompt.

Flashing via Redboot

  1. Type load -r -v -b %{FREEMEMLO} -m ymodem into the Input field and hit return.
  1. Choose YModem in the Listbox next to the Send file... button. Then hit Send file... and select the firmware file.
    The firmware will be uploaded to your fonera. This may take a few minutes. Wait for the status message Raw file loaded....
  1. Type fis delete image to delete the old firmware image, confirm any warnings with y.
  1. Type fis create image to write the new image onto the flash memory.
  1. Wait about 15 to 30 minutes until you get a reply then type reset to reboot the fonera.

2.0n specifics

The 2.0n is a bit more work: It has the pads for the serial connection, labeled JP2, but it doesn't have pins soldered on. Furthermore it also doesn't have the RX and TX pads connected. The real RX and TX pads are located on underside of the board, right under the main CPU.

The image pretty much sums up what you need to do get it working :-)

Note that these pads are very tiny SMD-style pads which are pretty hard to solder a wire onto properly. If you're not careful, you might tear the copper pads right off the board, effectively destroying the serial port on your Fonera (been there, done that...).

2.0n pinout

Underside of the Fonera 2.0n board

PinFunction
1 3.3V
2 RXD
3 GND
4 TXD

Pin 1 is the pin closest to the leds.

Remember to cross over TXD and RXD on both ends (though it seems some USB serial converters are labeled so that you just connect TXD to TXD and RXD to RXD, so you might have to try both configurations).

Some USB -> serial adapters don't have a 3.3V line. It should be fine to leave that one unconnected, then.

Remember that the image is taken from the underside of the circuit board, so if you solder on a pin header and want to connect your UART, be careful not to read the picture wrong.

2.0n settings

?

2.0n uboot access

?

Attachments (3)

Download all attachments as: .zip