# 公版系统代码 **Repository Path**: magic77elva/public-version-system-code ## Basic Information - **Project Name**: 公版系统代码 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-03-14 - **Last Updated**: 2024-11-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 现在对于uboot和linux都是用启阳的编译链: `arm-fsl-linux-gnueabi-gcc-4.6.2` ## 1、编译mfgtool固件方法: 内核: `make imx_v7_mfg_defconfig` `make -j16` u-boot: uboot不识别主要是编译链的问题,他只能识别低版本的编译链,用高版本的编译链会导致识别不了; `source /etc/profile` 当前使用的是arm-fsl-linux-gnueabi-gcc-4.6.2 `export PATH=/opt/qiyang/fsl-linaro-toolchain/bin/:$PATH` `make mx6qsabresd_defconfig` `make all -j16` ## 2、编译内核: 道岔缺口: `make imx_6q_dc_defconfig` 集通铁塔: `make imx_6q_jt_defconfig` ## 3、sht21使用说明: ### 设备树节点: ``` sht21: sht21@40 { compatible = "sht21"; reg = <0x40>; } ``` ### 传感器使用: ``` insmod sht21.ko echo sht21 0x40 > /sys/bus/i2c/devices/i2c-0/new_device ls /sys/class/hwmon/hwmon0 device name subsystem uevent humidity1_input power temp1_input cat /sys/class/hwmon/hwmon0/temp1_input 25201 #毫摄氏度,即25.201摄氏度 cat /sys/class/hwmon/hwmon0/humidity1_input 58872 #毫百分之1,即58.872%RH ``` ## 4、ADXL345使用说明 ### Driver compiled as a module I2C Interface: ``` root:~> modprobe evdev root:~> modprobe adxl34x input: ADXL34x accelerometer as /devices/platform/i2c-bfin-twi.1/i2c-adapter/i2c-1/1-0053/input/input1 adxl34x 1-0053: ADXL345 accelerometer, irq 140 ``` SPI Interface: ``` root:~> modprobe evdev root:~> modprobe adxl34x input: ADXL34x accelerometer as /devices/platform/bfin-spi.1/spi1.2/input/input1 adxl34x spi1.2: ADXL345 accelerometer, irq 140 ``` ### Driver compiled into the kernel Your kernel startup messages should include something like this I2C Interface: ``` input: ADXL34x accelerometer as /devices/platform/i2c-bfin-twi.1/i2c-adapter/i2c-1/1-0053/input/input1 adxl34x 1-0053: ADXL345 accelerometer, irq 140 ``` SPI Interface: ``` input: ADXL34x accelerometer as /devices/platform/bfin-spi.1/spi1.2/input/input1 adxl34x spi1.2: ADXL345 accelerometer, irq 140 ``` ### Common Problems In case you see a message like this ``` adxl34x spi1.2: Failed to probe ADXL34x accelerometer ``` This means that the SPI communication and initilaization with the ADXL34x failed. check bus_num and chip_select in your platform device file ### Checking for proper installation After the kernel boot your device folder should include at least one device node for the accelerometer ``` root:/> ls -al /dev/input/ drw-r--r-- 2 root root 0 Jan 1 00:03 . drwxr-xr-x 5 root root 0 Jan 1 00:03 .. crw-rw-r-- 1 root root 13, 64 Jan 1 00:03 event0 crw-rw-r-- 1 root root 13, 65 Jan 1 00:03 event1 root:/> ``` Check that the interrupt is registered. ``` root:~> cat /proc/interrupts | grep adxl34x 140: 0 adxl34x ``` ``` root:~> cat /sys/class/input/input1/name ADXL34x accelerometer ``` ### Use the evtest utility to test proper function ``` root:/> evtest /dev/input/event1 Input driver version is 1.0.0 Input device ID: bus 0x18 vendor 0x0 product 0x159 version 0x0 Input device name: "ADXL34x accelerometer" Supported events: Event type 0 (Reset) Event code 0 (Reset) Event code 1 (Key) Event code 3 (Absolute) Event type 1 (Key) Event code 330 (Touch) Event type 3 (Absolute) Event code 0 (X) Value 15 Min -4096 Max 4096 Fuzz 3 Flat 3 Event code 1 (Y) Value -15 Min -4096 Max 4096 Fuzz 3 Flat 3 Event code 2 (Z) Value 242 Min -4096 Max 4096 Fuzz 3 Flat 3 Testing ... (interrupt to exit) Event: time 107831.548000, type 3 (Absolute), code 0 (X), value -7 Event: time 107831.548000, type 3 (Absolute), code 1 (Y), value -2 Event: time 107831.548000, type 3 (Absolute), code 2 (Z), value 12 Event: time 107831.548000, type 0 (Reset), code 0 (Reset), value 0 Event: time 107831.588000, type 3 (Absolute), code 0 (X), value -17 Event: time 107831.588000, type 3 (Absolute), code 1 (Y), value 4 Event: time 107831.588000, type 0 (Reset), code 0 (Reset), value 0 Event: time 107831.632000, type 3 (Absolute), code 0 (X), value -16 Event: time 107831.632000, type 3 (Absolute), code 2 (Z), value 11 ``` ## 5、网络调试imx6q kernel的tftp挂载和文件系统nfs挂载: ### 内核挂载: ``` setenv bootcmd 'tftp 12000000 zImage; tftp 18000000 imx6q-sabresd.dtb; bootz 12000000 - 18000000' ``` ### 文件系统挂载: ``` setenv bootargs 'console=ttymxc0,115200 root=/dev/nfs nfsroot=192.168.0.105:/home/magic/Downloads/linux/nfs/rootfs,proto=tcp,nfsvers=3 ip=192.168.0.251:192.168.0.105:192.168.0.1:255.255.255.0::eth0:off' ```