07打开r40m平台Android6.0下验证SPI0(分色排版)
来源:互联网 发布:生有涯 知无涯 编辑:程序博客网 时间:2024/05/21 08:35
打开r40m平台Android6.0下验证SPI0
2017/10/27 17:38
版本:V1.0
开发板使用:CB-S(不用修改任何配置文件!)
1、原始编译r40m的Anroid6.0:
rootroot@cm-System-Product-Name:/home/wwt/r40/ap6212a0a1_r40m$ tar zxvf android_r40m_20170424_repack.tar.gz
rootroot@cm-System-Product-Name:/home/wwt/r40/ap6212a0a1_r40m$ tar zxvf lichee_r40m_20170424_repack.tar.gz
rootroot@cm-System-Product-Name:/home/wwt/r40/ap6212a0a1_r40m$ cd lichee
rootroot@cm-System-Product-Name:/home/wwt/r40/ap6212a0a1_r40m/lichee$ ./build.sh config
1. sun8iw11p1
Choice: 1
All available platforms:
0. android
Choice: 0
All available kernel:
0. linux-3.10
Choice: 0
All available boards:
1. m2ultra
Choice: 1
rootroot@cm-System-Product-Name:/home/wwt/r40/ap6212a0a1_r40m/lichee$ ./build.sh
rootroot@cm-System-Product-Name:/home/wwt/r40/ap6212a0a1_r40m/lichee$ cd ../android/
rootroot@cm-System-Product-Name:/home/wwt/r40/ap6212a0a1_r40m/android$ source build/envsetup.sh
rootroot@cm-System-Product-Name:/home/wwt/r40/ap6212a0a1_r40m/android$ lunch
20. azalea_m2ultra-eng
Which would you like? [aosp_arm-eng] 20
rootroot@cm-System-Product-Name:/home/wwt/r40/ap6212a0a1_r40m/android$ extract-bsp
rootroot@cm-System-Product-Name:/home/wwt/r40/ap6212a0a1_r40m/android$ make -j12
rootroot@cm-System-Product-Name:/home/wwt/r40/ap6212a0a1_r40m/android$ pack
2、
确定driver的name为spidev:
W:\r40-android-6.0\lichee\linux-3.10\drivers\spi\spidev.c
static struct spi_driver spidev_spi_driver = {
.driver = {
.name ="spidev",
.owner =THIS_MODULE,
.of_match_table = of_match_ptr(spidev_dt_ids),
},
.probe =spidev_probe,
.remove =spidev_remove,
/* NOTE: suspend/resume methods are not necessary here.
* We don't do anything except pass the requests to/from
* the underlying controller. The refrigerator handles
* most issues; the controller driver handles the rest.
*/
};
3、
W:\r40-android-6.0\lichee\tools\pack\chips\sun8iw11p1\configs\m2ultra\sys_config.fex
;----------------------------------------------------------------------------------
;SPI controller configuration
;----------------------------------------------------------------------------------
[spi0]
spi0_used = 0
spi0_cs_number = 2
spi0_cs_bitmap = 3
spi0_cs0 = port:PC23<3><1><default><default>
spi0_cs1 = port:PI14<2><1><default><default>
spi0_sclk = port:PC2<3><default><default><default>
spi0_mosi = port:PC0<3><default><default><default>
spi0_miso = port:PC1<3><default><default><default>
修改为:
;----------------------------------------------------------------------------------
;SPI controller configuration
;----------------------------------------------------------------------------------
;spi0有接SPI器件(和PC引脚和NAND冲突),但是空贴!
[spi0]
spi0_used = 1
spi0_cs_number = 2
spi0_cs_bitmap = 3
spi0_cs0 = port:PC23<3><1><default><default>
spi0_cs1 = port:PI14<2><1><default><default>
spi0_sclk = port:PC2<3><default><default><default>
spi0_mosi = port:PC0<3><default><default><default>
spi0_miso = port:PC1<3><default><default><default>
;----------------------------------------------------------------------------------
;SPI device configuration
;compatible --- device name
;spi-max-frequency --- work frequency
;reg --- chip select
;optional properties: spi-cpha, spi-cpol, spi-cs-high
;----------------------------------------------------------------------------------
;[spi0/spi_board0]
;compatible =
;spi-max-frequency =
;reg =
;spi-cpha
;spi-cpol
;spi-cs-high
[spi0/spi_board0]
compatible = "spidev"
spi-max-frequency = 50000000
reg = 1
;spi-cpha = 0
;spi-cpol = 0
;spi-cs-high = 0
4、在内核中打开SPI(生成设备节点/dev/spidev0.1):
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/android$ cd ../lichee/
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/lichee$ ll
总用量 44
drwxrwxr-x 8 rootroot rootroot 4096 10月 27 17:25 ./
drwxrwxr-x 4 rootroot rootroot 4096 10月 24 09:45 ../
drwxrwxr-x 12 rootroot rootroot 4096 10月 24 09:47 brandy/
-rw-rw-r-- 1 rootroot rootroot 123 10月 27 17:25 .buildconfig
drwxrwxr-x 15 rootroot rootroot 4096 10月 24 09:47 buildroot/
-r-xr-xr-x 1 rootroot rootroot 55 10月 24 09:47 build.sh*
drwxrwxr-x 29 rootroot rootroot 4096 10月 27 17:26 linux-3.10/
drwxrwxr-x 3 rootroot rootroot 4096 10月 24 11:53 out/
-r--r--r-- 1 rootroot rootroot 232 10月 24 09:47 README
drwxrwxr-x 6 rootroot rootroot 4096 10月 24 09:47 .repo/
drwxrwxr-x 7 rootroot rootroot 4096 10月 27 17:25 tools/
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/lichee$
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/lichee$ cd linux-3.10/
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/lichee/linux-3.10$ make ARCH-arm menuconfig
Device Drivers --->
[*] SPI support --->
< > User mode SPI device driver support
修改为:
<*> User mode SPI device driver support
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/lichee$ ./build.sh
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/lichee$ cd ../android/
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/android$ source build/envsetup.sh
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/android$ lunch
20. azalea_m2ultra-eng
Which would you like? [aosp_arm-eng] 20
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/android$ extract-bsp
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/android$ make -j12
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/android$ pack
刷机之后查找设备节点:/dev/spidev0.1
shell@azalea-m2ultra:/ $
shell@azalea-m2ultra:/ $ su
root@azalea-m2ultra:/ #
root@azalea-m2ultra:/ # find . -name spi*
./sys/bus/spi
./sys/bus/spi/devices/spi0.1
./sys/bus/spi/drivers/spidev
./sys/bus/spi/drivers/spidev/spi0.1
./sys/bus/platform/devices/spi0
./sys/bus/platform/drivers/spi
./sys/bus/platform/drivers/spi/spi0
./sys/devices/soc/spi0
./sys/devices/soc/spi0/spi_master
./sys/devices/soc/spi0/spi_master/spi0
./sys/devices/soc/spi0/spi_master/spi0/spi0.1
./sys/devices/soc/spi0/spi_master/spi0/spi0.1/spidev
./sys/devices/soc/spi0/spi_master/spi0/spi0.1/spidev/spidev0.1
./sys/class/spi_master
./sys/class/spi_master/spi0
./sys/class/spidev
./sys/class/spidev/spidev0.1
./sys/kernel/debug/clk/hosc/pll_periph0/spi0
./sys/kernel/debug/clk/hosc/spi1
./sys/kernel/debug/clk/hosc/spi2
./sys/kernel/debug/clk/hosc/spi3
./sys/module/spidev
./sbin/spidev_test0
./proc/irq/42/spi0
find: ./proc/2/task/2/exe: No such file or directory
find: ./proc/2/exe: No such file or directory
find: ./proc/3/task/3/exe: No such file or directory
find: ./proc/3/exe: No such file or directory
find: ./proc/4/task/4/exe: No such file or directory
find: ./proc/4/exe: No such file or directory
find: ./proc/5/task/5/exe: No such file or directory
find: ./proc/5/exe: No such file or directory
find: ./proc/6/task/6/exe: No such file or directory
find: ./proc/6/exe: No such file or directory
find: ./proc/7/task/7/exe: No such file or directory
find: ./proc/7/exe: No such file or directory
find: ./proc/8/task/8/exe: No such file or directory
find: ./proc/8/exe: No such file or directory
find: ./proc/9/task/9/exe: No such file or directory
find: ./proc/9/exe: No such file or directory
find: ./proc/10/task/10/exe: No such file or directory
find: ./proc/10/exe: No such file or directory
find: ./proc/11/task/11/exe: No such file or directory
find: ./proc/11/exe: No such file or directory
find: ./proc/12/task/12/exe: No such file or directory
find: ./proc/12/exe: No such file or directory
find: ./proc/13/task/13/exe: No such file or directory
find: ./proc/13/exe: No such file or directory
find: ./proc/14/task/14/exe: No such file or directory
find: ./proc/14/exe: No such file or directory
find: ./proc/15/task/15/exe: No such file or directory
find: ./proc/15/exe: No such file or directory
find: ./proc/16/task/16/exe: No such file or directory
find: ./proc/16/exe: No such file or directory
find: ./proc/17/task/17/exe: No such file or directory
find: ./proc/17/exe: No such file or directory
find: ./proc/18/task/18/exe: No such file or directory
find: ./proc/18/exe: No such file or directory
find: ./proc/19/task/19/exe: No such file or directory
find: ./proc/19/exe: No such file or directory
find: ./proc/20/task/20/exe: No such file or directory
find: ./proc/20/exe: No such file or directory
find: ./proc/21/task/21/exe: No such file or directory
find: ./proc/21/exe: No such file or directory
find: ./proc/22/task/22/exe: No such file or directory
find: ./proc/22/exe: No such file or directory
find: ./proc/23/task/23/exe: No such file or directory
find: ./proc/23/exe: No such file or directory
find: ./proc/24/task/24/exe: No such file or directory
find: ./proc/24/exe: No such file or directory
find: ./proc/25/task/25/exe: No such file or directory
find: ./proc/25/exe: No such file or directory
find: ./proc/26/task/26/exe: No such file or directory
find: ./proc/26/exe: No such file or directory
find: ./proc/33/task/33/exe: No such file or directory
find: ./proc/33/exe: No such file or directory
find: ./proc/34/task/34/exe: No such file or directory
find: ./proc/34/exe: No such file or directory
find: ./proc/35/task/35/exe: No such file or directory
find: ./proc/35/exe: No such file or directory
find: ./proc/36/task/36/exe: No such file or directory
find: ./proc/36/exe: No such file or directory
find: ./proc/424/task/424/exe: No such file or directory
find: ./proc/424/exe: No such file or directory
find: ./proc/427/task/427/exe: No such file or directory
find: ./proc/427/exe: No such file or directory
find: ./proc/428/task/428/exe: No such file or directory
find: ./proc/428/exe: No such file or directory
find: ./proc/430/task/430/exe: No such file or directory
find: ./proc/430/exe: No such file or directory
find: ./proc/431/task/431/exe: No such file or directory
find: ./proc/431/exe: No such file or directory
find: ./proc/455/task/455/exe: No such file or directory
find: ./proc/455/exe: No such file or directory
find: ./proc/465/task/465/exe: No such file or directory
find: ./proc/465/exe: No such file or directory
find: ./proc/517/task/517/exe: No such file or directory
find: ./proc/517/exe: No such file or directory
find: ./proc/527/task/527/exe: No such file or directory
find: ./proc/527/exe: No such file or directory
find: ./proc/620/task/620/exe: No such file or directory
find: ./proc/620/exe: No such file or directory
find: ./proc/633/task/633/exe: No such file or directory
find: ./proc/633/exe: No such file or directory
find: ./proc/645/task/645/exe: No such file or directory
find: ./proc/645/exe: No such file or directory
find: ./proc/646/task/646/exe: No such file or directory
find: ./proc/646/exe: No such file or directory
find: ./proc/669/task/669/exe: No such file or directory
find: ./proc/669/exe: No such file or directory
find: ./proc/670/task/670/exe: No such file or directory
find: ./proc/670/exe: No such file or directory
find: ./proc/684/task/684/exe: No such file or directory
find: ./proc/684/exe: No such file or directory
find: ./proc/686/task/686/exe: No such file or directory
find: ./proc/686/exe: No such file or directory
find: ./proc/756/task/756/exe: No such file or directory
find: ./proc/756/exe: No such file or directory
find: ./proc/759/task/759/exe: No such file or directory
find: ./proc/759/exe: No such file or directory
find: ./proc/763/task/763/exe: No such file or directory
find: ./proc/763/exe: No such file or directory
find: ./proc/805/task/805/exe: No such file or directory
find: ./proc/805/exe: No such file or directory
find: ./proc/828/task/828/exe: No such file or directory
find: ./proc/828/exe: No such file or directory
find: ./proc/920/task/920/exe: No such file or directory
find: ./proc/920/exe: No such file or directory
find: ./proc/922/task/922/exe: No such file or directory
find: ./proc/922/exe: No such file or directory
find: ./proc/923/task/923/exe: No such file or directory
find: ./proc/923/exe: No such file or directory
find: ./proc/925/task/925/exe: No such file or directory
find: ./proc/925/exe: No such file or directory
find: ./proc/927/task/927/exe: No such file or directory
find: ./proc/927/exe: No such file or directory
find: ./proc/931/task/931/exe: No such file or directory
find: ./proc/931/exe: No such file or directory
find: ./proc/933/task/933/exe: No such file or directory
find: ./proc/933/exe: No such file or directory
find: ./proc/934/task/934/exe: No such file or directory
find: ./proc/934/exe: No such file or directory
find: ./proc/935/task/935/exe: No such file or directory
find: ./proc/935/exe: No such file or directory
find: ./proc/954/task/954/exe: No such file or directory
find: ./proc/954/exe: No such file or directory
find: ./proc/1041/task/1041/exe: No such file or directory
find: ./proc/1041/exe: No such file or directory
find: ./proc/1043/task/1043/exe: No such file or directory
find: ./proc/1043/exe: No such file or directory
find: ./proc/1063/task/1063/exe: No such file or directory
find: ./proc/1063/exe: No such file or directory
find: ./proc/1098/task/1098/exe: No such file or directory
find: ./proc/1098/exe: No such file or directory
find: ./proc/1101/task/1101/exe: No such file or directory
find: ./proc/1101/exe: No such file or directory
find: ./proc/1113/task/1113/exe: No such file or directory
find: ./proc/1113/exe: No such file or directory
find: ./proc/1118/task/1118/exe: No such file or directory
find: ./proc/1118/exe: No such file or directory
find: ./proc/1123/task/1123/exe: No such file or directory
find: ./proc/1123/exe: No such file or directory
find: ./proc/1582/task/1582/exe: No such file or directory
find: ./proc/1582/exe: No such file or directory
find: ./proc/1583/task/1583/exe: No such file or directory
find: ./proc/1583/exe: No such file or directory
find: ./proc/1584/task/1584/exe: No such file or directory
find: ./proc/1584/exe: No such file or directory
find: ./proc/1589/task/1589/exe: No such file or directory
find: ./proc/1589/exe: No such file or directory
find: ./proc/1591/task/1591/exe: No such file or directory
find: ./proc/1591/exe: No such file or directory
find: ./proc/1592/task/1592/exe: No such file or directory
find: ./proc/1592/exe: No such file or directory
find: ./proc/1597/task/1597/exe: No such file or directory
find: ./proc/1597/exe: No such file or directory
find: ./proc/1598/task/1598/exe: No such file or directory
find: ./proc/1598/exe: No such file or directory
find: ./proc/1603/task/1603/exe: No such file or directory
find: ./proc/1603/exe: No such file or directory
find: ./proc/1604/task/1604/exe: No such file or directory
find: ./proc/1604/exe: No such file or directory
find: ./proc/1625/task/1625/exe: No such file or directory
find: ./proc/1625/exe: No such file or directory
find: ./proc/1633/task/1633/exe: No such file or directory
find: ./proc/1633/exe: No such file or directory
find: ./proc/1635/task/1635/exe: No such file or directory
find: ./proc/1635/exe: No such file or directory
find: ./proc/1636/task/1636/exe: No such file or directory
find: ./proc/1636/exe: No such file or directory
find: ./proc/1637/task/1637/exe: No such file or directory
find: ./proc/1637/exe: No such file or directory
find: ./proc/1651/task/1651/exe: No such file or directory
find: ./proc/1651/exe: No such file or directory
find: ./proc/1731/task/1731/exe: No such file or directory
find: ./proc/1731/exe: No such file or directory
find: ./proc/6566/task/6566/exe: No such file or directory
find: ./proc/6566/exe: No such file or directory
find: ./proc/6591/task/6591/exe: No such file or directory
find: ./proc/6591/exe: No such file or directory
find: ./proc/6610/task/6610/exe: No such file or directory
find: ./proc/6610/exe: No such file or directory
find: ./proc/9480/task/9480/exe: No such file or directory
find: ./proc/9480/exe: No such file or directory
find: ./proc/10512/task/10512/exe: No such file or directory
find: ./proc/10512/exe: No such file or directory
find: ./proc/10770/task/10770/exe: No such file or directory
find: ./proc/10770/exe: No such file or directory
./dev/spidev0.1
1|root@azalea-m2ultra:/ #
1|root@azalea-m2ultra:/ #
5、增加SPI的测试验证程序(spidev_test.c):
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/lichee/linux-3.10$ find . -name spidev_test.c
./Documentation/spi/spidev_test.c
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/lichee/linux-3.10$
请严重注意:测试应用程序的名字不能叫:spidev_test。感觉是tinav2.1的SDK自动过滤掉了spidev_test这个应用程序名!
(Android6.0下还是和tinav2.1下取同一个名字得了!)
不过叫spidev_test0还是可以的!^_
W:\r40-android-6.0\android\external\spidev_test0\Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#LOCAL_C_INCLUDES += \
#frameworks/av/media/CedarX-Projects/CedarX/include/include_camera
#
#LOCAL_SHARED_LIBRARIES += \
#libsunxi_alloc \
#
#LOCAL_MODULE_TAGS := optional
LOCAL_MODULE = spidev_test0
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
# LOCAL_SRC_FILES := $(call all-subdir-c-files)
LOCAL_SRC_FILES := spidev_test0.c
include $(BUILD_EXECUTABLE)
W:\r40-android-6.0\android\external\spidev_test0\spidev_test0.c
(spidev_test0.c这个就是lichee/linux-3.4/Documentation/spi/spidev_test.c,不过需要根据实际修改设备节点!)
默认为:static const char *device = "/dev/spidev1.1";
请改为:static const char *device = "/dev/spidev0.1";
W:\r40-android-6.0\android\external\spidev_test0\spidev_test0.c
//static const char *device = "/dev/spidev0.0";
static const char *device = "/dev/spidev0.1";
static uint8_t mode;
static uint8_t bits = 8;
static uint32_t speed = 500000;
static uint16_t delay;
static void transfer(int fd)
{
int ret;
//uint8_t tx[] = {
//0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
//0x40, 0x00, 0x00, 0x00, 0x00, 0x95,
//0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
//0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
//0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
//0xDE, 0xAD, 0xBE, 0xEF, 0xBA, 0xAD,
//0xF0, 0x0D,
//};
// CityBrand WelCome U!
uint8_t tx[] = {
0x43, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6E, 0x64, 0x20,
0x57, 0x65, 0x6C, 0x43, 0x6F, 0x6D, 0x65, 0x20, 0x55, 0x21,
0x43, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6E, 0x64, 0x20,
0x57, 0x65, 0x6C, 0x43, 0x6F, 0x6D, 0x65, 0x20, 0x55, 0x21,
0x43, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6E, 0x64, 0x20,
0x57, 0x65, 0x6C, 0x43, 0x6F, 0x6D, 0x65, 0x20, 0x55, 0x21,
};
uint8_t rx[ARRAY_SIZE(tx)] = {0, };
struct spi_ioc_transfer tr = {
.tx_buf = (unsigned long)tx,
.rx_buf = (unsigned long)rx,
.len = ARRAY_SIZE(tx),
.delay_usecs = delay,
.speed_hz = speed,
.bits_per_word = bits,
};
ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);
if (ret < 1)
pabort("can't send spi message");
for (ret = 0; ret < ARRAY_SIZE(tx); ret++) {
//if (!(ret % 6))
//puts(" ");
//printf("%.2X ", rx[ret]);
if (!(ret % 20)){
puts("\n");
}
printf("%c", rx[ret]);
}
//puts("");
puts("\n");
}
W:\r40\ov5640_ap6212a0a1_r40m\android\build\target\product\base.mk
#
# Copyright (C) 2012 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Base modules (will move elsewhere, previously user tagged)
PRODUCT_PACKAGES += \
20-dns.conf \
95-configured \
org.apache.http.legacy.boot \
appwidget \
appops \
am \
android.policy \
android.test.runner \
app_process \
applypatch \
blkid \
bmgr \
bugreport \
content \
dhcpcd \
dhcpcd-run-hooks \
dnsmasq \
dpm \
framework \
fsck_msdos \
hid \
ime \
input \
javax.obex \
libandroid \
libandroid_runtime \
libandroid_servers \
libaudioeffect_jni \
libaudioflinger \
libaudiopolicyservice \
libaudiopolicymanager \
libbundlewrapper \
libcamera_client \
libcameraservice \
libdl \
libdrmclearkeyplugin \
libeffectproxy \
libeffects \
libinput \
libinputflinger \
libiprouteutil \
libjnigraphics \
libldnhncr \
libmedia \
libmedia_jni \
libmediaplayerservice \
libmtp \
libnetd_client \
libnetlink \
libnetutils \
libpdfium \
libradio \
libradioservice \
libradio_metadata \
libreference-ril \
libreverbwrapper \
libril \
librtp_jni \
libsensorservice \
libskia \
libsonic \
libsonivox \
libsoundpool \
libsoundtrigger \
libsoundtriggerservice \
libsqlite \
libstagefright \
libstagefright_amrnb_common \
libstagefright_avc_common \
libstagefright_enc_common \
libstagefright_foundation \
libstagefright_omx \
libstagefright_yuv \
libusbhost \
libutils \
libvisualizer \
libvorbisidec \
libmediandk \
libwifi-service \
media \
media_cmd \
mediaserver \
monkey \
mtpd \
ndc \
netd \
ping \
ping6 \
platform.xml \
pppd \
pm \
racoon \
run-as \
schedtest \
sdcard \
secdiscard \
services \
settings \
sgdisk \
sm \
svc \
tc \
telecom \
vdc \
vold \
rebird \
fpscamera \
ll \
spidev_test0 \
wm
PRODUCT_COPY_FILES := $(call add-to-product-copy-files-if-exists,\
frameworks/base/preloaded-classes:system/etc/preloaded-classes)
# Note: it is acceptable to not have a compiled-classes file. In that case, all boot classpath
# classes will be compiled.
PRODUCT_COPY_FILES += $(call add-to-product-copy-files-if-exists,\
frameworks/base/compiled-classes:system/etc/compiled-classes)
$(call inherit-product, $(SRC_TARGET_DIR)/product/embedded.mk)
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/android/external/spidev_test0$
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/android/external/spidev_test0$ll
总用量 52
drwx------ 2 rootroot rootroot 4096 10月 27 14:31 ./
drwxrwxr-x 204 rootroot rootroot 4096 10月 27 17:23 ../
-rwx------ 1 rootroot rootroot 443 10月 26 12:58 Android.mk*
-rwx------ 1 rootroot rootroot 382 3月 3 2017 Android - 副本.mk*
-rwx------ 1 rootroot rootroot 24979 3月 3 2017 fpscamera.c*
-rwx------ 1 rootroot rootroot 5004 10月 27 17:56 spidev_test0.c*
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/android/external/spidev_test0$
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/android/external/spidev_test0$
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/android/external/spidev_test0$mm
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=6.0.1
TARGET_PRODUCT=azalea_m2ultra
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a7
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.13.0-24-generic-x86_64-with-Ubuntu-14.04-trusty
HOST_BUILD_TYPE=release
BUILD_ID=MOB30R
OUT_DIR=out
============================================
No private recovery resources for TARGET_DEVICE azalea-m2ultra
make:进入目录'/home/wwt/r40-android-6.0/android'
target thumb C: spidev_test0 <= external/spidev_test0/spidev_test0.c
external/spidev_test0/spidev_test0.c: In function 'transfer':
external/spidev_test0/spidev_test0.c:77:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (ret = 0; ret < ARRAY_SIZE(tx); ret++) {
^
target Executable: spidev_test0 (out/target/product/azalea-m2ultra/obj/EXECUTABLES/spidev_test0_intermediates/LINKED/spidev_test0)
target Unpacked: spidev_test0 (out/target/product/azalea-m2ultra/obj/EXECUTABLES/spidev_test0_intermediates/PACKED/spidev_test0)
target Symbolic: spidev_test0 (out/target/product/azalea-m2ultra/symbols/root/sbin/spidev_test0)
target Strip: spidev_test0 (out/target/product/azalea-m2ultra/obj/EXECUTABLES/spidev_test0_intermediates/spidev_test0)
Install: out/target/product/azalea-m2ultra/root/sbin/spidev_test0
make:离开目录“/home/wwt/r40-android-6.0/android”
#### make completed successfully (1 seconds) ####
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/android/external/spidev_test0$
rootroot@cm-System-Product-Name:/home/wwt/r40-android-6.0/android/external/spidev_test0$
开发板:BPI-M2U。
请将开发板上的CON1引脚上的第19脚(SPI0-MOSI)和第21脚(SPI0-MISO)通过1k欧姆的电阻连接在一起!(不建议直连,阻值可以根据实际情况灵活决定!)
1|root@azalea-m2ultra:/ #
1|root@azalea-m2ultra:/ #
1|root@azalea-m2ultra:/ # spidev_test0
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)
CityBrand WelCome U!
CityBrand WelCome U!
CityBrand WelCome U!
root@azalea-m2ultra:/ #
root@azalea-m2ultra:/ #
(验证通过!)
参考资料:
http://www.xuebuyuan.com/1345420.html
Linux2.6.32下SPI驱动的移植如下图所示:
http://blog.sina.com.cn/s/blog_6182b82201011s6j.html
基于S3C2440的Linux SPI驱动移植笔记
- 07打开r40m平台Android6.0下验证SPI0(分色排版)
- 打开r40m平台Android6.0下的以太网卡(分色排版)
- 42打开r40m平台Android6.0下的录音测试(分色排版)
- 41打开r40m平台Android6.0下的耳机(分色排版)
- 08打开r40m平台Android6.0下的TF卡(分色排版)
- 打开r40m平台tinav2.1下的录音测试(失败)(分色排版)
- 全志R16平台SPI0接口的验证(分色排版)
- 全志R16平台SPI0接口的验证V1.1(分色排版)
- 09全志r40m平台的SATA验证(分色排版)
- 31在全志r40m平台调通ov5640(分色排版)
- 在全志r40m平台调通ov5640(分色排版)V1.1版本
- 全志R16平台的android6.0.1系统下的RTL8188EU的配置V1.0(分色排版)
- 全志R16平台的android6.0.1系统下的RTL8188EU的配置(分色排版)V1.0
- 原始编译r40m的Anroid6.0(取UART打印)(分色排版)
- 全志R16平台的Android6系统下调通rtl8189es(分色排版)V1.0
- 打开r40平台tinav2.1下打开TF卡(分色排版)
- 打开r40平台Anroid6.0下的AP6212A1版本的WIFI(兼容配置)(分色排版)
- 打开r40平台tinav2.1下的AP6212A0版本的WIFI(分色排版)
- 系统服务控制
- Tensorflow物体检测(Object Detection)
- 原易到创始人周航出任顺为资本投资合伙人
- 因3D摄像头技术问题 5.8英寸iPhone 8将延迟数周发货
- AndroidStudio 升级3.0.0(10月27日)
- 07打开r40m平台Android6.0下验证SPI0(分色排版)
- GMIC全球顾问委员会成立 张亚勤博士任首届主席
- 英特尔:GPU已out,Nvidia的人工智能之路会越来越难
- ssh服务
- Bagging
- palindrome
- 街道网络路径数目计算
- [HTML5][JSP]利用FormData对象完成表单的异步上传|文件上传|图文同时上传
- 说说前端那些事----递归