Can I copy the pi1b system to pi2b? - linux

I have a Raspberry Pi 1b, AMD recently bought a Pi2b. So I wonder if I can use image tools to copy pi1system to pi2? I may copy pi1's SD card to a .img file, then use the file to create the data of pi2's micro SD card.
I knew that the CPU of both Pis are different. So is that available? Did someone tried?
If so, will there be some hidden bugs inside the system which we can't find immediately but affect the system work properly?
Any suggestion will be appreciated!

Short Answer
Yes you can, make sure your OS has an ARMv7 kernel.
Long Answer
Some quotes from the official Raspberry Pi blog:
Broadcom were willing to step up with a new SoC, BCM2836. This retains all the features of BCM2835, but replaces the single 700MHz ARM11 with a 900MHz quad-core ARM Cortex-A7 complex: everything else remains the same, so there is no painful transition or reduction in stability.
Note: ARMv7 is backwards compatible with ARMv6, the quote below proves it.
At launch, we are using the same ARMv6 Raspbian userland on both Raspberry Pi 1 and 2
There could be some hidden issues
It won't be caused by upgrading from Pi 1 model B to Pi 2 model B. It will be caused from copying the image. If you or your system hardcoded your network interface's MAC address it could potentially cause a problem. I know it's not the best example, but sometime people don't think and hardcode things that can change. It all depends on your OS.
Short how-to for installing the new kernel on raspbian
It's good idea to backup your SD card before making these changes, if something goes wrong it could prevent your Pi from booting.
To backup your SD card on Linux/OS X you can use (remember to select the correct device (sda/sdb/sdc):
sudo dd bs=4M if=/dev/sdX of=raspbian.img
To install ARMv7 kernel:
sudo apt-get update
sudo apt-get install linux-image-rpi2-rpfv
sudo apt-get install linux-headers-rpi2-rpfv
Check /boot to make sure you've got kernel7.img:
ls -lsa /boot
Result of ls:
3861 -rwxr-xr-x 1 root root 3953492 Feb 24 20:55 kernel.img
3818 -rwxr-xr-x 1 root root 3908696 Feb 24 20:55 kernel7.img
If that does not work you can try forcing the kernel name by modifying your /boot/config.txt see http://elinux.org/RPiconfig#Boot for more options.
Other Issues
Kernel modules like wifi drivers or streaming cam in this case can also cause problems on your new ARMv7 kernel if it is not supported by default see http://l0l.org.uk/2015/02/headaches-whilst-upgrading-to-raspberry-pi-2/

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.

Raspberry Pi and RetroPie distro plus LCD

I downloaded RetroPie for my RaspberryPi 3 from this link and have been trying to get my 3.5" LCD to work. I downloaded the driver from here as described, but whenever I try and extract it with the "tar xzvf LCD_show_v6_1_3.tar.gz", the file for the Osoyoo LCD I have, around 50 lines are executed and then the Pi crashes. When I restart it, it goes into a kernel panic every time. I've reinstalled my OS multiple times. I cannot download the raspbian distro with the driver because I have been unable to install RetroPie on top of it and have been unable to display it on the LCD.
Install instructions and product:
Please respond if you know how to solve this problem or what you recommend.
Turns out I was not using enough power. The usb cable I used was a spare rather than official cable for the Pi. Not enough voltage to complete the tasks.

updating product/vendor id on Raspberry Pi (CP210X)

Running "uname -a" on my Raspberry Pi will yield the following:
Linux tm-gw 4.4.14-v7+ #896 SMP Sat Jul 2 15:09:43 BST 2016 armv7l GNU/Linux
My problem is that I have a USB device which vendor and product ID isn't registered in CP210x.c file, which - again - means that even though it can be found, the raspberry will not allow communication with it (/dev/ttyUSB0 doesn't exist).
I have tried to download the kernel, add the ID pair to the cp210x.c file, rebuild and install, which works. (dmesg will show "usb 1-1.4: cp210x converter now attached to ttyUSB0")
Since I have to install this program on more than one raspberry it takes too long, so I'd like to know if it is possible to inject the usb ID's without recompiling the kernel ??
I did try to take the cp210x.ko file from the kernel I build and install it to a new raspberry by typing "sudo insmod cp210x.ko" but that didn' work.
/Karsten
Thanks to Ian Abbott for the solution.
Run "sudo modprobe cp210x"
then
sudo sh -c 'echo 10c4 84cc > /sys/bus/usb-serial/drivers/cp210x/new_id'
When plugging in the device it works :-)

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.

Identifying a Raspberry Pi host with configure

I work on a cross-platform project, and recently added support for the Raspberry Pi. The project, to make sure it is available at as wide as possible audience, has a premake, a cmake and an autotools build system. I have set up cross-compilation for the RPi, and everything works great.
Recently, I also set up a Raspberry Pi VM (Until I get a real RPi) trying to build the library. From Linux, I run './configure --host=arm-raspberry-linux-gnueabihf', and configure takes it from there. On the RPi however (Rasbian 7), the default host found by config.guess is 'armv61-unknown-linux-gnueabihf'. For that reason, even natively on the Pi, I have to run './configure --host=arm-raspberry-linux-gnueabihf'. So, my question sums up to this:
Currently, I currently have something like this in my configure script:
case "$host" in
armv61-unknown-linux-gnueabihf)
if [[ -f /usr/bin/rpi-update ]]; then
on_raspberry=yes
fi
;;
## other hosts here
esac
So, my question sums up to this:
Is 'armv61-unknown-linux-gnueabihf' only reported on the Raspberry Pi? If not, how can configure make sure that it is really on RPi? Is checking for rpi-update sufficient? Do different distros (Arch Linux, Pidora, ...) also have rpi-update?
Are there any other possible host triplets like this that are reported by different versions of the Pi?
Thanks in advance
Is 'armv61-unknown-linux-gnueabihf' only reported on the Raspberry Pi?
Other platforms could use that as well.
If not, how can configure make sure that it is really on RPi?
It can't really (e.g. running it on a RPi VM). configure is just a shell script.
Is checking for rpi-update sufficient?
See above.
Do different distros (Arch Linux, Pidora, ...) also have rpi-update?
Current Pidora and Arch images don't have /usr/bin/rpi-update. Neither does old Rasbpian images at least as far back as 10 Aug 2012.
Are there any other possible host triplets like this that are reported by different versions of the Pi?
There are 3 triplets for the RPi cross compilers, so it would not be surprising if there were others.
EDIT: so basically what is wanted is a way for configure to detect when it's building on a Raspberry Pi. Easy as pie:
configure.ac
# need to detect build...
AC_CANONICAL_BUILD
...
AC_MSG_CHECKING([if build is on Raspberry Pi])
# The test for 'BCM2708' might be sufficient,
# but the presence of Serial is definitely part of
# the Pi firmware for codec licensing.
# See this thread
# <http://www.raspberrypi.org/phpBB3/viewtopic.phpf=29&t=28304&p=252357#p251536>.
AS_CASE("$build",
[arm*-*-linux*],
[on_rpi=`awk -v r=0 '/^Hardware#<:# \t#:>#+:#<:# \t#:>#+BCM2708/ { ++r;} /^Serial#<:# \t#:>#+:/ { ++r; } END { print ((r > 1) ? "yes" : "no");}' /proc/cpuinfo`],
[on_rpi="no"])
AC_MSG_RESULT($on_rpi)
Detects on Raspbian, Pidora, should work on Arch. Arch doesn't seem to include a compiler in its current install image, so configure failed when I tried it. All detected build as armv6l-unknown-linux-gnueabihf when running ./configure. I have not tried this on any kind of RPi emulator or VM.
BCM2708 in /proc/cpuinfo might be unique for RPi.
From File /proc/cpuinfo
Processor : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 697.95
Features : swp half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7
Hardware : BCM2708
Revision : 000d
Serial : 00000000db690cb4

Resources