uracoli logo Home - Downloads - Docs - Hardware - Source - News - Blog tiny230 photo

A few weeks ago I stumbled across an article in the german computer mag c’t about a small embedded MIPS based board called Carambola manufatured from the company 8devices. The device is equipped with a Ralink RT3050 MIPS CPU that runs at 320 Mbit/s, it has two ethernet interfaces and one Wi-Fi interface, a USB and a serial port, 8MByte Flash and 32MByte RAM. Since the 35x45mm board comes at an affordable price of 22,-EUR per module and for 67,-EUR the module, a breakout board, a housing and the shipping costs was included.

Last week the module arrived on my desk and today there was time for the first contact. After hitting nearly every wall on the way from Power on, finally a Radiofaro board and a Raven RZUSB stick gets enumerated. Even if the 8devices Wiki is a good ressource for information, the information for OpenWRT novices is quite sprinkled over the net. In the following sections I summarize the todays lessons learned.

Power Up and Serial Connection

The power up of Carambola requires basically a 9 to 24V DC power source. In my case it was the power supply of an old mobile CD Player, which comes at 9V, 500mA. I also own a prehistoric PC with a real RS232 interface, which was a great help bringing up the board.

First I connected the RS232 cable with the PC and used the gtkterm programm with the settings 115200 bit/s 8N1 and without flow control. You will get messages like this:

U-Boot 1.1.3 (Feb 20 2012 - 16:20:22)

Board: Ralink APSoC DRAM:  32 MB
relocate_code Pointer at: 81fb0000
config usb..
flash_protect ON: from 0xBF000000 to 0xBF01E757
flash_protect ON: from 0xBF030000 to 0xBF030FFF
....
[   15.460000] br-lan: port 1(eth0.1) entered forwarding state
[   17.460000] br-lan: port 1(eth0.1) entered forwarding state
[   19.540000] ramips-wdt: timeout value 60 must be 0 < timeout < 40

Now you can type Enter and a Linux prompt is displayed. (My first lesson learned was that the flow control has to be off, otherwise you will not get to the Linux prompt).

root@OpenWrt:/#

At the serial terminal messages from the syslog appears, so you will see e.g. events from plugging and unplugging USB devices. It allows you also to issue some basic commands, for instance ifconfig to see the boards network configuration.

Connecting to the Network

Carambola comes with two ethernet interfaces. One is configured to use the static IP address 192.168.1.1 (eth0), the second one gets its address via DHCP (eth1). If the static IP address does somehow not fit in your existing network infrastructure, use the second ethernet port. Connect the ethernet cable an watch, if the aproriate LED on the Carambola module ligts. Now you can easily find out the assigned IP adresses by typing ifconfig in the serial terminal:

root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr C4:93:00:00:00:AF
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          .....
eth0      Link encap:Ethernet  HWaddr C4:93:00:00:00:AF
          .....
eth0.1    Link encap:Ethernet  HWaddr C4:93:00:00:00:AF
          .....
eth0.2    Link encap:Ethernet  HWaddr C4:93:00:00:00:AF
          inet addr:172.16.1.127  Bcast:172.16.1.255  Mask:255.255.255.0
          .....
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          .....

Before you can connect via ssh to Carambola, you need to assign a root password in the serial terminal. Type passwd and enter the password. In the next step, the ssh command will stop with an error:

axel@desktop$ssh  roo@172.16.1.127
ssh: connect to host 172.16.1.127 port 22: Connection refused

Thats because of the firewall on Carambola blocks port 22.

TODO: how to configure the firewall

The way out is easier if your PC runs a ssh daemon and the firewall of the desktop PC does not block port 22. For an Ubuntu you can open the firewall for port 22 with the command ufw allow 22. Now the ssh connection from Carambola to the desktop PC will be successfull. Here is a part of the session log opened from the serial console of Carambola:

root@OpenWrt:/# ssh axel@172.16.1.124

Host '172.16.1.124' is not in the trusted hosts file.
(fingerprint md5 52:1f:41:eb:e3:74:76:e5:6e:14:40:3c:36:fb:73:f4)
Do you want to continue connecting? (y/n) y
axel@172.16.1.124's password:
Linux dellbox 2.6.35-32-generic #67-Ubuntu SMP Mon Mar 5 19:35:26 UTC 2012 i686 GNU/Linux
Ubuntu 10.10

Welcome to Ubuntu!
 * Documentation:  https://help.ubuntu.com/

Compiling a new Image

The steps how to compile a new firmware image are described pretty good in the Carambola-Wiki. After installing the prerequisite Linux tools, cloning the git repository and before doing the first make I would recommend to modify the banner file in order to see, that the new image is active after the firmware update. The source banner file is located in carambola/package/base-files/files/etc/.

Do not modify the banner that is located somewhere below build_dir, this one gets overwritten during the make run.

Rebuild the Carambola firmware after this initial minimal modification with the comand make:

axel@desktop$cd carambola
axel@desktop$make
 make[1] world
 make[2] target/compile
 make[3] -C target/linux compile
 make[2] package/cleanup
 ...
 make[3] -C target/linux install
 make[2] package/index

Flashing the first Image

The firmware image that is going to be flashed is the file carambola/bin/ramips/openwrt-ramips-rt305x-carambola-squashfs-sysupgrade.bin.

In order to abbreviate the typing in the serial terminal, copy this file to a location with a shorter path name, e.g.

axel@desktop$ cd carambola/bin/ramips/
axel@desktop$ cp openwrt-ramips-rt305x-carambola-squashfs-sysupgrade.bin /tmp/c.bin

From the serial Carambola terminal enter the commands

root@OpenWrt:/# scp axel@172.16.1.124:/tmp/c.bin /tmp
axel@172.16.1.124's password:
c.bin                                         100% 2944KB   1.4MB/s   00:02
root@OpenWrt:/# sysupgrade -v -c /tmp/c.bin
Saving config files...
....
Writing from <stdin> to firmware ...  [e]
....

After the sysupgrade command you will see, that the new firmware is booting. To verify that it is really the new firware, type "Enter" in the serial terminal and you will get your modified banner file displayed:

 BusyBox v1.19.4 (2012-10-02 00:18:41 CEST) built-in shell (ash)
 Enter 'help' for a list of built-in commands.

 -------------------------------------------
 uracoli sensor bridge for carambola
 -------------------------------------------
 root@(none):/#

Connecting Serial USB Devices

In order to get Radiofaro and Co enumerated by the Carambola kernel, the support for ACM and FTDI needs to be added. Since I somehow did it not get managed to include the kernel modules kmod-usb-acm, kmod-usb-serial and kmod-usb-serial-ftdi in the firmware image, checkmark them with a * (M would mark them as module). Execute the command make menuconfig and enable the required modules with \*:

  | | <*> kmod-usb-acm......................... Support for modems/isdn controllers                                    | |
  | | < > kmod-usb-atm.................................. Support for ATM on USB bus                                    | |
  | | < > kmod-usb-cm109.................................. Support for CM109 device                                    | |
  | | --- kmod-usb-core............................................ Support for USB                                    | |
  | | < > kmod-usb-hid......................... Support for USB Human Input Devices                                    | |
  | | < > kmod-usb-net............... Kernel modules for USB-to-Ethernet convertors                                    | |
  | | < > kmod-usb-ohci............................... Support for OHCI controllers                                    | |
  | | < > kmod-usb-printer.................................... Support for printers                                    | |
  | | <*> kmod-usb-rt305x-dwc_otg..................... RT305X USB controller driver                                    | |
  | | <*> kmod-usb-serial..................... Support for USB-to-Serial converters                                    | |
  | | < >   kmod-usb-serial-ark3116........ Support for ArkMicroChips ARK3116 devices (NEW)                            | |
  | | < >   kmod-usb-serial-belkin........................ Support for Belkin devices (NEW)                            | |
  | | < >   kmod-usb-serial-ch341.......................... Support for CH341 devices (NEW)                            | |
  | | < >   kmod-usb-serial-cp210x........... Support for Silicon Labs cp210x devices (NEW)                            | |
  | | < >   kmod-usb-serial-cypress-m8.............. Support for CypressM8 USB-Serial (NEW)                            | |
  | | <*>   kmod-usb-serial-ftdi............................ Support for FTDI devices                                  | |

Now proceed like in the previous steps for flashing the image. After booting the new kernel you should see the following messages when plugging the USB connector:

root@OpenWrt:/#
<1>
[ 1310.090000] usb 1-1: new full-speed USB device number 2 using dwc_otg
[ 1310.300000] cdc_acm 1-1:1.0: ttyACM0: USB ACM device
[ 1342.250000] usb 1-1: USB disconnect, device number 2
<2>
[ 1361.090000] usb 1-1: new full-speed USB device number 3 using dwc_otg
[ 1361.300000] ftdi_sio 1-1:1.0: FTDI USB Serial Device converter detected
[ 1361.310000] usb 1-1: Detected FT232RL
[ 1361.320000] usb 1-1: Number of endpoints 2
[ 1361.320000] usb 1-1: Endpoint 1 MaxPacketSize 64
[ 1361.320000] usb 1-1: Endpoint 2 MaxPacketSize 64
[ 1361.330000] usb 1-1: Setting MaxPacketSize 64
[ 1361.350000] usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0
  1. Messages for connecting the RZUSB stick

  2. Messages for connecting the Radiofaro board

more topics


Last modified: 2017-06-04 Visitor Counter