RPi3 with SenseHat and Yocto - yocto

I am currently working with building a Yocto Image for the RPi3 with the SenseHat installed.
The Yocto image consist of the following layers:
meta
meta-poky
meta-oe
meta-networking
meta-python
meta-raspberrypi
meta-java
an application-specific layer.
The application-specific layer is mainly tasked with loading the following kernel-modules:
i2c-dev
fb_sys_fops
syscopyarea
sysfillrect
sysimgblt
rpisense_core
rpisense_js
rpisense_fb
It also contains openssh, psplash, gcc, make, libiio, rtimulib and some other misc. packages.
My image boots nicely without the SenseHat mounted, but the boot-process stops before reaching the UART shell when it is mounted. It stays frozen until the system is reset by the watchdog.
Following is the last part of the UART output before the system freezes.
{...}
Populating dev cache
ALSA: Restoring mixer settings...
/usr/sbin/alsactl: load_state:1735: No soundcards found...
Tue Nov 1 10:01:54 UTC 2016
INIT: Entering runlevel: 5
Configuring network interfaces... [ 5.130327] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
udhcpc (v1.24.1) started
Sending discover...
[ 6.662428] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x4DE1
[ 6.688217] cfg80211: Calling CRDA to update world regulatory domain
Sending discover...
Sending select for 192.168.0.106...
Lease of 192.168.0.106 obtained, lease time 3600
/etc/udhcpc.d/50default: Adding DNS 192.168.0.20
/etc/udhcpc.d/50default: Adding DNS 192.168.0.40
done.
Starting system message bus: dbus.
Starting OpenBSD Secure Shell server: sshd
[ 9.034713] NET: Registered protocol family 10
done.
Starting rpcbind daemon...done.
Starting advanced power management daemon: No APM support in kernel
(failed.)
Starting bluetooth
bluetoothd
Starting syslogd/klogd: done
* Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon
[ 9.401783] Bluetooth: Core ver 2.20
[ 9.405528] NET: Registered protocol family 31
[ 9.410088] Bluetooth: HCI device and connection manager initialized
[ 9.416576] Bluetooth: HCI socket layer initialized
[ 9.421576] Bluetooth: L2CAP socket layer initialized
[ 9.426747] Bluetooth: SCO socket layer initialized
...done.
Starting Telephony daemon
[ 9.507315] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 9.512765] Bluetooth: BNEP filters: protocol multicast
[ 9.518098] Bluetooth: BNEP socket layer initialized
Starting Linux NFC daemon
[ 9.624816] nfc: nfc_init: NFC Core ver 0.1
[ 9.629241] NET: Registered protocol family 39
I shoould note that I have soldered three wires onto the UART pins:
RPi3 UART pins http://www.embeddedforu.com/wp-content/uploads/2015/06/Raspberry-pi-UART-connections_thumb.png
When the system is frozen, I can still ping the device, but SSH does not work.
Any idea what might be causing this behavior?

It turned out that the problem lay within the yocto local.conf-file. The following line was set:
ENABLE_I2C = "1"
This created a second i2c-driver, which lead to one of the crashing on boot.
For any googlers out there: This flag does not need to be set. Instead make sure that the i2c-dev kernel driver is loaded at boot.

I never used the bluetooth, but it seems the system doesn't freeze, you just lose UART data when Bluetooth connects.
From here:
On the rpi3, it is normal since the BCM2837 on the Raspberry Pi3 has 2 UARTs (as did its predecessors), however to support the Bluetooth functionality the fully featured PL011 UART was moved from the header pins to the Bluetooth chip and the mini UART made available on header pins 8 & 10.
This has a number of consequences for users of the serial interface.
The /dev/ttyAMA0 previously used to access the UART now connects to Bluetooth.
I would advise you to try again having in config.txt
dtoverlay=pi3-disable-bt
enable_uart=1
And if you really need bluetooth, use
dtoverlay=pi3-miniuart-bt
And for the ssh, add "openssh" in your image recipe, and dependencies to connect like wpa-supplicant (don't forget to configure it)

Related

Can't flash CM0+ Core in NUCLEO STM32WL

In a wireless project, I'm using en Nucleo STM32WLJC1 in dual core configuration.
I take DualCore Ping Pong ST code example, that I rework to make my own application.
I didn't touch anything of the CMO+ project, I only work on the applicative layer in CM4.
I've some problems about flashing the CM0+ Core.
The first time I flashed the board it works and now I've most of the times the folowing error when I try to flash the CM0+. It sometimes work one time for no reason.
Pop-up Problem Occurred Windows :
Error in final launch sequence:
Failed to start GDB server Failed to start GDB server Error in
initializing ST-LINK device. Reason: (255) Unknown. Please check power
and cabling to target.
Console informations
STMicroelectronics ST-LINK GDB server. Version 6.0.0 Copyright (c)
2021, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
Target unknown error 32
Error in initializing ST-LINK device. Reason: Unknown. Please check
power and cabling to target.
It looks like the STlink can't reach the core...
Someone may know what is happening ?
Is there a flashing configuration that has to be done? (to chose which core we want to flash)

Can I transmit serial data only using a data cable via Raspberry pi 0 w's USB port?

I have been recently trying to find out a way whether I can send serial data (large file like image data) only through the Rpi w 0's micro USB port using ttyGS0. But when I searched online I only found ways of setting up headless through serial and other stuff which was no what I wanted. But I did follow the tutorial half way
I went to '/boot/config.txt' and set 'dtoverlay=dwc2' at the end of the file after leaving a line
I went to '/boot/cmdline.txt' and did put 'modules-load=dwc2,g_serial' after 'rootwait' leaving a space
Thinking I could just use the /dev/ttyGS0 in my serial program on the Rpi and send the data the data was being sent but on my PC when I tried to access my Rpi which was on comport 12 it said port not found and couldn't open it. But it was showing up in the device manager as 'PI USB to Serial(COM12)'
Then I wondered whether it would be possible at all to access Rpi's com port this way.
If that's the case, I want to know if there is any other way to access the Rpi's USB port only using the USB cable
Note
I don't want to use Rpi's USB as a way of logging ie. 'headless setup'. I just want to receive serial data like an Arduino.
I don't want to use the GPIO pins (I tried) as they can only send limited characters at a time and I want to send an image file. Very quickly.
I don't have any serial converters at hand so i could route it to the arduino and use /dev/ttyUSB0
then read it on PC. I just only want to use the USB cable.
In case this info is required:-
my pc is a probook 6560b running windows 7
things i found while testing and stuff:-
I did do -lsusb command but i dint find my device on that list
I tried the 'ls /dev/ttyGS0' and i found '/dev/ttyGS0'
I checked many forums and some guys were asiking to use this command 'dmesg | grep tty'and show them the code . So i performed it i dont understand what alot in the piece of text means but if it would be helpfull i pasted it here:-
pi#aloypi:~ $ dmesg | grep tty
[ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=1366 bcm2708_fb.fbheight=768 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:6D:50:77 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 console=tty1 root=PARTUUID=4ab8bcad-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2,g_serial
[ 0.001496] printk: console [tty1] enabled
[ 2.543414] 20201000.serial: ttyAMA0 at MMIO 0x20201000 (irq = 81, base_baud = 0) is a PL011 rev2
[ 2.561791] 20215040.serial: ttyS0 at MMIO 0x20215040 (irq = 53, base_baud = 50000000) is a 16550
[ 6.716694] systemd[1]: Created slice system-getty.slice.
i also tried this one 'dmesg | grep dwc2' out of curiosity and got this but i cant say anything judging it so ya
pi#aloypi:~ $ dmesg | grep dwc2
[ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=1366 bcm2708_fb.fbheight=768 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:6D:50:77 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 console=tty1 root=PARTUUID=4ab8bcad-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2,g_serial
[ 2.379190] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 2.386185] dwc_otg: FIQ enabled
[ 2.386205] dwc_otg: NAK holdoff enabled
[ 2.386219] dwc_otg: FIQ split-transaction FSM enabled
[ 2.386245] Module dwc_common_port init
[ 2.968203] modules-load=dwc2,g_serial
[ 8.344134] dwc2 20980000.usb: supply vusb_d not found, using dummy regulator
[ 8.367130] dwc2 20980000.usb: supply vusb_a not found, using dummy regulator
[ 8.626751] dwc2 20980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM
[ 8.647109] dwc2 20980000.usb: DWC OTG Controller
[ 8.653810] dwc2 20980000.usb: new USB bus registered, assigned bus number 1
[ 8.726672] dwc2 20980000.usb: irq 33, io mem 0x20980000
[ 8.787097] usb usb1: Manufacturer: Linux 5.10.17+ dwc2_hsotg
[ 9.371395] dwc2 20980000.usb: bound driver g_serial
[ 194.158373] dwc2 20980000.usb: new device is high-speed
[ 194.189677] dwc2 20980000.usb: new device is high-speed
[ 194.225164] dwc2 20980000.usb: new address 3
Ok looks like i made some progress
till now I did this
I went to '/boot/config.txt' and set 'dtoverlay=dwc2' at the end of the file after leaving a line
I went to '/boot/cmdline.txt' and did put 'modules-load=dwc2,g_serial' after 'rootwait' leaving a space
I did this 'sudo nano /etc/rc.local' and placed 'modeprobe g_serial use_acm=0' before 'exit 0'
Then i performed this command 'sudo systemctl stop getty#ttyGS0.service'
and then this 'sudo systemctl disable getty#ttyGS0.service'
(i think disabling getty#ttyGS0.service and puting 'modeprobe g_serial use_acm=0' in the folder metioned above allowed rpi and pc to comunicate but then again i can be wrong )
then perfored a 'sudo reboot'
this seemed to solve my problem
but i have one more problem now
whatever is sent from the rpi i can only recieve in the coolterm serial port reading software
i cant seem to use read the port from processing for some reason
(im using processing to later read the image file being sent)
here is my current serial reading program in processing
import processing.serial.*;
Serial myPort; // Create object from Serial class
String val; // Data received from the serial port
void setup()
{
myPort = new Serial(this, "COM13", 115200);
}
void draw()
{
if ( myPort.available() > 0)
{ // If data is available,
val = myPort.readStringUntil('\n'); // read it and store it in val
}
if (val!=null)
{
println(val); //print it out in the console
}
}
i kinda am stuck here :P
EDIT
welp nevermind i solved it
i finally finally got it working yaaaaaaaayyy
OK now remember all who seek for the answer when using /dev/ttyGS0 it uses the CTS and RTS protocall
(now idk if it can be disabled but please lemme know you guys)
Its like the pi asks your pc wether it is cleared to send the data and when the pc says yeah ok send the data the pi sends it
so whenever your using this method please enable rts or cts
this is what i used in processing to recieve the data
import processing.serial.*;
Serial myPort;
void setup()
{
//remember to set the COM port to which your pi is set
size(200, 200);
myPort = new Serial(this, "COM13", 115200);
}
void draw()
{
if ( myPort.available() > 0)
{
if(myPort.getCTS()==true){
myPort.setRTS(true);
print(myPort.read());
}
}
}
i hope this is of loadsa help to you guys but if there is some correction needed please lemme know yall:D
thanks

stm32 factory bootloader possibly overwritten with openocd?

tl;dr: flashed firmware to 0x00000000 instead of 0x08000000, am I lost?
Hello,
my device is based on a STM32F103CBTx which came with a proprietary firmware and had readout protection on.
I connect to it with a ST-Link v2 SWDIO and SWCLK connected to PA13 and PA14 and this command:
sudo openocd -f /usr/share/openocd/scripts/interface/stlink-v2.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg
I don't remember how I removed flash protection, but it worked as the original firmware didn't work anymore. Then I created a simple hello world firmware which pulls up and down three gpios and flashed it. The gpios are pulled up and down in 700ms intervals.
After flashing, I can't connect with openocd anymore. I forgot to specify the offset, the manual says the offset defaults to 0 and as it worked, I suppose instead of the boot loader my shitty hello world is pulling up and down some random pins happily… Is this possible? All other threads I found say the boot loader is write protected.
This is the last contact I had:
> halt
halt
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0x01000003 pc: 0xfffffffe msp: 0xffffffdc
> flash write_image erase fw.hex
flash write_image erase fw.hex
auto erase enabled
target halted due to breakpoint, current mode: Handler HardFault
xPSR: 0x61000003 pc: 0x2000003a msp: 0xffffffdc
wrote 4096 bytes from file fw.hex in 0.285697s (14.001 KiB/s)
> reset
reset
jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Any directions highly appreciated.
Edit:
What I get now, also tried another st-link:
% sudo openocd -f /usr/share/openocd/scripts/interface/stlink-v2.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select '.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
none separate
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v17 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.244356
Error: init mode failed (unable to connect to the target)
in procedure 'init'
in procedure 'ocd_bouncer'
flashed firmware to 0x00000000 instead of 0x08000000, am I lost?
No, it doesn't matter at all, they are the same.
After reset, the MCU loads the word at address 0 in SP, and the next one at address 4 in PC. The BOOT0 and BOOT1 pins control which memory gets mapped to 0x00000000. Usually, BOOT0 is tied low, and flash memory at 0x08000000 gets mirrored at 0x00000000.
instead of the boot loader my shitty hello world is pulling up and down some random pins happily… Is this possible? All other threads I found say the boot loader is write protected.
The factory bootloader is indeed write protected, openocd can't overwrite it.
However, your application could have reconfigured the SWD pins, by writing a wrong value in GPIOA->CRH or AFIO->MAPR, thereby preventing openocd from working. It's the most common cause of this problem.
Fortunately, there is a way to recover.
Connect under Reset
If the reset pin of the controller is held low for a while when openocd is started, the application is prevented from starting, and messing up the GPIO configuration.
Openocd can do this automatically, when
It's told to do so, the line reset_config srst_only srst_nogate is present somewhere in the configuration script.
The MCU reset pin is connected to the debugger hardware, pin 15 on an official ST-Link/V2.
Or you can do it manually, by whatever means your board provides. If you are lucky, it has a reset button, if not, you must find a way to somehow ground the MCU reset pin.
Pull the reset pin low
Start openocd
Wait until the Info : Target voltage line appears. Maybe a second longer.
Release the reset pin.
It requires a bit of trial and error, you'll get better with practice.
Then you can flash your improved application, which carefully avoids reconfiguring the SWD pins.

ath9k_htc (Atheros) TL-WN722N WiFi dongle on Angstrom

I am trying to interface the TL-WN722N to a Altera Cyclone SoC. I have taken the following approach:
Downloaded the open firmware ath9k_htc and try integrating it to my linux kernel image to be loaded.
a. https://wiki.debian.org/ath9k_htc/open_firmware: The steps here mention to build the toolchain and the firmware and then place it in /lib/firmware.
b. Built the linux kernel using the steps mentioned here : https://rocketboards.org/foswiki/Documentation/GSRDCompilingLinux
The firmware obtained in step a. was placed into /linux-socfpga/firmware , since there was no firmware folder in directory /lib/.
c. The image created was flashed and the wifi dongle was plugged in.
2.Here is a dmesg output for the cyclone board :
[ 2.223039] usb 1-1: New USB device found, idVendor=0cf3, idProduct=9271
[ 2.229735] usb 1-1: New USB device strings: Mfr=16, Product=32, SerialNumber=48
[ 2.237129] usb 1-1: Product: USB2.0 WLAN
[ 2.241124] usb 1-1: Manufacturer: ATHEROS
[ 2.245215] usb 1-1: SerialNumber: 12345
[ 5.351145] EXT4-fs (mmcblk0p2): recovery complete
[ 5.359958] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 5.368058] VFS: Mounted root (ext3 filesystem) on device 179:2.
[ 5.375560] devtmpfs: mounted
[ 5.379310] Freeing unused kernel memory: 1024K (c0900000 - c0a00000)
**[ 5.670820] systemd[1]: Failed to insert module 'autofs4': No such file or directory**
[ 5.722709] systemd[1]: systemd 226 running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD +IDN)
The linux is able to identify the Atheros usb device. However the driver module is not loaded. I have verified this using lsmod and it returns nothing. The commands ifconfig and ip a also returns no wireless connection.
Also when I see the path /lib/modules/.../kernel/drivers/net I observe only 2 modules ethernet and mdio.ko
Kernel version : 4.1.33-ltsi-altera
Does that mean that my driver is missing in the image? What could be the possible reasons for this issue? Does anyone have any other solution to this issue?
Edit:
I could find the linux drivers in /sys/bus/usb/drivers/ath9k_htc and the corresponding modules in /sys/module/ath9k_htc
So basically, the modules are configured static.
Now when I boot up the system, I find an error saying that the requested firmware is not found.
I have already placed the required firmware(htc_9271-1.4.0.fw & htc_9271.fw) in /lib/firmware/ath9k_htc
Here is the error :
[ 2.002205] usb 1-1: new high-speed USB device number 2 using dwc2
[ 2.262666] usb 1-1: New USB device found, idVendor=0cf3, idProduct=9271
[ 2.269348] usb 1-1: New USB device strings: Mfr=16, Product=32, SerialNumber=48
[ 2.276730] usb 1-1: Product: USB2.0 WLAN
[ 2.280724] usb 1-1: Manufacturer: ATHEROS
[ 2.284815] usb 1-1: SerialNumber: 12345
[ 2.289370] usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[ 2.297203] usb 1-1: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw failed with error -2
[ 2.305811] usb 1-1: ath9k_htc: Firmware htc_9271.fw requested
[ 2.311658] usb 1-1: Direct firmware load for htc_9271.fw failed with error -2
[ 2.318867] usb 1-1: no suitable firmware found!
[ 2.323478] usb 1-1: ath9k_htc: Failed to get firmware htc_9271.fw
[ 2.329951] usb 1-1: ath9k_htc: USB layer deinitialized
I have also followed the steps mentioned here :
https://unix.stackexchange.com/questions/21903/custom-kernel-fails-to-load-firmware-when-module-built-in
which explains how to provide configuration for the path for loading the firmware.
A quick grep for /proc/config.gz reveals this:
$zcat /proc/config.gz | grep CONFIG_ATH
CONFIG_ATH_COMMON=y
#CONFIG_ATH_DEBUG is not set
#CONFIG_ATH5K is not set
#CONFIG_ATH5K_PCI is not set
CONFIG_ATH9K_HW=y
CONFIG_ATH9K_COMMON=y
CONFIG_ATH9K_BTCOEX_SUPPORT=y
CONFIG_ATH9K=y
CONFIG_ATH9K_PCI=y
CONFIG_ATH9K_AHB=y
#CONFIG_ATH9K_DEBUGFS is not set
#CONFIG_ATH9K_DYNACK is not set
CONFIG_ATH9K_WOW=y
#CONFIG_ATH9K_CHANNEL_CONTEXT is not set
CONFIG_ATH9K_PCOEM=y
CONFIG_ATH9K_HTC=y
CONFIG_ATH9K_HTC_DEBUGFS=y
#CONFIG_ATH6KL is not set
#CONFIG_ATH10K is not set
$zcat /proc/config.gz | grep CONFIG_EXT
CONFIG_EXTRA_FIRMWARE="htc_9271-1.4.0.fw"
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware/ath9k_htc"
#CONFIG_EXTCON is not set
zcat /proc/config.gz | grep CONFIG_FIRMW
CONFIG_FIRMWARE_IN_KERNEL=y
# CONFIG_FIRMWARE_MEMMAP is not set
Is there any other way to notify the kernel to load the firmware? I think I might be missing out some configuration.
Edit 2 :
I resolved the issue of firmware load failure by enabling the option Fallback user-help invocation for firmware loading. Now the device is initialised, but the driver seems to not support the device. Here is the dmesg log :
[ 14.568484] usb 1-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size: 51008
[ 14.820407] ath9k_htc 1-1:1.0: ath9k_htc: HTC initialized with 33 credits
[ 15.852173] ath: phy0: Mac Chip Rev 0x0f.3 is not supported by this driver
[ 15.859064] ath: phy0: Unable to initialize hardware; initialization status: -95
[ 15.866512] ath: phy0: Unable to initialize hardware; initialization status: -95
[ 15.873973] ath9k_htc: Failed to initialize the device
A quick research on the device, I found that the official website of TP-Link states that the linux drivers are available for version 2, and not for version 1. My device is a version 1 device and I think because of this the driver does not support.

Can't register rteth0 for FEC Ethernet card on SabreLite iMX6Q

I'm a new user on RTnet and try to make Rtnet work on Freescale Sabre Lite iMX6Q board. But I got an issue, RTnet can't use rt_fec.ko module driver to register rt_eth0 even though non real time driver is disable.
I'm using:
Linux kernel 3.0.43 download from Xenomai git://git.xenomai.org/ipipe-gch.git/?h=ipipe-3.0-imx6q
Xenomai 2.6 download from git.xenomai.org/xenomai-2.6.git/
RTnet 0.9.13 download from rtnet.org/download.html
Please see my kernel configuration and boot log in attached link.
Xenomai is loaded:
"*I-pipe: Domain Xenomai registered.
Xenomai: hal/arm started.
Xenomai: scheduling class idle registered.
Xenomai: scheduling class rt registered.
Xenomai: real-time nucleus v2.6.3 (Lies and Truths) loaded.
Xenomai: debug mode enabled.
Xenomai: starting native API services.
Xenomai: starting POSIX services.
Xenomai: starting RTDM services.* "
And FEC ethernet driver (non real-time driver) is loaded when kernel is booting
*"FEC Ethernet Driver
fec_enet_mii_bus: probed "*
Xenomai is built following install guideline for ARM platform from Xenomai:
http://xenomai.org/installing-xenomai-2-x/
RTnet is built by below command, because SABRE Lite use FEC ethernet card with Micrel KSZ9021 Gigabit chip so I put "--enable-fec" in configure command to build real-time driver for FEC ethernet card:
"./configure --host=armv7l-timesys-linux-gnueabi --with-rtext-config=/home/sonnguyen/rtnet-xenomai-rootfs/usr/xenomai/bin/xeno-config --with-linux=/home/sonnguyen/build/rtnet-xenomai-ipipe-imx6q --enable-rtcfg-dbg --enable-rtwlan --enable-net-routing --enable-router --enable-nomac --enable-rtcap --enable-proxy --enable-checks --enable-fec "
Then
"make DESTDIR=/home/sonnguyen/rtnet-xenomai-rootfs install"
I also changed RT_DRIVER from default value to "rt_fec" in rtnet.conf.
After kernel is booted, I ran "./rtnet start" and got this:
"RTnet: initialising real-time networking
RT FEC Ethernet Driver
./rtnet: line 385: can't create /sys/bus/pci/drivers/rt_fec/bind: nonexistent directory
initializing loopback...
RTnet: registered rtlo
RTcap: real-time capturing interface
ifconfig: SIOCGIFFLAGS: No such device
ifconfig: SIOCGIFFLAGS: No such device
RTcfg: init real-time configuration distribution protocol
RTmac: init realtime media access control
RTmac/TDMA: init time division multiple access control mechanism
ioctl: No such device
ioctl: No such device
ioctl: No such device
ioctl: No such device
ioctl (add): No such device
ioctl (add): No such device
ioctl (add): No such device
ifconfig: SIOCGIFFLAGS: No such device
Waiting for all slaves...ioctl: No such device
ioctl: No such device "
Then I tried:
"# lspci
lspci: /sys/bus/pci/devices: No such file or directory
ls /sys/bus/
ac97 hid mdio_bus platform sdio spi
event_source i2c mmc scsi serio usb "
No pci directory under /sys/bus/. Then I thought because the script can't find the ethernet physical bus, it can't register rteth0.
Then I looked into rtnet script and did some minor change. In the script it requires physical ethernet device ID (mentioned in REBIND_RT_NICS), so I tried to find out what it is and got this when make eth0 up with non real-time driver:
"eth0: Freescale FEC PHY driver [Micrel KSZ9021 Gigabit PHY] (mii_bus:phy_addr=1:06, irq=-1)
PHY: 1:06 - Link is Up - 1000/Full "
I think 1:06 is my physical bus ID, then I change the code in rtnet from:
for dev in $REBIND_RT_NICS; do
if [ -d /sys/bus/pci/devices/$dev/driver ]; then
echo $dev > /sys/bus/pci/devices/$dev/driver/unbind
fi
echo $dev > /sys/bus/pci/drivers/$RT_DRIVER/bind
done
To
echo 1:06 > /sys/bus/mdio_bus/drivers/Micrel\ KSZ9021\ Gigabit\ PHY/unbind
echo 1:06 > /sys/bus/platform/drivers/rt_fec/bind
And I tried again with "./rtnet start", this time I got this:
RTnet: initialising real-time networking
RT FEC Ethernet Driver
sh: write error: No such device
initializing loopback...
RTnet: registered rtlo
RTcap: real-time capturing interface
ifconfig: SIOCGIFFLAGS: No such device
ifconfig: SIOCGIFFLAGS: No such device
RTcfg: init real-time configuration distribution protocol
RTmac: init realtime media access control
RTmac/TDMA: init time division multiple access control mechanism
ioctl: No such device
ioctl: No such device
ioctl: No such device
ioctl: No such device
ioctl (add): No such device
ioctl (add): No such device
ioctl (add): No such device
ifconfig: SIOCGIFFLAGS: No such device
Waiting for all slaves...ioctl: No such device
ioctl: No such device
But it still said "No such device"
This is lsmod after I ran ./rtnet start
lsmod
Module Size Used by Not tainted
tdma 25691 0
rtmac 9724 1 tdma
rtcfg 58071 0
rtcap 7151 0
rt_loopback 1279 2
rtpacket 6365 0
rtudp 10738 0
rt_fec 12742 0
rtipv4 29987 2 rtcfg,rtudp
rtnet 40746 9 tdma,rtmac,rtcfg,rtcap,rt_loopback,rtpacket,rtudp,rt_fec,rtipv4
./rtifconfig
rtlo Medium: Local Loopback
IP address: 127.0.0.1
UP LOOPBACK RUNNING MTU: 1500
Only rtlo is registered.
I also tried with kernel linux without non real-time FEC driver (please refer in another config file in attached Skydrive link), but still the same issue happened.
Do you have any idea how to solve this issue? I did many search but still can not figure out how to fix it.
Because I can't attach the files to my post, so I put all of my configuration files in the link below:
https://onedrive.live.com/redir?resid=162EDF85AEBD2EFE!717&authkey=!AJ1Fjd_XiohUwes&ithint=file%2czip
Best Regards,
Nguyen Hung Son