Beyond Linux From Scratch: avrdude was compiled without usb support - linux

Out of interest and learning purposes I have built Linux from scratch (LFS+BLFS, both version 10.0) according to the descriptions on www.linuxfromscratch.org.
In general the OS can boot and I can basically work with it. There are a few things which are not smooth, therefore I would like to address the experts here.
I would like to get going the AVRDragon, a programmer for Atmel microcontrollers. To use it on Linux, I work with the program "avrdude". My goal is to learn how avrdude works and interacts with the OS. Therefore I would like to build it from source with debug information.
For building avrdude from source, libusb/libusb_1_0 and libelf are required. I understand that libusb_1_0 was installed with BLFS. avrdude asks for either libusb and/or libusb_1_0. I cannot say if there is a problem with having only libusb_1_0. (libusb_1_0 is newer than libusb, isn't it?) Additionally I have installed libelf (since libelf is installed, I cannot build the kernel anymore, but this should not be a problem for now). In the kernel, USB support is enabled (Device Drivers -> USB Support -> Support for Host-side USB).
I have created a udev rule:
# Dragon
ATTR{idVendor}=="03eb", ATTR{idProduct}=="2107", GROUP="plugdev", MODE="0666"
...and lsusb says this:
# lsusb
...
Bus 003 Device 006: ID 03eb:2107 Atmel Corp. AVR Dragon
...
Also, I use a script to program a sample application onto the microcontroller, which works on my reference system.
However, running avrdude on my BLFS, I get an error message, that avrdude was not built with USB support:
# avrdude -p m328p -c dragon_isp -B5 -F -P usb -V -U flash:w:Debug/hello_world.elf
avrdude was compiled without usb support.
avrdude done. Thank you.
Researching the internet, indicated installing the prerequisites stated above and setting up the udev rule.
I have a good understanding of the Linux command line, the GCC tool chain and the usual Linux tools. But I am completely lost with how to correctly configure my BLFS with USB support. Is there somebody who can give me a hint on how to solve this problem? Many thanks!

Apparently, for full functionality you need both libusb-1.0 and libusb-0.1. The configure.ac script defines HAVE_LIBUSB_1_0 only for the former and HAVE_LIBUSB for the latter, while the *.c files containing your error message only check for HAVE_LIBUSB.
While current BLFS doesn't have instructions to build libusb-0.1, you can see them for libusb-0.1.12 in BLFS 6.3.

Related

Ubuntu 16.04.3 intel skylake i915 external monitor not detected

My external monitor, connected via HDMI was working fine but now is not being detected (it says 'No video input'). I'm pretty sure I didn't make any changes to make it stop - it was working on the same setup yesterday.
I'm a pretty new linux user and also don't know much about graphics hardware and drivers. Appreciate any help, I'd like to understand what's going on!
I'm running Ubuntu 16.04.3 kernel 4.10.0-33
lshw -c video gives:
*-display
description: VGA compatible controller
product: Sky Lake Integrated Graphics
vendor: Intel Corporation
physical id: 2
bus info: pci#0000:00:02.0
version: 07
width: 64 bits
clock: 33MHz
capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
configuration: driver=i915 latency=0
resources: irq:124 memory:f0000000-f0ffffff memory:e0000000-efffffff ioport:e000(size=64) memory:c0000-dffff
I've tried booting from grub into kernel 4.8.0 and the monitor still wasn't detected.
I've also tried to no avail:
sudo apt-get update
sudo apt-get install --reinstall xserver-xorg-video-intel xserver-xorg-core
sudo dpkg-reconfigure xserver-xorg
I've also tried running the Intel graphics update tool and this also hasn't solved anything.
EDIT: It seems like I get the 'No video input' probelm if I plug in the HDMI cord before the computer has finished booting.
Pretty much the only answer one can give here based on the available information is, try checking the display cables, and, if that doesn't help, file a bug. Debugging display problems like this can be fairly involved, with several cycles of requesting and providing more information. That doesn't really work all that well here.
The alternatives for filing the bug are Ubuntu Launchpad and drm/i915 upstream. Upstream has the best knowledge about the driver and the hardware, but, depending on the issue, you might be expected to build and run the userspace components or the kernel from upstream git repositories.
I come across the problem and solve it with exactly the same card (i had same lshw -c video) by searching the NVIDIA X-Server settings (search inside apps) on my Ubuntu 16 LTS and activate the NVIDIA drivers for this card (I have a NVIDIA GEFORCE GTX)
After i log out and i have a bad errors display and i was blocked " this computer is running in low display mode" .
I just switch off the computer and restart it...and taatatatat HDMI was working and was able to display on my external Sansumg 27''
I had the exact same issue as OP. lshw not showing HDMI port, nada. Reinstalling xserver* did not work either.
May the gods of stack overflow smile upon you for that EDIT line, because plugging only after boot was complete, it did work for me as well.
This is quite interesting, as I am running 20.04. This issue came out of nowhere, just turned on the computer and voila, it was not working. There had been no updates, no changes that could affect this during previous session.
Would love to know if someone else has bumped into this problem.

hcidump binary not found

I'm setting up the BlueZ protocol stack on a custom system using linux 3.3. I'm using buildroot to setup the filesystem, and specifically am using BlueZ-4.101.
I'm attempting to use the hcidump utility to get some logs, but the binary has not been installed.
I've checked that:
Device driver is installed in kernel
BlueZ Utils is enabled in buildroot .config file
Other utilities work, such as hcitool or hciconfig
Going into the Makefile in output/build/bluez_utils-4.101 it would appear that the object file hcidump.o is being compiled into a binary called btmon.
Further investigation would reveal that in Makefile, btmonis assigned to am__EXEEXT_10, and that is then assigned to the variable noinst_PROGRAMS.
So this is where I'm at. I'm pretty sure that this is an automatically generated Makefile by buildroot. I'm not sure how these files are generated, thus I'm unsure as to why btmon is being assigned to the noinst_PROGRAMS variable.
In summary, I believe that my version of BlueZ uses a binary btmon instead of hcidump. btmon is compiled (binary seen at output/build/bluez_utils-4.101/monitor/btmon), but not being installed onto my target system because of instructions in Makefile.
My best guess would something weird about compatibility between my kernel version and bluez. Any suggestions would be greatly appreciated!
In BlueZ 4, hcidump was distributed as a separate package, bluez-hcidump. This has never been packaged in buildroot, however. So either create your own package for bluez-hcidump, or switch to BlueZ 5. BleuZ 5 is provided by buildroot starting from 2014.08.

Can`t find ttyUSB[id]

I have just started with my Raspberry Pi and I have a project where I want to read data from the USB port. I have installed Java JDK8 and written the program that compiles and run. But I get the message that /dev/ttyUSB1 does not exist.
I just have a cable from the USB port on the Arduino going to the USB port on the RPi and I am using Raspbian Debian Wheezy
When I go to DIR /dev/ and use $ ls, I can only find tty0 up to tty63. I have searched on the internet and some say that you can use ttyAMA0, but this does not work. I have also searched for the same problem, but have not found a answer to my problem.
I have used $ lsusb which gave me 4 devices (001-004) on Bus 001. I can see that, for example, my USB keyboard is listed as Bus 001 Device 004: ID 1532:010b Razer USA, Ltd.
and if I run $ dmesg | grep Manufacturer I get that:
[xxxxxxxxx] usb 1-1.2: Manufacturer: Razer
So my question is why does my usb devices not get listed as ttyUSB[id]? Do I have to manually attach it?
I am a bit noob when it comes to Linux.
Hope someone can help me!
I have some bad news for you. The reason you have no /dev/ttyUSB[n] devices on the RPi (when you connect your Arduino) is because you need the Arduino drivers (FTDI drivers in particular). The unfortunate thing is that these drivers don't yet exist for the Arm platform (which includes the RPi). This is according to the FTDI web page showing support. Note the lack of Linux driver support for Arm.
Apparently on Arm running Linux the only way to program the Arduino is via the serial port interface directly via the GPIO pins. Information on doing this can be found here . You will also have to do something similar on the Arduino side see this information.
Once you have the two devices connected via straight serial then your going to probably run into another SNAFU. By default apparently on the RPi Linux will use the serial port for sending debug/console output. In order to use the serial interface for something that behavior has to be modified. This article discusses that. In particular disabling the kernel from using the serial port for terminal use this would seem to apply:
The following steps (based on a clean 2012-07-15-wheezy-raspbian install
Open a terminal on the Raspberry, or connect to Raspberry Pi through SSH.
Make a backup of the /boot/cmdline.txt file.
sudo cp /boot/cmdline.txt /boot/cmdline_backup.txt
Edit /boot/cmdline.txt file:
sudo vi /boot/cmdline.txt
This file contains:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 $
Remove the parameters that reference the UART serial port (ttyAMA0):
dwc_otg.lpm_enable=0 console=tty1 $
Comment next line in /etc/inittab:
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Reboot Raspberry Pi
sudo reboot
If you use a different Linux distro than Debian it would be different but the basics would still apply (modifying the kernel command line)

How can I write a driver for an asus trackpad on linux?

I bought a laptop and installed Linux on it and the trackpad is now not working but it was on Windows. There is no linux driver for it and I thought this could be a good project to write one.
I have read and implemented tutorials on device drivers for simple things (turning on an led on a pandaboard) but I have no idea where to start here. Related questions pointed to commands like modprobe -r psmouse and it seems the trackpad is not seen at all.
Any idea ? the laptop is : Asus R409C.
A temporary fix is to boot with "psmouse.proto=bare" on the kernel cmdline.
$ sudoedit /etc/default/grub
Change GRUB_CMDLINE_LINUX_DEFAULT to add psmouse.proto=bare at the end, and save your modifications.
Then:
$ sudo update-grub
And finally reboot.
i think linux input subsystem can be used to write driver for touchpad. Exact details need to be considered. But most of the input devices can be integrated using input subsystem.

Build a minimum system with Qt embedded and run on Qemu for x86

My aim: Trying to
Build a minimal Qt based GUI system with a single window and sensor connected on USB
demonstrate this using Qemu and later on embedded board with atom
to build it from scratch
Use buildroot to build the rootfilesystem
My experience Have experience in Linux kernel development for device drivers, qemu, Buildroot, USB but has no experience on GUI and framebuffers.
My attempts:Build kernel and rootfile system
with buildroot using the command make qemu_x86_defconfig
Framebuffer support on Linux kernel is enabled along with the following CONFIG_FB, CONFIG_FRAMEBUFFER_CONSOLE, and CONFIG_LOGO (all the options below this are also enabled)
As the first milestone I expected to see the TUX logo when I run the image with the command
qemu-system-i386 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2 -append root=/dev/sda -vga std but i donot.
Am I making a mistake at the Qemu command or the framebuffer is not enabled?
P.S. A similar question Qt application GUI -- automatic start -- linux. But i am not planning to use the X window as suggested by most users.
I missed the cirrus graphics board driver. Qemu emulates Cirrus CLGD 5446 PCI VGA card or dummy VGA card with Bochs VESA extensions (hardware level, including all non standard modes for i386.
So the steps are:
Download buildroot
make clean
make qemu_x86_defconfig
make linux-menuconfig to configure kernel and in Device drivers->Graphics support->Support for frame buffer devices enable Cirrus Logic support
Save the configuration and run make
Once make is complete run the command in board/qemu/x86/readme.txt
Where did you see that Buildroot has a i386_defconfig? You seem to be confusing kernel defconfigs and Buildroot defconfigs. I would recommend you to start with:
make clean
make qemu_x86_defconfig
make
and then read board/qemu/x86/readme.txt to see how to run the generated system.

Resources