embedded-linux

adding i2c client devices on x86_64

与世无争的帅哥 提交于 2019-11-27 15:24:55
On my x86_64 board, there is i2c-bus coming out of a MFD device. There are devices on to this i2c-bus. I am able to detect these devices using i2cdetect program. # i2cdetect -y 0 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- 4c -- -- -- 50: -- -- -- -- -- -- -- 57 -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- I need

How to add a peridic timer callback in a linux kernel module

让人想犯罪 __ 提交于 2019-11-27 15:10:23
问题 I am working on a Linux kernel module that registers a callback for interrupts that come from a custom-made board and puts the received data in a queue behind a char device interface to be processed by an application. This module needs to constantly monitor and measure the interrupts and data that comes from the board even if no interrupt comes from the board, so it has another callback that triggers according to time. Current implementation uses RTC interrupt as a constant timer source. I

Explaination of ARM (especifically mobile) Peripherals Addressing and Bus architecture?

馋奶兔 提交于 2019-11-27 14:53:29
I will first say that I'm not expert in the field and my question might contain misunderstanding, in which case, I'll be glad if you correct me and attach resources so I can learn further details. I'm trying to figure out the way that the system bus and how the various devices that appear in a mobile device (such as sensors chips, wifi/BT SoC, touch panel, etc.) are addressed by the CPU (and by other MCUs). In the PC world we have the bus arbitrator that route the commands/data to the devices, and, afaik, the addresses are hardwired on the board (correct me if I'm wrong). However, in the

Write a bash shell script that consumes a constant amount of RAM for a user defined time [closed]

穿精又带淫゛_ 提交于 2019-11-27 14:36:50
I am trying to write a bash shell script that consumes a high amount of RAM on an embedded device for a user defined time. How do I do it without using arrays ? Even if traditional Bash arrays are not supported, it may still be possible to create array-like variables using the eval command built into the particular shell. The following example script is based on some scripting I did when using BusyBox in an embedded Linux project. BusyBox uses the Almquist shell (also known as A Shell, ash, and sh), which does not support arrays. #!/bin/ash for index in 1 2 3 4 5; do value=$(($index * 1024))

How do the files in '/dev' match Linux's model of a device? [closed]

亡梦爱人 提交于 2019-11-27 14:14:37
Here is my understanding in opening to a file for reading/writing. In the application layer, I can invoke the fopen() function. The fwrite() function will invoke a system call open() . After the OS receives the open() call, it will pass the command to VFS(virtual file system). VFS looks up the file name, including any directories needed and does the necessary access checks. If this is in RAM cache then no disk access is needed. If not, the VFS sends a read request to the specific file system which is probably EXT4. Then the EXT4 file system driver will determine in what disk block that

Pass large amount of binary data from u-boot to linux kernel

青春壹個敷衍的年華 提交于 2019-11-27 13:21:22
Have some issues with passing large amount of data (3 MB) from uboot to linux kernel 2.6.35.3 on imx50 ARM board. This data is required in kernel device driver probe function and then it should be released. First uboot load data from flash to RAM, then pass physical address for linux kernel using bootargs. In kernel I try to reserve certain amount of memory using reserve_resource() in arch/arm/kernel/setup.c file: --- a/arch/arm/kernel/setup.c Tue Jul 17 11:22:39 2012 +0300 +++ b/arch/arm/kernel/setup.c Fri Jul 20 14:17:16 2012 +0300 struct resource my_mem_res = { .name = "My_Region", .start =

how to use the libnl library to trigger nl80211 commands?

廉价感情. 提交于 2019-11-27 11:23:35
问题 Please can someone give an simple example on how to use libnl to use nl80211. I tried to go through iw source code but it is very confusing. Can any one give a simple program on how to trigger nl80211 commands such as NL80211_CMD_GET_WIPHY using the libnl. 回答1: Here is a very basic program sending a NL80211_CMD_GET_INTERFACE , and parsing out the interface type returned in the NL80211_CMD_GET_INTERFACE attribute. Beware, there is very little error checking here, you should not use any of this

Cross compile mono for arm

99封情书 提交于 2019-11-27 09:09:40
Has anyone successfully cross-compiled mono for ARM under Linux without scratchbox or qemu? (maybe with distcc or some cross-compiler toolchain) retek4 I managed to cross compile mono(2.0, 2.4, 2.6, 2.8, 2.10.1) with Scratchbox 2 installed on a Ubuntu machine using CodeSourcery Lite tool chain. I used the article from the Mono project page . First compile it on the native machine ./configure $ make $ make install DESTDIR=path Then in sb2: [sbox-ARMEL: ~] > ./configure --disable-mcs-build [sbox-ARMEL: ~] > make [sbox-ARMEL: ~] > make install DESTDIR=path I use this for configuration ./configure

what does “-sh: executable_path:not found” mean

本小妞迷上赌 提交于 2019-11-27 08:37:38
问题 i am trying to run an executable in linux shell ( OpenELEC on raspberry pi ) OpenELEC:~ # /storage/fingi/usr/lib/autossh/autossh -sh: /storage/fingi/usr/lib/autossh/autossh: not found What does the "not found" in this case mean ? If i try to do ldd: OpenELEC:~ # ldd /storage/fingi/usr/lib/autossh/autossh /usr/bin/ldd: eval: line 1: /storage/fingi/usr/lib/autossh/autossh: not found And if i do file: OpenELEC:~ # file /storage/fingi/usr/lib/autossh/autossh /storage/fingi/usr/lib/autossh/autossh

What does request_mem_region() actually do and when it is needed?

青春壹個敷衍的年華 提交于 2019-11-27 07:06:57
I'm studying on writing embedded linux driver, and decided to fire a few GPIOs to make sure I understand the book (LDD3, chap9.4.1) correctly. I am able to control the correct GPIO pins as intended (making it high and low, I probed with a multimeter); however, I tested 2 pieces of code, one with request_mem_region() , and one without. I'm expecting the one without will fail, but both is working just fine. Code with request_mem_region : if( request_mem_region( PIN3_CONF_PHYS, MAPPED_SIZE_GPIO_CONF,DEVICE_NAME ) == NULL ) { printk( KERN_ALERT "GPIO_140_141_conf_phys error:%s: unable to obtain I