OpenWrt Forum Archive

Topic: Converting a La Fonera into an "general purpose" embedded computer?

The content of this topic has been archived on 24 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have a few La Fonera's that I would like to use as wireless linux clients. IOW - I don't want them to be routers, AP's, etc. Essentially, I want the absolute smallest configuration of OpenWRT that can connect to another AP as a client for net access. The existing network uses WEP, due to gaming adapters, old Macs, etc. (Yes, I know - not exactly secure, but it's better than nothing)

I need to strip the image down to the bare minimum necessary to get the "router" on the local network, leaving the rest for my application.

Also, what do I need to do to cross-compile my app for OpenWRT on the La Fonera? Beyond the arch difference (MIPS vs IA32), is there anything I need to do library wise? The code is all ANSI C, and is fairly POSIX compliant. Although this is my first foray into an embedded linux, I've done stand-alone apps for PPC & Microblaze (Xilinx' "soft" 32-bit RISC processor). The trick is that the Xilinx EDK is programmed for cross-compilation by default - so I've never done it by hand.

BTW - what I intend to do is attach a small FPGA to the unused GPIO, probably a Xilinx Spartan 3E-100 (XC3S100E). The idea is to use the Fonera to configure the FPGA using GPIO, then connect to the FPGA using SPI afterwards. 5 pins are perfect for this application, so long as you are willing to stick to a 3-wire SPI link, and deal with a bidirectional data line (SDIO). This eliminates the FLASH configuration memory, resulting in a single chip solution, though I will probably go ahead and add a MAX3232 chip for RS232 level translation. The other advantage to this method is that I can "upgrade" the FPGA firmware image remotely without having to deal with JTAG - just wget/tftp the new firmware down, and restart the app.

The FPGA will handle the hardware end of the application, while the Fonera's MIPS processor runs the software end of the application.

Note: The latest Xilinx part, the XC3S50AN, would be absolutely PERFECT - were they obtainable by mere mortals. (the 'AN's have internal configuration memory, and only need 2 supply voltages - Vccint, and Vccaux/Vccio)

see http://dev.openwrt.org :

svn co https://svn.openwrt.org/openwrt/trunk/
cd trunk
make menuconfig - select atheros 2.6 platform, and then go through and deselect whatever packages you don't want
make - this will build a cross compiler, applicable libraries, and a firmware image (kernel and rootfs in this case)

I do wonder how you got openwrt on it without doing this, as there are no official snapshots of kamikaze wink (to discourage the inevitable bricked routers from users who don't know how to fix them)
edit: I suppose there are now.

for small things you can use the cross compiler directly by trunk/staging_dir_mips/bin/mips-linux-gcc

what are you doing with the fpga? just curious

would you mind writing an spi sd/mmc driver for gpio on linux 2.6/atheros? wink  everybody either doesn't want to or doesn't know enough about kernel development to do it properly, you can guess where I fall

(Last edited by Kevin on 14 Mar 2007, 09:26)

Kevin wrote:

I do wonder how you got openwrt on it without doing this, as there are no official snapshots of kamikaze wink (to discourage the inevitable bricked routers from users who don't know how to fix them)

Nightly snapshots of Kamikaze in the svn repository have been located at http://downloads.openwrt.org/snapshots/ since 0.9 has been released.

I'm not using Kamikaze - yet. Remember, the La Fonera is running OpenWRT already - just a highly modified version. I've been looking at the gpio driver from http://fghhgh.150m.com/ for reference.

Right now, I've just loaded the gpio driver on the existing firmware, which is useful enough at the moment. Eventually, I plan to load a standard OpenWRT image on it, once all of FON's necessary changes are backported.

Unfortunately, I'm not that familiar with Linux - I'm more of a hardware guy. I have been cutting my teeth in embedded programming with the Xilinx tools - but those are standalone apps. I have done some coding in FreeBSD, but it was all application level stuff - no down and dirty kernel-level stuff.

So, I have no idea how to write a filesystem driver. The best I can hope for is to register a new SPI interface in /proc. I'm also going to attempt to write/port an SVF player that will configure the FPGA via GPIO as well, but I'm not sure how useful that will be if you aren't attaching FPGA"s. (essentially, the system will configure the FPGA, check for the CONF_DONE pin going high, then register the new SPI interface)

I'm working on a way to coordinate HVAC systems without running a whole bunch of cables. The La Fonera's will essentially run the scheduling software, and the wireless link will allow me to remotely administer it without having to run a cat5 cable. The FPGA will essentially be an I/O expander - providing serial communication to thermostats, monitoring the HVAC equipment, etc. A CPLD would do, if I could find a big enough one, but at $12/each, the XC3S100E has a sea of gates for cheap.

I've been working on this problem from a different angle, using 2.4GHz radio modems and Xilinx FPGA boards, but the La Fonera is a superior solution all-around. For one, it already has Linux ported to it, and it already has a working radio. smile

Note - the original application ran on a FreeBSD host, using PCI cards for I/O. Unfortunately, when I moved, my wife forbade me from "rigging up" the house again, hence the need for wireless. wink

The discussion might have continued from here.