I have a RK3288 SOC platform and its all AOSP source code(Andorid SDK, NDK, Linux kernel, U-boot).
There is <em>\external\mmc-util\mmc.c</em> in AOSP.
That seems to use
ioctl function to test eMMC device by different eMMC command
I want to build and execute it in the SOC platform.
Refer <a href="http://www.charleswilde.com/android-native-development-using-the-android-open-source-project/" rel="nofollow">Adding a new program to build</a>, but enter mm will get following:
fatal error: #include asm-generic/int-ll64.h: No such file or directory fatal error: #include <linux/mmc/ioctl.h>: No such file or directory
My purpose is designed a program, that can send some eMMC command to test eMMC device in SOC platform.
So I think some .c files in <em>/external/mmc-util</em> folder can help me.
These files use
ioctl function to send command to eMMC device, they are like sample code.
It should be executed through ADB or include in Android system image, isn't?
How can I build(make) it success for running in Android?
I don't know how to solve and do next step.Answer1:
The simplest way (for Linux and Eclipse ADT) is:<ol><li>
Take the hello-jni example; make sure it compiles (via
ndk-build) and runs.
In the jni/ subdirectory, locate Android.mk</li> <li>
Modify it to compile your file.</li> </ol>
LOCAL_PATH := $(call my-dir) # magic spell include $(CLEAR_VARS) LOCAL_MODULE := one LOCAL_SRC_FILES += one.c ... # files to compile # link with liblog.so libMyStuff.so libTheirStuff.so LOCAL_LDLIBS := -llog -L$(LOCAL_PATH)/lib -lMyStuff -lTheirStuff include $(BUILD_SHARED_LIBRARY) # this builds libone.so # you can build more than one module via the same .mk include $(CLEAR_VARS) LOCAL_MODULE := sendraw LOCAL_SRC_FILES := sendRawEth.c #LOCAL_CPPFLAGS := -std=gnu++0x -Wall # whatever g++ flags you like #LOCAL_LDLIBS := -llog # whatever ld flags you like include $(BUILD_EXECUTABLE) # <-- Use this to build an executable.