johankj
Posts: 10
Joined: Tue Mar 06, 2012 2:07 pm

I2C installation

Sun Jun 03, 2012 3:05 pm

Hi everyone.

I've been failing to cross-compile bootc and selsinorks source for week now, on ubnutu 10.10 and debian 6 (both VMs), using gcc and another compiler. Trying to follow elinux and other instructions on how to do it.

I'm totally new to compiling kernels, and not much of a linux user. :/

Is there anyone who can share with me an image with I2C compiled in, like the ones which can be downloaded on this site. Or perhaps very easy to follow instructions?

User avatar
psergiu
Posts: 224
Joined: Mon Nov 07, 2011 8:36 am
Location: TX, U.S.A. (was: RO, E.U.)
Contact: Website

Re: I2C installation

Sun Jun 03, 2012 7:00 pm

http://www.bootc.net/raspberrypi/linux- ... _armel.deb

if you don't want to install the .deb, you can unpack-it with:

Code: Select all

ar xv linux-image-3.2.18-rpi1+_5_armel.deb
tar xvf data.tar.gz
and move vmlinuz from there as /boot/kernel.img

johankj
Posts: 10
Joined: Tue Mar 06, 2012 2:07 pm

Re: I2C installation

Sun Jun 03, 2012 7:57 pm

Thank you for your reply.

I did as you said, and copied the boot/vmlinuz-3.2.18-rpi1 to the sd-cards boot/kernel.img, but I only get a black screen :(

I'm using the official Debian “squeeze” with no changes, btw...

User avatar
bhoga
Posts: 10
Joined: Sun Jun 03, 2012 7:33 pm
Location: Brighton, UK
Contact: Website

Re: I2C installation

Sun Jun 03, 2012 10:19 pm

I know it's not much of a consolation, but I'm having the exact same problems with kernel re-compiling to support I2C etc. I think my main issue is not getting the .config file right. Following the wiki instructions doesn't quite help answer all the new options that have to be set, and using make menuconfig although it helps, still doesn't give me enough knowledge to set the right settings.

Does anyone have a ready made .config file to play with, one that matches any of the repos that deliver I2C functionality?

kernelcode
Posts: 16
Joined: Tue Nov 22, 2011 3:47 pm

Re: I2C installation

Mon Jun 04, 2012 12:15 am

Try installing the package (with dpkg -i) instead of extracting, and then rename the vmlinuz image, that worked for me.

I have also compiled with this .config: http://pastebin.com/bAqN4pRW
Using the rpi-i2cspi branch from here: https://github.com/bootc/linux.git (but I think that's outdated now)

I can't remember if I added anything else in menuconfig, possibly some debug options. I also had to use the imagetool-uncompressed.py script, though I thought I had the latest firmware :?

In any case, I'm up and running with i2c/SPI support. Hopefully that helps at least a little :)

User avatar
psergiu
Posts: 224
Joined: Mon Nov 07, 2011 8:36 am
Location: TX, U.S.A. (was: RO, E.U.)
Contact: Website

Re: I2C installation

Mon Jun 04, 2012 5:02 am

run rpi-update to get the latest firmware before copying the kernel in /boot.

Warning - rpi-update will also replace kernel.img - keep a copy of your i2c-enabled vmlinuz

johankj
Posts: 10
Joined: Tue Mar 06, 2012 2:07 pm

Re: I2C installation

Mon Jun 04, 2012 8:59 am

bhoga wrote:I know it's not much of a consolation, but I'm having the exact same problems with kernel re-compiling to support I2C etc. I think my main issue is not getting the .config file right. Following the wiki instructions doesn't quite help answer all the new options that have to be set, and using make menuconfig although it helps, still doesn't give me enough knowledge to set the right settings.

Does anyone have a ready made .config file to play with, one that matches any of the repos that deliver I2C functionality?
My problem exactly ;)

johankj
Posts: 10
Joined: Tue Mar 06, 2012 2:07 pm

Re: I2C installation

Mon Jun 04, 2012 9:02 am

psergiu wrote:run rpi-update to get the latest firmware before copying the kernel in /boot.

Warning - rpi-update will also replace kernel.img - keep a copy of your i2c-enabled vmlinuz
I will try this...

User avatar
bhoga
Posts: 10
Joined: Sun Jun 03, 2012 7:33 pm
Location: Brighton, UK
Contact: Website

Re: I2C installation

Mon Jun 04, 2012 9:35 am

I'm an idiot.

make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- menuconfig

Rather than make menuconfig, when cross compiling on your Ubuntu host. Ho hum. Getting past the .config compile issues now!

Hope this helps.

johankj
Posts: 10
Joined: Tue Mar 06, 2012 2:07 pm

Re: I2C installation

Mon Jun 04, 2012 8:01 pm

Success!!

This is how i did it, starting with the official Debian 6 release from this site:

- Ran the update-rpi script from git-hub
- Installed the package from bootc
- renamed the vmlinuz file to kernel.img

selsinork
Posts: 151
Joined: Mon Apr 16, 2012 8:31 am

Re: I2C installation

Sun Jun 10, 2012 3:40 pm

Sorry I didn't see this sooner, here's how I do it:

Code: Select all

#!/bin/bash

export ARCH=arm
export CROSS_COMPILE=arm-unknown-linux-gnueabi-

export PATH=${PATH}:/data/linux/arm/xtools/arm-unknown-linux-gnueabi/bin

make menuconfig

make -j 6

mkdir output
make modules_install INSTALL_MOD_PATH=output

rm output/lib/modules/*/source
rm output/lib/modules/*/build

cat first32k.bin /data/linux/rpi/pi/arch/arm/boot/Image > newkernel.img

scp newkernel.img 10.44.16.62:/boot/
scp -r output/* 10.44.16.62:/

I built the cross compiler using crosstool-ng http://crosstool-ng.org/ you probably want to change the PATH in the script to wherever you installed your cross compiler

You can get the first32k.bin from https://github.com/raspberrypi/tools/tr ... er/mkimage

The last couple of lines just scp the newly built kernel and modules over to the Pi

I would attach my working .config but I just get a strange message saying extension is not allowed.

EricMiddleton
Posts: 47
Joined: Wed Jan 18, 2012 3:47 am

Re: I2C installation

Mon Jun 11, 2012 2:12 am

I updated my RPi and tried installing the package, and copying the kernel image, but I don't have any of the i2c tools that were listed on the bootc website. Are these supposed to be installed as part of the package?

EricMiddleton
Posts: 47
Joined: Wed Jan 18, 2012 3:47 am

Re: I2C installation

Mon Jun 11, 2012 3:25 am

Nevermind, I got it to work. I think that maybe my firmware update was unsuccessful, so I manually downloaded the files from github to update it. It works great now!

Return to “Interfacing (DSI, CSI, I2C, etc.)”