Skip to content

ankurayadav/bbbandroidHAL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 

Repository files navigation

bbbandroidHAL

This contains native library for devoloping java code for BBBAndroid

Base native code has been downloaded from packpub website. This base code was developed by Andrew Henderson.

You can refer wiki for documentation. Or you can also refer to doxygen documentation for more references.

###Simple steps for making Android App using BBBAndroidHAL

  1. Create a new Android project in eclipse.
  2. Create a jni folder in the project directory.
  3. Copy all the files from bbbandroidHAL to you jni folder.
  4. Make proper Android.mk and Application.mk file since the given Android.mk and Application.mk files are configured to generate binary code form C program so that we can test our logic before actually making the Android App. For simplicity I have already created Android.mk and Application.mk files that can be directly used if you do not want to create one by yourself.
  5. Call ndk-build of Android SDK from you jni directory.
  6. Now you will be able use JNI interfaces in your Android java programs.
  7. You can see demo applications for you reference.

Note : If you want to use only few features of BBBAndroidHAL and do not want to compile all the necessary code then you will have to delete those files, and delete there references from Android.mk, bbbandroidHAL.h and jni_wrapper.h

###Some useful commands.

  1. Command to login into bbbandroid shell :

adb shell
  1. Command to send file into bbbandroid :

adb push file /path_in_bbbandroid
  1. Compiling Device Tree Overlay :

dtc -O dtb -o DEVICE-TREE-00A0.dtbo -b 0 -@ DEVICE-TREE-00A0.dts
  1. Installing Device Tree Overlay :

adb push DEVICE-TREE-00A0.dtbo /system/vendor/firmware/
echo DEVICE-TREE > /sys/devices/bone_capemgr.9/slots 

After installing device tree overlay we can export pins and provide proper permissions. 4. Exporting GPIO :


cd /sys/class/gpio/
echo 22 > export
cd gpio22
chmod 0777 value
  1. Exporting PWM :

cd /sys/class/pwm/
echo 0 > export
cd pwm0
chmod 0777 duty_ns period_ns run polarity
  1. Accessing ADC :

cd /sys/bus/iio/devices/iio:device0
cat in_voltage5_raw
chmod 0777 in_voltage5_raw
  1. Accessing I2C :

chmod 0777 /dev/i2c-1
  1. Accessing SPI :

chmod 0777 /dev/spidev1.0
  1. Accessing UART :

chmod 0777 /dev/ttyO4
  1. Accessing CAN : At first we have to install missing kernel modules for CAN.

cd /system/vendor/lib/modules/3.8.13+/kernel/drivers/net/can/
insmod can-dev.ko
insmod c_can/c_can.ko 
insmod c_can/c_can_platform.ko
insmod vcan.ko
cd /system/vendor/lib/modules/3.8.13+/kernel/net/can/
insmod can.ko
insmod can-raw.ko
insmod can-bcm.ko

Then we have to add vcan0 for virtual can.


ip link add dev vcan0 type vcan
ip link set up vcan0
ip link show vcan0
  1. Accessing USB :

cd /dev/bus/usb/
chmod -R 0777 .

###Youtube videos can be found here. bbbandroidHAL

About

This contains native library for devolving java code for BBBAndroid

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages