986 views|1 replies

1237

Posts

66

Resources
The OP
 

[Zhengdian Atomic Alpha IMX6ULL Linux Development Board] 7. SPI function test [Copy link]

Atom provides a wealth of development documents and examples for us to learn. These materials are open source and free to download, and are very detailed:

This time, the SPI driver was tested. Because the system used in Atom Brother's documentation tutorial is somewhat different from the factory system, problems occurred when directly testing some drivers.

Before compiling, enable the factory cross-compilation tool and check the version number:

source /opt/fsl-imx-x11/4.1.15-2.1.0/environment-setup-cortexa7hf-neon-poky-linux-gnueabi
arm-poky-linux-gnueabi-gcc --version

Then modify the script of the spi example and change the kernel directory to the directory of the factory system:

Enter the following command to compile the driver module file: make

After successful compilation, a driver module file named "icm20608.ko" will be generated.

Enter the command to enable hardware floating point compilation icm20608App.c test program: arm-linux-gnueabihf-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard icm20608App.c -o icm20608App After successful compilation, icm20608App will be generated. Copy the compiled icm20608.ko and icm20608App files to the rootfs/lib/modules/4.1.15 directory through nfs, restart the development board, and enter the directory lib/modules/4.1.15:

Enter the command to load the icm20608.ko driver module:

depmod //This command needs to be run when the driver is loaded for the first time

modprobe icm20608.ko //Load the driver module

After the driver module is loaded successfully, use icm20608App to test it and enter the following command:

./icm20608App /dev/icm20608 The test APP will continuously read data from ICM20608 and then output it to the terminal, as shown in the figure:

Subsequent research uses the SPI application layer API to read sensor data.

This post is from Linux and Android

Latest reply

I feel like sharing from a great God!  Details Published on 2023-7-2 12:58

6822

Posts

11

Resources
2
 
I feel like sharing from a great God!
This post is from Linux and Android
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list