2018年6月2日 星期六

Official OpenWrt on BeagleBone Black

The official OpenWrt can work on BeagleBone Black. Either the master branch or the openwrt-18.06 branch.

Step 1

git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
make
When the menu appears, select "Target System" as (TI OMAP3/4/AM33xx), "Target Profile" as (TI AM335x BeagleBone Black), then < Exit >, < Yes > to save the configurations.

It takes time to compile ...

Step 2

After the compiling is completed, write the image into a µSD card. Assume /dev/sdb is the target µSD card.
zcat bin/targets/omap/generic/openwrt-omap-am335x-boneblack-ext4-sdcard.img.gz | sudo dd of=/dev/sdb bs=4096 conv=fsync

Step 3

Connect J1 console and plug the µSD card into BeagleBone Black. Apply power with S2 BOOT button pressed to boot from the µSD card.

To support BeagleBone Green

BeagleBone Green needs am335x-bonegreen.dtb and we can find it at
build_dir/target-arm_cortex-a8+vfpv3_musl_eabi/linux-omap/linux-4.14.43/arch/arm/boot/dts/am335x-bonegreen.dtb
Copy am335x-bonegreen.dtb into the dtbs directory in FAT partition of the µSD card. Step 3 again.

GPIO Output Control


Reference BeagleBone Black  pin mux which pin to use and find the 'GPIO No.' Here take P8 pin 35 as example, the GPIO No. is 8.
In the console, execute,
echo 8 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio8/direction
to set as output. Then,
echo 1 > /sys/class/gpio/gpio81/value
echo 0 > /sys/class/gpio/gpio81/value
to control output high or low.

USB Gadget

make kernel_menuconfig
        Device Drivers  --->
    [*] USB support  --->
    <*>   USB Gadget Support  --->
    <*>   USB Gadget precomposed configurations (Ethernet Gadget (with CDC Ethernet support))

SIP header Via

所有 SIP 訊息 都要有 Via,縮寫 v。一開始的 UAC 和後續途經的每個 proxy 都會疊加一個 Via 放傳送的位址,依序作為回應的路徑。 格式 sent-protocol sent-by [ ;branch= branch ][ ; 參數 ...] s...