Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
1
answers
32
views
How is an overlayfs different from just mounting another disk/partition over a directory?
I have OpenWRT installed on some of my routers and to add additional storage for settings as well as programs that might be installed on the router and maybe logs, OpenWRT recommends you plug storage into it and use an overlayfs. I also have a SBC where I just mount an external drive overtop of my h...
I have OpenWRT installed on some of my routers and to add additional storage for settings as well as programs that might be installed on the router and maybe logs, OpenWRT recommends you plug storage into it and use an overlayfs.
I also have a SBC where I just mount an external drive overtop of my home directory on boot to store the home directory externally off of the SD Card that the bootloader and OS are installed on; since the storage on the external drive is more reliable than the SD Card, despite running slower.
What is the difference between these two strategies? They are both basically Single Board computers with Linux, and when the external drive fails to mount, in both cases we're left with a directory full of the content of the original directory, where the drive would have been mounted before.
The only think I can think of that is different, is that the settings directory for OpenWRT (
/etc
) is being mounted on the external drive, where this is not the case on the SBC.
leeand00
(4927 rep)
Aug 5, 2025, 08:58 PM
• Last activity: Aug 6, 2025, 05:22 AM
0
votes
2
answers
2325
views
Could not find libmount
During compilation of customized distribution (using buildroot v. 11.2018) I have problem with libmount library (the problem appeared after I had included efl package in buildroot menuconfig - *Target packages -> Graphic lib... -> efl* ). I have additionaly installed package libmount-dev with no res...
During compilation of customized distribution (using buildroot v. 11.2018)
I have problem with libmount library (the problem appeared after I had included efl package in buildroot menuconfig - *Target packages -> Graphic lib... -> efl* ).
I have additionaly installed package libmount-dev with no results.
checking for getxattr in -lc... yes
checking sys/xattr.h usability... yes
checking sys/xattr.h presence... yes
checking for sys/xattr.h... yes
checking for XATTR_NOFOLLOW... no
checking for LIBMOUNT... no
configure: error: *** Could not find libmount
How to include this library to obtain succesful compilation?
Fasset
(11 rep)
Nov 20, 2018, 07:04 PM
• Last activity: Jul 30, 2025, 11:01 PM
1
votes
2
answers
3392
views
Cross-compile libgpiod library and use it in my program
I am trying to cross-compile a program with the "gpiod" library. My host pc has Ubuntu 18.04 and the target platform I am cross-compiling for is a Board with IMX8X SOM. I found source code at https://variwiki.com/index.php?title=MX8_GPIO&release=RELEASE_DUNFELL_V1.3_VAR-SOM-MX8X and I wanted to comp...
I am trying to cross-compile a program with the "gpiod" library.
My host pc has Ubuntu 18.04 and the target platform I am cross-compiling for is a Board with IMX8X SOM.
I found source code at https://variwiki.com/index.php?title=MX8_GPIO&release=RELEASE_DUNFELL_V1.3_VAR-SOM-MX8X and I wanted to compile it, following the paragraph "2.2 libgpiod C Application".
The OS used in my board is the "dunfell" distro compiled with Yocto. The cross-compiler I am using is also created as sdk withing the Yocto environments (aarch64-fslc-linux-gcc).
When I compiled, I firstly obtained
"fatal error: gpiod.h: No such file or directory"
So, this library is not included by default in the provided toolchain.
So I tried to install the (cross)library in my pc, following the instructions at https://www.beyondlogic.org/an-introduction-to-chardev-gpio-and-libgpiod-on-the-raspberry-pi/ , but it did not work. The second error I get is
/opt/fslc-wayland/3.1/sysroots/x86_64-fslcsdk-linux/usr/libexec/aarch64-fslc-linux/gcc/aarch64-fslc-linux/9.3.0/real-ld: cannot find -lgpiod
collect2: error: ld returned 1 exit status
These are my compilation flags:
CFLAGS = -Wall -I$(INCLUDE) --sysroot=${SDKTARGETSYSROOT} -Og -lgpiod
I am new to this kind of issues and I hope I am making trivial mistakes.
Thanks in advance if someone is able to help!
powermignolo
(11 rep)
Dec 29, 2021, 11:56 AM
• Last activity: Jul 15, 2025, 08:07 AM
0
votes
2
answers
2079
views
Kernel panic - not syncing: Requested init /init failed (error -2)
Attaching a bit more of the boot log. ``` HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages iommu: Default...
Attaching a bit more of the boot log.
HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
iommu: Default domain type: Translated
iommu: DMA domain TLB invalidation policy: strict mode
SCSI subsystem initialized
EDAC MC: Ver: 3.0.0
clocksource: Switched to clocksource arch_sys_counter
workingset: timestamp_bits=62 max_order=19 bucket_order=0
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
io scheduler mq-deadline registered
cacheinfo: Unable to detect cache hierarchy for CPU 0
brd: module loaded
VFS: Mounted root (tmpfs filesystem) on device 0:15.
Freeing unused kernel memory: 704K
Run /init as init process
with arguments:
/init
with environment:
HOME=/
TERM=linux
Kernel panic - not syncing: Requested init /init failed (error -2).
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.15.0-rc7-00001-g8d7daa446b53-dirty #33
Call trace:
dump_backtrace+0x0/0x1d0
show_stack+0x14/0x20
dump_stack_lvl+0x64/0x7c
dump_stack+0x14/0x2c
panic+0x158/0x304
kernel_init+0xf0/0x150
ret_from_fork+0x10/0x20
Kernel Offset: disabled
CPU features: 0x00001001,20000802
Memory Limit: none
---[ end Kernel panic - not syncing: Requested init /init failed (error -2). ]---
I am building an embedded linux OS for an experimental FPGA platform. I used upstream U-boot(boot-loader), linux(kernel) and buildroot(just for filesystem).
I followed some examples and enabled the required initrd/initramfs support in my linux config.
CONFIG_BLK_DEV_INITRD=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=1
CONFIG_BLK_DEV_RAM_SIZE=10240
I used the bootm command in u-boot to load a FIT image that comprises of the linux kernel, dtb and the rootfs.cpio(compiled from buildroot). Relevant info here:FIT_Test
These are the bootargs passed to the kernel:
console=ttyS0,9600 earlyprintk maxcpus=1 earlycon root=/dev/ram init=/init rw rootfstype=tmpfs debug
**Note:**
Couple of other things I tried , but resulted in the same error.
- Passing the kernel,dtb and fs image separately.
- Tried a basic initramfs with just an init script , simple directory structure and a separately compiled busybox placed in /bin/busybox with symbolic links.
- Rather than passing an external FS, I passed the path to the initramfs source and compiled it into the kernel with CONFIG_INITRAMFS_SOURCE.
I would appreciate any feedback/pointers on what I could be missing, been stuck on this for while now.
rish_1n4
(1 rep)
Dec 16, 2021, 07:02 PM
• Last activity: Jul 4, 2025, 01:07 PM
1
votes
0
answers
24
views
UVC camera only works properly when usbmon is running
I have the following setup:\ i.MX8MM + uDP72020 (PCIe to USB-3.0) + UVC-Camera\ Linux: 6.6.69\ GStreamer: 1.24.0 (imx) GStreamer pipeline I am using: ``` gst-launch-1.0 -e -vvv v4l2src device=/dev/video0 \ ! video/x-raw,width=1920,height=1080,format=YUY2,framerate=30/1 \ ! imxvideoconvert_g2d ! kmss...
I have the following setup:\
i.MX8MM + uDP72020 (PCIe to USB-3.0) + UVC-Camera\
Linux: 6.6.69\
GStreamer: 1.24.0 (imx)
GStreamer pipeline I am using:
gst-launch-1.0 -e -vvv v4l2src device=/dev/video0 \
! video/x-raw,width=1920,height=1080,format=YUY2,framerate=30/1 \
! imxvideoconvert_g2d ! kmssink connector-id=35 can-scale=false sync=false
Unfortunately this doesn't work, as I get around 1 fps.
Lower resolutions like 1280x720 work fine.
So I thought maybe it is a performance issue on the host side, but the i.MX8MM should be able to handle this resolution.
While debugging the issue and looking into stuff, I started usbmon to maybe see errors or something. But as soon as I started usbmon, everything worked fine, even at 1920x1080@30fps.
So the above GStreamer pipeline only works when usbmon is running at the same time!
So my question now is, why?
Why is the USB communication suddenly so much better when usbmon is running and logging all the traffic?
Is there anything usbmon does, which I could potentially also do to improve my setup?
Thank you and best regards,
Stefan
user1243392
(11 rep)
Jun 18, 2025, 09:56 AM
27
votes
3
answers
8883
views
Can I achieve functionality similar to interrupts in Linux userspace?
One of functionalities I miss the most from "small embedded" in Embedded Linux is the interrupts. A signal appears on a specific pin, or other interrupt source is triggered and whatever was done inside the CPU gets interrupted, and my function of interrupt handler is launched. In Linux everything is...
One of functionalities I miss the most from "small embedded" in Embedded Linux is the interrupts. A signal appears on a specific pin, or other interrupt source is triggered and whatever was done inside the CPU gets interrupted, and my function of interrupt handler is launched. In Linux everything is buffered, if something happens the system just goes about its own course and when (at last) given thread is brought to foreground, its wait-state expecting the external source ends, and its handler starts.
The closest thing I know are the signals, which can trigger a handler interrupting normal flow of the thread, but still, the handler will not pick up the signal until the kernel brings the thread into foreground, which may be many milliseconds after the signal happened - and triggering the signals isn't as robust either; I need an app or a kernel module to send a signal, I can't just trivially attach it to a GPIO pin.
How could I achieve a functionality similar to hardware interrupts within Linux userspace software - have a specific function launched or specific thread brought to foreground immediately after an externally sourced condition is triggered, without waiting for the process queue to bring my thread to foreground?
If you feel this question is too broad, let's narrow it to a specific example: a Raspberry Pi board receives a signal on one of its GPIO pins (not necessarily arbitrary; if only some pins can do that, that's okay.) I want my userspace application to react to this event within least time possible, be it bringing it out of wait state, launching a handler function or any equivalent mechanism, but above all not waiting for the task queue to cycle through all pending processes before the handler is brought to foreground, but trigger it ASAP. (and specifically, when there is no signal, not leaving the system locked forever with the handler process occupying 100% CPU time polling the input and never yielding to the OS.) Is there such a mechanism?
SF.
(2971 rep)
May 21, 2014, 03:45 PM
• Last activity: Jun 10, 2025, 02:38 AM
2
votes
1
answers
5392
views
sfdisk doesn't work anymore?
I updated my OS to Ubuntu GNOME 15.10 but now I have a huge issue : sfdisk doesn't work! I really need it to build partitions on my SD cards for an embedded Linux but it seems that the options changed. How to do to keep it working? Here is the script I use : CARD_DEV=$1 unset LANG umount ${CARD_DEV}...
I updated my OS to Ubuntu GNOME 15.10 but now I have a huge issue : sfdisk doesn't work!
I really need it to build partitions on my SD cards for an embedded Linux but it seems that the options changed. How to do to keep it working?
Here is the script I use :
CARD_DEV=$1
unset LANG
umount ${CARD_DEV}* >& /dev/null
if [ -b "$CARD_DEV" ] ; then
echo "*************** Formatting SD card... ***************"
dd if=/dev/zero of=$CARD_DEV bs=1024 count=1024
SIZE=
fdisk -l $CARD_DEV | grep Disk | awk '{print $5}'
echo DISK SIZE - $SIZE bytes
CYLINDERS=echo $SIZE/255/63/512 | bc
echo CYLINDERS - $CYLINDERS
{
echo 1,9,0x0C,*
echo 10,,,-
} | sfdisk -D -H 255 -S 63 -C $CYLINDERS $CARD_DEV
mkfs.vfat -F 32 -n "boot" ${CARD_DEV}1
mke2fs -j -L "filesystem" ${CARD_DEV}2
fi
And I get :
sfdisk: invalid option -- 'D'
sfdisk [options] [[-N] ]
sfdisk [options]
Display or manipulate a disk partition table.
Commands:
-A, --activate [ ...] list or set bootable MBR partitions
-d, --dump dump partition table (usable for later input)
-g, --show-geometry [ ...] list geometry of all or specified devices
-l, --list [ ...] list partitions of each device
-s, --show-size [ ...] list sizes of all or specified devices
-T, --list-types print the recognized types (see -X)
-V, --verify test whether partitions seem correct
--part-label [] print or change partition label
--part-type [] print or change partition type
--part-uuid [] print or change partition uuid
--part-attrs [] print or change partition attributes
device (usually disk) path
partition number
partition type, GUID for GPT, hex for MBR
Options:
-a, --append append partitions to existing partition table
-b, --backup backup partition table sectors (see -O)
--bytes print SIZE in bytes rather than in human readable format
-f, --force disable all consistency checking
--color[=] colorize output (auto, always or never)
colors disabled by default
-N, --partno specify partition number
-n, --no-act do everything except write to device
--no-reread do not check whether the device is in use
-O, --backup-file override default backup file name
-o, --output output columns
-q, --quiet suppress extra info messages
-X, --label specify label type (dos, gpt, ...)
-Y, --label-nested specify nested label type (dos, bsd)
-L, --Linux deprecated, only for backward compatibility
-u, --unit S deprecated, only sector unit is supported
-h, --help display this help and exit
-v, --version output version information and exit
Available columns (for -o):
gpt: Device Start End Sectors Size Type Type-UUID Attrs Name UUID
dos: Device Start End Sectors Cylinders Size Type Id Attrs Boot End-C/H/S
Start-C/H/S
bsd: Slice Start End Sectors Cylinders Size Type Bsize Cpg Fsize
sgi: Device Start End Sectors Cylinders Size Type Id Attrs
sun: Device Start End Sectors Cylinders Size Type Id Flags
For more details see sfdisk(8).
Version:
sfdisk from util-linux 2.26.2
didil
(331 rep)
Nov 10, 2015, 02:10 PM
• Last activity: Jun 2, 2025, 09:05 PM
1
votes
2
answers
2369
views
Estimate RAM usage information of an embedded device
I'm monitoring the performance of an ARM-based embedded device which runs poky linux distro (from Yocto project) which contains OpenEmbedded build system. I need to get the MHz (CPU cycles) consumption and the RAM used for any process that runs on the system. Though `top` utility allows me to see th...
I'm monitoring the performance of an ARM-based embedded device which runs poky linux distro (from Yocto project) which contains OpenEmbedded build system. I need to get the MHz (CPU cycles) consumption and the RAM used for any process that runs on the system. Though
top
utility allows me to see the CPU % used (which allows me to estimate CPU MHz in turn), it just gives the *virtual memory size (VSZ)* used by the process but no *physical memory* used.
Is there a way I can get this information I need?
skrowten_hermit
(791 rep)
Mar 17, 2016, 10:53 AM
• Last activity: Jun 1, 2025, 02:06 AM
3
votes
1
answers
9501
views
U-boot: bad magic number
I'am using Arduino Yun and i want mount rootfs over NFS. I downloaded openwrt sources, build the project and then copied the generated rootfs from `build_dir/target-mips_34kc_musl-1.1.15/root-ar71xx` under `/home/user/srv/nfs/root-ar71xx` in the uboot prompt the command line i used is : setenv boota...
I'am using Arduino Yun and i want mount rootfs over NFS.
I downloaded openwrt sources, build the project and then copied the generated rootfs from
build_dir/target-mips_34kc_musl-1.1.15/root-ar71xx
under /home/user/srv/nfs/root-ar71xx
in the uboot prompt the command line i used is :
setenv bootargs root=/dev/nfs rw nfsroot=192.168.1.1:/home/user/srv/nfs/root-ar71xx ip=192.168.1.2:192.168.1.1:192.168.1.1:255.255.255.0::off; bootm
uboot environement variables:
ar7240> printenv
bootcmd=bootm 0x9fea0000
bootdelay=4
baudrate=115200
ethaddr=0xb4:0x21:0x8a:0x00:0x00:0x10
ipaddr=192.168.1.2
serverip=192.168.1.1
stdin=serial
stdout=serial
stderr=serial
ethact=eth0
bootargs=root=/dev/nfs rw nfsroot=192.168.1.1:/home/user/srv/nfs/root-ar71xx
ip=192.168.1.2:192.168.1.1:192.168.1.1:255.255.255.0::off
Environment size: 319/65532 bytes
But i got :
## Booting image at 81000000 ...
Bad Magic Number
I read in [this link](http://lists.denx.de/pipermail/u-boot/2006-May/014983.html) , that there is a kind of encapsulation for the kernel in order to be "known" by U-Boot. Is it the same thing for the rootfs
I have another question but it's not very related to the topic:
After building the project i have several binaries (24) under bin/ar71xx/
:
openwrt-ar71xx-generic-wzr-hp-ag300h-squashfs-tftp.bin
openwrt-ar71xx-generic-tl-mr11u-v1-squashfs-sysupgrade.bin
openwrt-ar71xx-generic-wzr-hp-g300nh2-squashfs-factory.bin
...
I expect only one kernel image what all these images are supposed to do ?
Thanks in advance.
**EDIT**:
I change the cmd line to :
setenv bootargs root=/dev/nfs rw nfsroot=192.168.1.1:/home/bou6/srv /nfs/root-ar71xx ip=192.168.1.2:192.168.1.1:192.168.1.1:255.255.255.0::off; bootm 0x9fea0000
and i don"t have Bad Magic Number
anymore, but still questions:
1- How can we know the load address of the kernel
2- I noticed even though the ethernet cable is not branched the kernel continue to use the default file system flashed on the Yun, is there a method to desactivate this.
Mouin
(195 rep)
Nov 23, 2016, 08:38 PM
• Last activity: May 25, 2025, 02:01 PM
0
votes
1
answers
2077
views
NFS mount failed after upgrading server, no route to host, embedded, nfsvers=4
After hours of reading and try and error process i'd like to explain my nfs mount problem and solution. I was working for years on a virtual **debian 8.5** host system to develop software for multiple embedded devices, based on imx, or raspi, beagle board and so on. During the development process it...
After hours of reading and try and error process i'd like to explain my nfs mount problem and solution.
I was working for years on a virtual **debian 8.5** host system to develop software for multiple embedded devices, based on imx, or raspi, beagle board and so on.
During the development process it's more than usefull to mount the embedded root partion over nfs from the host machine. The configuration is normaly straight forward.
# host configuration
# /etc/exports
/opt/tftpboot/rootfs *(rw,sync,insecure,no_subtree_check,no_root_squash)
- instead of wildcard it's recommend to use specific ips
- also remove the option insecure in productive enviroment
# client configuration
if the kernel supports the network file system it's pretty easy to configure the mounting of the root file system from the embedded / or remote system.
# example part of the kernel command line
root=/dev/nfs nfsroot=10.0.102.247:/opt/tftpboot/rootfs,nolock
By the way, with the new version of **nfs-kernel-server**, delivering with **debian 10.2** or **9.x** it's impossible to mount the root file system. The boot process stuck, no error log on host device, no error log on the remote system.
# testing from shell
I've tried to boot the remote system from flash and mount the remote folder from our busybox shell, but failed.
$ mount -t nfs 10.0.102.247:/opt/tftpboot/rootfs /mnt/nfs
no route to host
Ping works fine ;-) Also the firewall on the host side was well configured.
After exluding any other problem, like problems on the networking, i've changed the mount command to use the NFS V4 the mount command works like expected.
mount -t nfs -o nfsvers=4 10.0.102.247:/opt/tftpboot/rootfs /mnt/nfs
Thomas
(101 rep)
Jan 14, 2020, 01:54 PM
• Last activity: May 23, 2025, 12:01 PM
0
votes
1
answers
53
views
Allwinner A10 tablet - Not able to go past "Starting kernel..."
I had an old tablet lying around so I created the page according to linux-sunxi ([https://linux-sunxi.org/Softwinners_crane][1]). I was trying to get Linux running on it. A different tablet was similar (as also pointed out in another mailing list) to mine - Topwise A721, so I used it's .dts file for...
I had an old tablet lying around so I created the page according to linux-sunxi (https://linux-sunxi.org/Softwinners_crane ). I was trying to get Linux running on it.
A different tablet was similar (as also pointed out in another mailing list) to mine - Topwise A721, so I used it's .dts file for this.
After following the extensive documentation on the website, collecting all details and so on, I built u-boot and kernel and flashed them on an SD card. When trying to boot I get stuck at this screen, and then the display goes off:
U-Boot 2025.07-rc2-00018-g126a88d49bca (May 18 2023 - 10:35:18 +0530) Allwinner Technology
CPU: Allwinner A10 (SUN4I)
Model: Topwise A721
DRAM: 1 GiB
Core: 70 devices, 21 uclasses, devicetree: separate
WDT: Not starting watchdog@01c20c90
MMC: mmc@1c0f000: 0
Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1...
HDMI connected: Setting up a 1920x1080 hdmi console (overscan 0x0)
In: serial,usbkbd
Out: serial,vidconsole
Err: serial,vidconsole
Net: No ethernet found.
starting USB...
No host cable detected. Bus usb@01c13000: Port not available.
No USB controllers found
scanning USB for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc0:1...
Found U-Boot script /boot.scr
301 bytes read in 1 ms (293.9 KiB/s)
## Executing script at 43100000
24070 bytes read in 3 ms (7.7 MiB/s)
6105264 bytes read in 335 ms (21.6 MiB/s)
Kernel image @ 0x42000000 [ 0x000000 - 0x5d28b0 ]
## Flattened Device Tree blob at 43000000
Booting using the fdt blob at 0x43000000
Working FDT set to 43000000
Loading Device Tree to [49ff7000, end 49fffe05] ... OK
Working FDT set to 49ff7000
Starting kernel ...
How do I fix this?
Shivam Gupta
(1 rep)
May 21, 2025, 08:55 AM
• Last activity: May 21, 2025, 02:24 PM
0
votes
1
answers
22
views
Is it possible to connect a serial port visible from userspace back into the kernel's BlueZ stack?
I have a linux kernel and device tree that presents the userspace with a serial port /dev/ttymxc0. The serial port is connected to a Bluetooth device which is used by a user-space Bluetooth stack. If the kernel has BlueZ compiled in, is it possible (e.g. by sysfs magic) to connect the serial port tt...
I have a linux kernel and device tree that presents the userspace with a serial port /dev/ttymxc0.
The serial port is connected to a Bluetooth device which is used by a user-space Bluetooth stack.
If the kernel has BlueZ compiled in, is it possible (e.g. by sysfs magic) to connect the serial port ttymxc0 to BlueZ such that it appears as an hci device?
I know that I can do this by changing the device tree but wanted to know whether this was possible without rebooting with a different device tree?
srl100
(13 rep)
May 20, 2025, 03:16 PM
• Last activity: May 20, 2025, 03:19 PM
0
votes
0
answers
25
views
DE1-SOC 5CSEMA5F31 isn't detected in Quartus Program Device
I'm having trouble programming my DE1-SoC from the Quartus Programmer. The board is powered and connected correctly and I've managed to find and program it before, multiple times, but even then Quartus was very inconsistent in finding it. I tried to understand under what circumstances it finds the b...
I'm having trouble programming my DE1-SoC from the Quartus Programmer. The board is powered and connected correctly and I've managed to find and program it before, multiple times, but even then Quartus was very inconsistent in finding it. I tried to understand under what circumstances it finds the board but I really didn't do anything special in those times.
Under Hardware Setup --> Hardware Settings --> Currently selected hardware there only appears "No Hardware", and the DE1-SoC isn't listed:
I don’t manage to take a screenshot when the dropdown is opened, but the only option is “No Hardware” and the board isn’t listed.

$ ~/intelFPGA_standard/24.1std/quartus/bin/quartus_sh --version
Quartus Prime Shell
Version 24.1std.0 Build 1077 03/04/2025 SC Lite Edition
Copyright (C) 2025 Altera Corporation. All rights reserved.
$ uname -a
5.15.0-124-generic #134-Ubuntu SMP Fri Sep 27 20:20:17 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/udev/rules.d/51-usbblaster.rules
BUS=="usb", SYSFS{idVendor}=="09fb", SYSFS{idProduct}=="6810", MODE="0666"
$ cat /etc/modprobe.d/DE1-SoC.conf
alias usb:v09FBp6810* ftdi_sio
install ftdi_sio /sbin/modprobe -i ftdi_sio && /bin/echo 09fb 6810 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id
$ lsusb
Bus 001 Device 006: ID 10c4:ea70 Silicon Labs CP2105 Dual UART Bridge
I run Quartus using sudo. I tried Terasic support but they suggested to reinstall, I find it weird because the hardware will occasionally (very very rarely, and I don't know what determines it) be found.
I'm still in the state where I use simple, prepared projects, not something custom or fancy of my own, so I'm not deviating from the basic defaults. For example, I may run quartus and go Open Project --> ~/DE1-SoC_v.6.0.0_HWrevH_SystemCD/Demonstrations/FPGA/my_first_fpga/my_first_fpga.qpf
(Which is a trusted basic demonstration by Terasic)
and successfully compile. I would do the same thing on another educational project. In any case, the software would detect the hardware on occasions that seem random, and very scarce. This is very frustrating because it keeps me from moving forward.
Any help would be much appreciated
user656857
(11 rep)
Apr 30, 2025, 02:11 PM
1
votes
1
answers
2200
views
Jetson TX2 device tree, i2c nodes and camera driver loading
I am a bit confused with behavior of Jetson TX2 when loading drivers for camera. Here is definition of IMX274 in device tree: i2c@3180000 { reg = ; dmas = ; interrupts = ; compatible = "nvidia,tegra186-i2c"; clock-names = "div-clk", "parent", "slow-clk"; reset-names = "i2c"; clock-frequency = ; scl-...
I am a bit confused with behavior of Jetson TX2 when loading drivers for camera.
Here is definition of IMX274 in device tree:
i2c@3180000 {
reg = ;
dmas = ;
interrupts = ;
compatible = "nvidia,tegra186-i2c";
clock-names = "div-clk", "parent", "slow-clk";
reset-names = "i2c";
clock-frequency = ;
scl-gpio = ;
sda-gpio = ;
clocks = ;
resets = ;
status = "okay";
#address-cells = ;
phandle = ;
#stream-id-cells = ;
#size-cells = ;
dma-names = "rx", "tx";
linux,phandle = ;
imx274_a@1a {
reg = ;
mclk = "extperiph1";
devnode = "video0";
avdd-reg = "vana";
compatible = "nvidia,imx274";
clock-names = "extperiph1", "pllp_grtba";
reset-gpios = ;
physical_h = "2.738";
physical_w = "3.674";
clocks = ;
vana-supply = ;
sensor_model = "imx274";
iovdd-reg = "vif";
delayed_gain = "true";
vif-supply = ;
dvdd-reg = "vdig";
vdig-supply = ;
mode0 {
...
}
ports {
#address-cells = ;
#size-cells = ;
port@0 {
reg = ;
endpoint {
bus-width = ;
remote-endpoint = ;
phandle = ;
csi-port = ;
linux,phandle = ;
};
};
};
};
i2c2 is an alias for i2c@3180000 therefore I expect to see the device on bus 2. An sure I can see it on a bus with address
0x57
.
nvidia@tegra-ubuntu:~/kernel/kernel$ sudo i2cdetect -r -y 2
[sudo] password for nvidia:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
20: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- 57 -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Here comes the first question. **How does kernel identifies type of i2c device on a bus?** I thought that field reg
is used, but 0x1a in device tree is clearly different from 0x57 on a bus.
Secondly, as I can see module is compatible with the following drivers: compatible = "nvidia,imx274";
However device driver is different:
nvidia@tegra-ubuntu:~/kernel/kernel$ sudo v4l2-ctl -D -d /dev/video0
Driver Info (not using libv4l2):
Driver name : tegra-video
Card type : vi-output, imx274 2-001a
Bus info : platform:15700000.vi:0
Driver version: 4.4.38
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
**Therefore it seems for me that wrong driver is loaded for some reasons, it it true or I am just missing something?** However it is still possible to capture image with argus.
Юрий Камнев
(11 rep)
Jul 30, 2019, 10:20 AM
• Last activity: Apr 27, 2025, 10:02 AM
1
votes
0
answers
105
views
UDP multicast fails with "network unreachable" after static IP change on Linux 4.1
We have a requirement for UDP multicasting in our project using Linux 4.1 kernel with static ip address. Basic UDP multicasting by the use of the `sendto` function to send data works fine with device static ip 10.13.204.100; the issue comes when I change the ip address of the device to 10.13.204.101...
We have a requirement for UDP multicasting in our project using Linux 4.1 kernel with static ip address.
Basic UDP multicasting by the use of the
sendto
function to send data works fine with device static ip 10.13.204.100; the issue comes when I change the ip address of the device to 10.13.204.101 or to any other ip in the same series, the udp multicasting starts showing the error:
sendto: network unreachable
The UDP has been initialized by the following function:
int udp_init()
{
char multicastTTL = 10;
// Create UDP socket:
memset(&socket_desc, 0, sizeof(socket_desc));
socket_desc = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (socket_desc %d\nsocket_desc==>%d\n", udp_socket_fd, socket_desc);
/* Set the TTL (time to live/hop count) for the send */
// if (setsockopt(socket_desc, IPPROTO_IP, IP_MULTICAST_TTL, &multicastTTL, sizeof(multicastTTL)) %s:%d\n", __FILE__, __FUNCTION__, __LINE__);
return 1;
}
}
Once the ip has been changed, the UDP socket is closed by the instruction:
close(socket_desc)
Once again the udp_init
function (showed above) is used to initialize the UDP socket and then it is used the sendto
function to transmit the data but this causes the error:
sendto:network unreachable
thanks in advance
Rajesh
(23 rep)
Jan 4, 2023, 10:11 AM
• Last activity: Apr 24, 2025, 12:17 PM
1
votes
1
answers
4162
views
Managing systemd services on read-only filesystem
I am looking for strategies how to manage enabling and disabling of systemd services on a read-only filesystem. It's not possible as the multi-user.target.wants directory contents get modified. Keeping /etc/systemd/system as the default location for services, has anyone tried ways to manage the laun...
I am looking for strategies how to manage enabling and disabling of systemd services on a read-only filesystem. It's not possible as the multi-user.target.wants directory contents get modified.
Keeping /etc/systemd/system as the default location for services, has anyone tried ways to manage the launch 'table' / multi-user.target.wants directory such that an application or script running on the target can still enable or disable a specific service (or services) even though the filesystem is RO?
I have thought to symlink the multi-user.target.wants directory to a location on a small rw "config" partition and switch between pre-set multi-user.target.wants directories on boot/reboot according to the need. Alternatively, I suppose a script or application could directly modify this symlinked location by adding or removing entries from it.
I have not tested that yet; I wanted to see if anyone has experience with this, possible strategies, or know of a more standardized approach to this? Thank you.
chameleon
(31 rep)
Jul 21, 2022, 04:05 PM
• Last activity: Apr 17, 2025, 10:08 AM
4
votes
2
answers
7045
views
lsmod returns nothing on my embedded device
I have put a vendor supplied embedded Linux installation [(called X-Linux)][1] onto a hardware device. I ran `lsmod` to see what modules are loaded and nothing at all is shown. Also there is no /proc/modules directory on the system. What does this mean? Does it mean that no drivers are loaded to com...
I have put a vendor supplied embedded Linux installation (called X-Linux) onto a hardware device. I ran
lsmod
to see what modules are loaded and nothing at all is shown. Also there is no /proc/modules directory on the system. What does this mean? Does it mean that no drivers are loaded to communicate with the rest of the devices on the board (ethernet, serial etc?). I don't see how this can be as I have been able to configure the static IP of the board and am able to successfull ftpget
files from my desktop development machine. I really am unsure about what is going on and about the stability of the system. Is this is a problem or is it expected behaviour?
mathematician1975
(1513 rep)
Jul 10, 2012, 10:53 AM
• Last activity: Apr 16, 2025, 05:19 PM
2
votes
0
answers
244
views
Fluke Etherscope stuck at loading kernel, Have JTAG Pins, and bootloader access
I had purchased two Fluke Etherscopes, these are stuck with the message 'Loading Kernel' on the screen. I was able to get a serial console, and access the bootloader using the serial port on the side of the device. I can access the bootloader (Intrinsyc Bootloader) and have tried to use the update f...
I had purchased two Fluke Etherscopes, these are stuck with the message 'Loading Kernel' on the screen. I was able to get a serial console, and access the bootloader using the serial port on the side of the device. I can access the bootloader (Intrinsyc Bootloader) and have tried to use the update files to install a new kernel. It installs successfully to the flash memory, and then tries to boot. I have tried to pass kernel boot parameters through the boot command, and get no output what so ever. I have successfully identified the JTAG pins, except for the nTRST pin, pretty sure I know which pin, but showing a diode between the pad and the suspected pin.
I have flashed the Black Magic Probe firmware and bootloader to my STM32F104 development board, it has a logic level of 3.3v, and so does the CPU. I know which pins to attach the BMP to, but I am not sure where to go from here. I have tried looking for information on debugging the Linux kernel through JTAG, and GDB, but nothing that I see as very clear. I found multiple firmware update files for this device, and also found some source code, both on a public fluke ftp site. I have tried to contact Fluke for service information, and they told me to reach out to NetScout, who say that Fluke never gave them that information. I am attaching the serial printout from when I press the power button to where it stops outputting and just shows the loading kernel screen. I would like to at least get an idea of what I can research in order to get either debug output to the serial console, or debug output through the JTAG port and the BMP firmware. The CPU is the Intel XScale PXA255.
I know that when a CF card is inserted with a file with the name 'ZIMAGE', it tries to load it as a 'Debug Kernel' into RAM, and then points to it for execution. If there is anymore information I can give anyone, please let me know. I bought these devices broken so that I can learn while trying to fix them, and would really like to get them up and running. Again, any information I can pass along, please let me know and I will post it.
Thank you all for your time.
**Serial Output from Boot:**
**************************************************
** Intrinsyc Bootloader (IBoot) **
** Copyright 2001,2002 Intrinsyc Software Inc. **
** Version: 2.0 **
** Support: http://www.intrinsyc.com **
**************************************************
Enabling LCD controller
Setting Registers in the EPSON Controller!!
Finished Setting Registers in the EPSON Controller!!
MCMEM0 : 0x0002449D
MCATT0 : 0x0002449D
MCIO0 : 0x00014290
MECR : 0x00000000
MCCR : 0x00000001
GPLR0 : CFF79FFD
PCMCIA Detected 0 Slots.
setup def img : Image Offset : 70
Image Size X : 294 Y : 70
img done
Loading TXRX Xilinx.
TXRX Xilinx Complete.
reseting PHY
We Should Auto Negociate
Phy Control Register = 0x0000FFFF
Phy ID Register one = 0x0000FFFF
Phy ID Register two = 0x0000FFFF
Phy STAT Register = 0x0000FFFF
Xilinx TXRX Reg : 0x003C3B3C
Leaving init_ethernet
IBoot> help
boot, bootmem, copy, crc, createfis, decode, download,
eraseflash, exec, flash, flashloader, flashverify, getbyte, getword,
getdword, help, info, jump, memtest, ping, reboot,
save, setbyte, setword, setdword, set, set gw, set hwrev,
set option, set initpwr, set ip, set mac, set mask, set mfgdate, set mfgtest,
set model, set serial, set server, set speed, set trial, show, reflash
IBoot> boot
Board Control Regs : 0x00000042
Loading PCMCIA Xilinx.
Waiting for Xilinx INIT pin low.
Waiting for Xilinx INIT pin high.
Writing data to Xilinx.
Waiting for Done High.
Relocating zImage from 000C0000 to A0008000 (len=00100000)
Proper ARM zImage ID found. Booting...
Uncompressing Linux............................................................... done, booting the kernel.
capnjck
(21 rep)
Sep 5, 2020, 09:34 PM
• Last activity: Apr 14, 2025, 04:11 PM
1
votes
1
answers
103
views
Failing to SSH into a DE1-SoC even though I seem to have all dependencies met
I'm following [Altera's guide][1] for running Linux on the DE1-SoC board, specifically section 5.3 - Installing the Driver. The instructions provided in the guide are for a Windows host, and I'm on a linux host (I don't currently have any Windows hosts available for permanent use). I'm following the...
I'm following Altera's guide for running Linux on the DE1-SoC board, specifically section 5.3 - Installing the Driver.
The instructions provided in the guide are for a Windows host, and I'm on a linux host (I don't currently have any Windows hosts available for permanent use). I'm following the instructions, but I can't get to ssh into the device, and I've exhausted all my efforts trying to troubleshoot it.
$ uname -r
5.15.0-124-generic
**To form a baseline, upon host startup, before ever connecting the board through usb:**
$ ls -al /lib/modules/"$(uname -r)"/kernel/drivers/usb/serial/usbserial.ko
-rw-r--r-- 1 root root 116161 Sep 27 2024 /lib/modules/5.15.0-124-generic/kernel/drivers/usb/serial/usbserial.ko
$ ls -al /lib/modules/"$(uname -r)"/kernel/drivers/usb/serial/cp210x.ko
-rw-r--r-- 1 root root 79865 Sep 27 2024 /lib/modules/5.15.0-124-generic/kernel/drivers/usb/serial/cp210x.ko
$ lsmod | grep cp210x
$ sudo modprobe usbserial
$ sudo modprobe cp210x
$ lsmod | grep cp210x
cp210x 40960 0
usbserial 57344 1 cp210x
Meaning I've successfully loaded the driver.
$ dmesg | grep -i usb
...
[ 30.186227] usb 2-3: current rate 16000 is different from the runtime rate 48000
[ 124.301044] usbcore: registered new interface driver usbserial_generic
[ 124.301067] usbserial: USB Serial support registered for generic
[ 128.825043] usbcore: registered new interface driver cp210x
[ 128.825069] usbserial: USB Serial support registered for cp210x
Corresponding to the loadings from above.
$ dmesg | grep -i tty
[ 0.006788] ACPI: SSDT 0x0000000074487000 002357 (v02 ALASKA TbtTypeC 00000000 INTL 20200717)
[ 0.117362] printk: console [tty0] enabled
[ 0.401844] 00:01: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
$ lsusb
...
$ ls /dev/tty*
...
$ lsusb
brings up a bunch of devices and $ ls /dev/tty*
lists a bunch of terminals. The board is not showing of course, it's disconnected as I'm currently forming the baseline.
**I now connect the board and turn it on.**
$ dmesg | grep -i usb
...
[ 128.825069] usbserial: USB Serial support registered for cp210x
[ 244.712211] usb 1-1: new high-speed USB device number 5 using xhci_hcd
[ 244.860515] usb 1-1: New USB device found, idVendor=09fb, idProduct=6810, bcdDevice= 0.01
[ 244.860527] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
idVendor and idProduct are identified correctly.
$ dmesg | grep -i tty[ 0.006788] ACPI: SSDT 0x0000000074487000 002357 (v02 ALASKA TbtTypeC 00000000 INTL 20200717)
[ 0.117362] printk: console [tty0] enabled
[ 0.401844] 00:01: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
Nothing's changed.
$ lsusb
...
Bus 001 Device 005: ID 09fb:6810 Altera
This line is added.
$ ls /dev/tty*
Brings up exactly the same list - nothing's changed.
As mentioned above, I'm out of ideas. I will appreciate any kind of help, so I can ssh to the board and start communicating between the ARM core and the FPGA.
barak
(15 rep)
Mar 29, 2025, 05:46 PM
• Last activity: Mar 30, 2025, 03:17 PM
0
votes
0
answers
87
views
Setting up U-boot's fw_env.config
I have managed to install Alpine Linux on a Marvell Octeon NIC. One thing I'm missing for this to be a clean setup is managing the u-boot variables in firmware. That will also allow to query the card's serial number from the running OS which will allow for some better tracking when there's multiple...
I have managed to install Alpine Linux on a Marvell Octeon NIC. One thing I'm missing for this to be a clean setup is managing the u-boot variables in firmware.
That will also allow to query the card's serial number from the running OS which will allow for some better tracking when there's multiple cards. (they're behind a PCIe switch, and the device order is not static so far)
I created the file and put in various nice-looking numbers, but to no avail:
It's not working so far, showing me alignment errors.
- I wasn't able to find a generated config in the SDK tools.
- I've collected most info from the u-boot prompt and some hardware specific tools.
This is what I had thought could be right:
# MTD device name Device offset Env. size Flash sector size Number of sectors
#/dev/mtd0 0x400000 (8188 Bytes) 256 32
I've tried it, also converthing some of it to multiples of 256, but it seems arbitrary (i.e. 0x400000 is simply what they picked and the u-boot tools tell me it's not aligned on an erase block. yeah, err, wasn't me, right?)
### What I found out:
There's /dev/mtd0
and /dev/mtdblock0
, neither are partitioned.
# => saveenv
# SF: Detected MT25QL01G with page size 256 Bytes, erase size 4 KiB, total 128 MiB
Env size is reported as 8188 bytes
Flash sector size is supposed to be 256 bytes
The number of sectors should then be (probably) 32.
There *may* be a redundant copy being it.
In the sources I found those definitions
# u-boot/include/configs/octeon_generic_nand_stage2.h:#define CONFIG_ENV_RANGE 0x200000 /* 2 blocks */
#define CONFIG_ENV_IS_IN_NAND
#define CONFIG_ENV_OFFSET 0x400000 /* 4MB */
#define CONFIG_ENV_SIZE (32*1024)
#define CONFIG_ENV_RANGE 0x200000 /* 2 blocks */
#ifdef CONFIG_NAND_ENV_DST
nand_load(&nand_info, CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
(uchar *)CONFIG_NAND_ENV_DST);
#ifdef CONFIG_ENV_OFFSET_REDUND
nand_load(&nand_info, CONFIG_ENV_OFFSET_REDUND, CONFIG_ENV_SIZE,
(uchar *)CONFIG_NAND_ENV_DST + CONFIG_ENV_SIZE)
So the most confusing thing here is the (32*1024). Meaning 32MB, which would fit into a 256mbit NAND. But with the env size being shown as roundabout 8k, I'm not able to make sense of the two.
i had a command 'sf probe' that shows info about the flash chip but doesn't show layout info.
The documentation had this line:
The kernel needs to know the flash layout. This is controlled with the kernel mtdparts command line option. Here is the mtdparts option for the above flash layout. Note that the bootloader partitions are marked read only for safety.
bootoctlinux mtdparts=phys_mapped_flash:2048k(bootloader)ro,2048k(kernel),3072k(cramfs),256k(jffs2),256k(bootloader_env)ro
Check your partitioning:
$ cat /proc/mtd
dev: size erasesize name
mtd0: 00200000 00010000 "bootloader"
mtd1: 00200000 00010000 "kernel"
mtd2: 00300000 00010000 "cramfs"
mtd3: 00040000 00010000 "jffs2"
mtd4: 00040000 00010000 "bootloader_env"
i wanna ask:
- is there a way to see more about the layout of u-boots variable storage from within the u-boot prompt?
- is there a way to find them in the flash device (are they just plain ascii? what about endianness?)
- is there an explanation about the erase block sizes?, does it want the "sector" size (256) or the erase size (4)?
- is it safe to just set the mtdparts kernel variable as they mentioned, even if i know nothing about it really?
I somewhat tried the latter, with doubtful result:
cn7322:~# cat /proc/cmdline
bootoctlinux $(loadaddr) coremask=ffff noinitrd root=/dev/sdb2 rootfstype=ext4 rw rootdelay=10 mtdparts=phys_mapped_flash:2048k(bootloader)ro,2048k(kernel),3072k(cramfs),256k(jffs2),256k(bootloader_env)ro console=ttyS0,115200
cn7322:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00100000 00010000 "bootloader"
cn7322:~#
i looked through /dev/mtd0ro
, seems to be the bootloader, but seems not to have the env. or at least i cannot see a single variable name or content. (could be format issues). I didn't get the bootloader_env :(
Florian Heigl
(256 rep)
Mar 23, 2025, 04:28 PM
• Last activity: Mar 23, 2025, 05:14 PM
Showing page 1 of 20 total questions