embedded-linux

Writing a device driver for Platform Bus in Embedded Systems?

こ雲淡風輕ζ 提交于 2019-12-24 02:08:56
问题 I have gone through some driver implementation in Linux Kernel Source and can see that these are the platform driver. drivers/net/ethernet/smsc/smsc911x.c static struct platform_driver smc911x_driver = { .probe = smc911x_drv_probe, .remove = smc911x_drv_remove, .suspend = smc911x_drv_suspend, .resume = smc911x_drv_resume, .driver = { .name = CARDNAME, .owner = THIS_MODULE, }, }; Above is a driver for platform device(smsc based Ethernet controller) and platform devices are devices which are

How to read RTS/CTS pins' values on Linux?

℡╲_俬逩灬. 提交于 2019-12-24 02:05:53
问题 I would like to know the status of RTS/CTS pins on the serial port on my Linux machine. Also, since I am using /dev/ttyUSB0 will the same mechanism work? Regards, Aakash 回答1: It is usually recommended to use termios for interacting with a serial port but I believe RTS/CTS access is not supported. You will need to use ioctl(2) along with TIOCMGET and TIOCMSET. You can see an example here. Your USB dongle probably supports RTS/CTS but there are many different USB serial devices and not all of

Writing AT commands embedded linux

旧巷老猫 提交于 2019-12-24 01:42:27
问题 I am having issues writing AT commands to a GSM module. It works flawless when i use minicom -b 115200 -D /dev/ttySP0 --term=vt100 But i cant figure out how to do the same thing in C code. I do not receive any errors, but the module does no react to the commands. Anyone know what could be wrong? #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <termios.h> #include <stdio.h> #define BAUDRATE B115200 #define COM1 "/dev/ttySP0" static int fd; static struct termios oldtio

How to install packages or natively compile package on a minimal Linux kernel compiled with Buildroot

耗尽温柔 提交于 2019-12-24 00:28:51
问题 I enconter a problem I hope to be solved quickly. I have grace to BUILDROOT compile a Linux zImage Kernel, build a rootfs, have a bootloader, so everething is right. But at the boot, the system is so minimal that i don't have got some package manager like apt-get, yum, etc.... Despite the fact i've got the network (wget is possible), I don't know how to have a simply gcc in my host (Buildroot don't permit to compile gcc anymore) or more simply a package manager. It is so boring to cross

signal handler not called for dlopen or dlclose

天大地大妈咪最大 提交于 2019-12-23 22:26:05
问题 I am receiving segmentation fault in random time. I registered the signal but signal handler not called when segmentation fault occurred #include <unistd.h> #include <dlfcn.h> #include <iostream> #include <signal.h> #include <execinfo.h> #include <stdlib.h> #include <errno.h> #include <string.h> #include <stdio.h> using namespace std; void Handler(int sig) { cout << "handler called " << strsignal(sig) << endl; exit(1); } int main() { cout << "Testing crash !" << endl; signal(SIGSEGV, Handler)

Linux, ARM: Why is gpiochip<num> only created if I2C GPIO Expander is present at boot?

淺唱寂寞╮ 提交于 2019-12-23 15:50:38
问题 Using Linux 3.14.52 on a imx6sx hardware platform (NXP embedded ARM). The problem is that PCF8575 I2C GPIO expanders specified in the device tree are not instantiated as devices in the /sys/class/gpio structure unless they are present during kernel boot. The devices are listed in the /sys/bus/i2c/devices/i2c-1 (i2c bus 1) structures but are not given gpiochip 's in the /sys/class/gpio structure. Is there a way to have these devices assigned as gpiochip after boot once they are added to the

Deciphering Device Tree

与世无争的帅哥 提交于 2019-12-23 05:28:04
问题 Here is an excerpt I pulled from a device tree on my embedded Linux Kernel. This is how I understand it now: 1) The aemif interface is located at physical address 0x30000000 2) The aemif driver is located in a file called davinci_aemif.c and it uses a clock called aemif 3) The aemif has 2 devices on it, one being cs2 and the other being nand (I don't think this assumption is correct) Now for the Questions: 1) What is the line reg = <0x21000a00 0x100>; doing? How can the aemif which is located

Start QT Application on bootup on an Embedded Linux Device (Beaglebone Black)

爱⌒轻易说出口 提交于 2019-12-23 05:20:13
问题 Below is picture of the display on bootup. Expected display is overwritten by Angstrom screen Expected Display Application is been started as a service. Below is the content of the service file [Unit] Description=QTAccelerometer GUI After=systemd-user-sessions.service [Service] WorkingDirectory=/home/root/projects/qt-projects ExecStart=/home/root/projects/qt-projects/QTAccelerometer -qws SyslogIdentifier=QTAccelerometer Restart=on-failure RestartSec=5 [Install] Alias=display-manager.service

Can't increment a 0-padded number past 8 in busybox sh

南笙酒味 提交于 2019-12-23 04:24:26
问题 this is the code I am using to save files from a camera and name them from 0001 onward. The camera is running Busybox, and it has an ash shell inside. The code is based on a previous answer by Charles Duffy here. #!/bin/sh # Snapshot script cd /mnt/0/foto sleep 1 set -- *.jpg # put the sorted list of picture namefiles on argv ( the number of files on the list can be requested by echo $# ) while [ $# -gt 1 ]; do # as long as there's more than one... shift # ...some rows are shifted until only

YOCTO : can't insert linux module to the kernel : versions are different

对着背影说爱祢 提交于 2019-12-23 02:52:58
问题 I'm using YOCTO PROJECT to build a linux os for my embedded board. I have a module named uleds which i want insert to my kernel so i taped this insmod command: insmod /lib/modules/4.14.73-linux4sam-6.0-dirty/kernel/drivers/leds/uleds.ko But an errors comes out : uleds: version magic '4.14.88-01445-g234c56a01768-dirty mod_unload ARMv7 p2v8 ' should be '4.14.73-linux4sam-6.0-dirty mod_unload ARMv7 p2v8 ' uleds: version magic '4.14.88-01445-g234c56a01768-dirty mod_unload ARMv7 p2v8 ' should be