Changes

Jump to: navigation, search

Hacking b2g on Raspberry Pi

1,993 bytes added, 23:25, 20 September 2014
Preparing a development environment
== Preparing a development environment ==
 
To hack b2g on the RPi, you'll want to set up a few things. First, a serial console is strongly recommended. (A serial console is basically required for kernel development.) You can purchase a serial-to-USB or serial-port connector for your RPi. Some RPi kits also include one of these. A common serial-to-USB adapter included in RPi kits requires you to connect the black lead to pin 6 (ground), the white lead to pin 8 (GPIO14, UART0_TXD), and the green lead to pin 10 (GPIO15, UART0_RXD). You don't need to connect the red lead if your RPi already has a power source. The b2g kernel is pre-configured to open a serial console for the RPi, so all you need to do is plug the USB cable into your host machine and you should see console output and get a shell prompt.
 
You must create an adb connection for your RPi. adb is the "android debug bridge" over which diagnostic output is received and development commands are sent. Usually an adb connection is made over USB, but this hasn't been tested with the RPi. (The RPi's USB ports are intended to be used in master mode, and it's not yet known whether they will go into slave mode if connected to a host machine through a full-sized USB male-to-male connector. These cables are also somewhat hard to find.)
 
You can connect adb through the RPi's ethernet port, however. To connect adb over ethernet, you need to find out your RPi's IP address on your LAN. You can do this by either looking at your network router's client table, or running the following command on your RPi's serial console
 
netcfg
 
Once you know your RPi's IP address, connect adb by running the following command on your host machine
 
adb connect $IP:5555
 
replacing <code>$IP</code> with your RPi's IP address, of course. (5555 is the port that the adb server on your RPi listens on.) To test your adb connect, run the following command on your host
 
adb logcat
 
You should a long list of diagnostic messages. Pressing Ctrl-c stops the logcat output.
== Rebuilding b2g and updating your RPi ==
Confirm
699
edits

Navigation menu