Cannot start J-Link GDB Server on Ubuntu - linux

I am currently working on the ARM Cortex-M4 inside the NXP i.MX8M Mini.
I am able to compile a project for M4 on Eclipse IDE on an Ubuntu VM.
I would now like to debug on the M4 via a SEGGER Flasher ARM probe, still from Ubuntu.
My probe is well recognized by Ubuntu, and I can launch the J-Link GDB server by simply typing the command :
$ sudo ./JLinkGDBServerCLExe
However, if I type the same command without sudo, I get :
$ ./JLinkGDBServerCLExe
SEGGER J-Link GDB Server V7.58b Command Line Version
JLinkARM.dll V7.58b (DLL compiled Nov 16 2021 15:04:27)
-----GDB Server start settings-----
GDBInit file: none
GDB Server Listening port: 2331
SWO raw output listening port: 2332
Terminal I/O port: 2333
Accept remote connection: yes
Generate logfile: off
Verify download: off
Init regs on start: off
Silent mode: off
Single run mode: off
Target connection timeout: 0 ms
------J-Link related settings------
J-Link Host interface: USB
J-Link script: none
J-Link settings file: none
------Target related settings------
Target device: Unspecified
Target interface: JTAG
Target interface speed: 4000kHz
Target endian: little
Connecting to J-Link...
Connecting to J-Link failed. Connected correctly?
GDBServer will be closed...
Shutting down...
Could not connect to J-Link.
Please check power, connection and settings.
My problem is that when I start eclipse, I get the same result as starting the GDB server without sudo.
It seems that this is a rights issue, how can I solve it?

As #KamilCuk said, the problem came from the udev rules.
So you just have to copy the rules provided by Segger with J-Link Software on the system:
$ sudo cp 99-jlink.rules /etc/udev/rules.d
Then you have to reboot the system:
$ reboot

Related

How to create an x server with Singularity

Overall, I am trying to render images using Unity on a remote cluster.
The cluster does not have an X server; I don't have sudo permissions, or can start a Docker container, but I can start a Singularity container.
My plan is to create a container that would simulate the X Server. I created the following Singularity definition file:
Bootstrap: docker
From: nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
%post
# xvfb for rendering in headless mode
apt-get update
apt-get install -y xvfb mesa-utils xorg
echo "allowed_users = anybody" > /etc/X11/Xwrapper.config
I started the container with the option --containall. From the container, I launched the command /usr/bin/X :0, but it failed with the following error:
Singularity xvfb.sif:~> /usr/bin/X :0
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root
X.Org X Server 1.19.6
Release Date: 2017-12-20
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.15.0-140-generic x86_64 Ubuntu
Current Operating System: Linux cooper 5.8.0-50-generic #56~20.04.1-Ubuntu SMP Mon Apr 12 21:46:35 UTC 2021 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.8.0-50-generic root=/dev/mapper/vgubuntu-root ro quiet splash vt.handoff=7
Build Date: 08 April 2021 01:57:21PM
xorg-server 2:1.19.6-1ubuntu4.9 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.34.0
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/home/pierre-louis/.local/share/xorg/Xorg.0.log", Time: Wed May 26 09:17:05 2021
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) parse_vt_settings: Cannot open /dev/tty0 (No such file or directory)
(EE)
(EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
(EE) Please also check the log file at "/home/pierre-louis/.local/share/xorg/Xorg.0.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
Not any /dev/tty* exist. Then I tried to launch startx, but only to get the same message error.
How can I launch an X Server using a Singularity image?
As mentioned in a separate discussion, Xvfb is not supposed to be start through startx or /usr/bin/X but rather with the supplied run script.

DPDK Error: "Cause: No Ethernet ports - bye"

The title is the last line of an error while trying to run a sample application of dpdk, named l2fwd. When I run the app by ./build/l2fwd -l 0-3 -n 4 -- -q 8 -p ffff but at last lines this error occurs:
EAL: Error - exiting with code: 1
Cause: No Ethernet ports - bye
According to dpdk documentation before running app I must execute a command: modprobe ixgbe max_vfs=2,2
I also have a problem with this command, but I'm not sure this is the main reason of failing app execution.
Error of modprobe command relates to ixgbe driver which I can't install it. The error after make of ixgbe is
cc1: error: code model kernel does not support PIC mode
Makefile:197: * * Aborting the build. *** This driver is not supported on kernel versions older than 2.4.0. Stop.
To you a NIC with DPDK we need to bind it to UIO or VFIO driver.
Please have a look at Binding and Unbinding Network Ports to/from the Kernel Modules in DPDK's getting started guide.

Unable to launch weston on linux yocto from ssh

I have the error "no drm device found" as shown below.
I thinks the mail error is fatal: failed to create compoitor backend.
I have the following in my lib
desktop-shell.so drm-backend.so fbdev-backend.so fullscreen-shell.so gl-renderer.so hmi-controller.so ivi-shell.so wayland-backend.so x11-backend.so
root#salvator-x:/etc/systemd/system/multi-user.target.wants# /usr/bin/weston-launch \
-u root -- --idle-time=0 --config=/etc/xdg/weston/weston-drm-hdmi.ini $OPTARGS
Date: 2018-02-26 UTC
[21:29:08.949] weston 1.11.0
http://wayland.freedesktop.org
Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=1.11.0
Build: a9df8430-dirty v4l2-renderer: Fix calcluation of clip region (2017-04-13 18:25:00 +0900)
[21:29:08.949] OS: Linux, 4.9.0-yocto-standard, #1 SMP PREEMPT Mon Feb 26 17:46:03 EST 2018, aarch64
[21:29:08.949] Using config file '/etc/xdg/weston/weston-drm-hdmi.ini'
[21:29:08.950] Output repaint window is 34 ms maximum.
[21:29:08.950] Loading module '/usr/lib/weston/drm-backend.so'
[21:29:08.954] initializing drm backend
[21:29:08.954] logind: failed to get session seat
[21:29:08.954] logind: cannot setup systemd-logind helper (-61), using legacy fallback
[21:29:08.955] no drm device found
[21:29:08.955] fatal: failed to create compositor backend
failed to restore keyboard mode: Bad file descriptor
failed to set KD_TEXT mode on tty: Bad file descriptor
could not reset vt handling
How do I launch weston on linux yocto?
Here is the image:
So.. I found the answer to my question
it has three errors logind (systemd) was having trouble access the input keyboard type
second one is drm device is not found which implies that you have trouble accesing your output port. try to troubleshoot the port make it accessible to the board and then try to launch weston with correct config.
NOTE: Weston wayland wont launch if you dont have keyboard or a mouse connected preferably a usb

CentOS 7 USB. Connect to Wi-Fi using CLI only

I just installed CentOS 7 [Kernel 3.10.0-514] on my USB stick.
Operating system works fine but I had some problems with my Broadcom 43227 wireless card.
I downloaded driver, patched it, changed code a bit according to the instruction here: https://wiki.centos.org/HowTos/Laptops/Wireless/Broadcom and after many attempts it finally compilled and after loading the driver module into kernel led turned on.
Now I need to connect to my Wi-Fi.
What am I trying to do:
Get wireless interface name using iw dev:
phy#0
Interface wlp2s0
Scan to find WiFi Network using iw wlp2s0 scan | grep SSID
SSID: MyNetworkName
Generate a WPA/WPA2 configuration file using wpa_passphrase MyNetworkName >> /etc/wpa_supplicant.conf
MyNetworkPassword
Connect to WPA/WPA2 WiFi network using wpa_supplicant -B -D wext -i wlp2s0 -c /etc/wpa_supplicant.conf
Successfylly initialized wpa_supplicant
[and in some cases after few minutes]
ERROR #wl_cfg80211_scan: WLC_SCAN error (-22)
Get an IP using dhclient using dhclient wlp2s0
But nohing happens
Ping command : Name or sarvice not known
If I run wpa_supplicant without -B I get some repeating errors:
Device or resource busy
wlp2s0: Failed to initiate AP scan
wlp2s0: Trying to associate with [MAC] (SSID='MyNetName' freq=2462 MHz)
Operation not supported
wlp2s0: Association request to the driver failed
....
if I add -D nl80211 to wpa_supplicant call I get same errors without "Device or resource busy"
What I am doing wrong?

KGDB remote debugging error

I am trying to debug the Linux kernel using kgdb. I am using qemu as target machine. Ubuntu 12.04 is my host OS. I tried this command
cyborg#skynet:~$ qemu-system-arm -M versatilepb -m 128M -kernel zImage -initrd rootfs.img.gz -append "root=/dev/ram rdinit=/bin/sh kgdboc=ttyAMA0,115200 kgdbwait"
It will boot and wait displaying
kgdb: Waiting for connection from remote gdb
And when I try to debug using gdb on linux host using the commands
cyborg#skynet: arm-none-linux-gnueabi-gdb vmlinux
(gdb): set remotebaud 115200
(gdb) target remote /dev/ttyS0
Remote debugging using /dev/ttyS0
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Malformed response to offset query, timeout
I am not really getting what I am missing !
P.S. I compiled the linux kernel 2.6.39.4 with KGDB options enabled. And I followed these instructions to run kernel on qemu.
If you reference /dev/ttyS0 on the host gdb will try to use the physical serial port present. You have to connect qemu's emulated serial port to gdb instead.
Reading the qemu manual, apparently you can redirect the emulated port to tcp networking, by adding something like: -serial tcp::1234,server to the qemu command line. In gdb you can then connect using target remote :1234.
There is no real reason to use kgdb when your running within Qemu. You can simply specify something like "-gdb tcp::8888" on the Qemu command line and activate the GDB stub. You can then connect to the stub with an ARM aware GDB:
target remote:8888
And debug away. You may find the following gdb helper scripts useful

Resources