BeagleBoard xM SPI problem

I don’t know precisely how to fix your problem but you can try with narcissus instead of openembedded. It is significantly faster and easier, at least for me.

The images provided by narcissus have always worked fine for me. Then you can try enabling spi from the narcissus-image.

Regards

Thanks for reply. I have built kernel image together with root-fs, however it is only 2.6.32, so it’s older then kernel built by OpenEmbedded. Kernel 2.6.32 requires some additional patching for spi, while (as I have read somewhere) kernel 3.x should have working spi support.
Should i try to build working Angstrom with kernel 3.2 or rather focus on trying to make spi running on 2.6?

Hello,

Should i try to build working Angstrom with kernel 3.2 or rather
focus on trying to make spi running on 2.6?

I found spent much effort in trying to get the spidev SPI interface on my Beagleboard under Angstrom with a 2.6.32 kernel. Finally, I found a pragmatic solution using bit banging on the GPIO ports. Bit banging may not provide the optimum performance, but works well for SPI devices, if only a few read or write operations per second are reqired. Also, the signal timings may not show good repeatability, which may be critical for few devices.

Christian Keck

Another fast solution is using ubuntu. I tried it and spi enabling is easy as writing buddy=spidev inside uEnv.txt

steps:

  1. download http://rcn-ee.net/deb/rootfs/precise/ubuntu-12.04-r5-minimal-armhf-2012-07-29.tar.xz
  2. extract with tar xJf ubuntu-12.04-r5-minimal-armhf-2012-07-29.tar.xz
  3. insert your sd card in the card reader and write down device number (e.g. /dev/sdb or /dev/sdf). You can see it with “df -h”
  4. sudo ./setup_sdcard.sh --mmc /dev/sdd --uboot beagle_xm
  5. edit uEnv.txt on the sd card boot partition adding “buddy=spidev”

Then reboot and you should have spidev devices inside /dev

Thanks for solution, I will try Ubuntu today. However, I have question, before I google, maybe you will know. When I tried Ubuntu, there was a problem with support of cpu full speed. Is that okay now? And how about pinmuxing, will it also work?
I need full performance, ethernet, spi and i2c support in my project. So that is why bitbanging isn’t solution for me.

Another fast solution is using ubuntu. I tried it and spi enabling is
easy as writing buddy=spidev inside uEnv.txt

Does Ubuntu also support the TinCanTools Trainer board?

Christian Keck

SPI is present in /dev/, thank you :slight_smile:
Now i have to find sources to rebuild kernel for appropiate SPI ssettings and u-boot for pinmuxing. And I’m not sure about cpu speed, on booting kernel shows, that core has 400MHz…

use cpufreq-info to find out:

voodoo@beagle-xm-512mb-a3:~$ cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: omap
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 300 us.
  hardware limits: 300 MHz - 800 MHz
  available frequency steps: 300 MHz, 600 MHz, 800 MHz
  available cpufreq governors: conservative, ondemand, userspace,
powersave, performance
  current policy: frequency should be within 300 MHz and 800 MHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 800 MHz.
  cpufreq stats: 300 MHz:17.66%, 600 MHz:0.54%, 800 MHz:81.79% (719)

Regards,

So it is only 600 MHz

root@omap:~# cpufreq-info
cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
driver: omap
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 300 us.
hardware limits: 300 MHz - 600 MHz
available frequency steps: 300 MHz, 600 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance

It’s BeagleBoard XM rev C,

So it is only 600 MHz

root@omap:~# cpufreq-info
cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009

Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: omap
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 300 us.
  hardware limits: 300 MHz - 600 MHz
  available frequency steps: 300 MHz, 600 MHz

  available cpufreq governors: conservative, ondemand, userspace,
powersave, performance

Strange... What kernel?

ubuntu@omap:~$ uname -a
Linux omap 3.2.24-x14 #1 SMP Fri Jul 27 02:42:04 UTC 2012 armv7l
armv7l armv7l GNU/Linux

It's BeagleBoard XM rev C,

Does it know that?

ubuntu@omap:~$ dmesg | grep Beagle
[ 0.000000] Machine: OMAP3 Beagle Board
[ 0.000000] Beagle expansionboard: none
[ 0.000000] Beagle second expansionboard: none
[ 0.054565] OMAP3 Beagle Rev: xM C
[ 10.673065] OMAP3 Beagle/Devkit8000 SoC init

Regards,

I will reply with command results in 11 hours, don’t have Beagle with me right now.
It is kernel version exact like from steps presented by pastoreerrante, from your website:
http://rcn-ee.net/deb/rootfs/precise/ubuntu-12.04-r5-minimal-armhf-2012-07-29.tar.xz

root@omap:~# uname -a
Linux omap 3.2.24-x14 #1 SMP Fri Jul 27 02:42:04 UTC 2012 armv7l armv7l armv7l GNU/Linux

So it is the same kernel build, but somehow in my case Beagle isn’t recognized.

root@omap:~# dmesg | grep beagle
[ 0.052368] beagle_opp_init: opp default init failed
[ 4.089721] Registered led device: beagleboard::usr0
[ 4.089874] Registered led device: beagleboard::usr1
[ 4.091735] Registered led device: beagleboard::pmu_stat

Can you show me your uEnv.txt?

buddy=spidev
vram=12MB
defaultdisplay=dvi
dvimode=1280x720MR-16@60
kernel_file=zImage
initrd_file=initrd.img
boot=bootz
dtb_file=
console=ttyO2,115200n8
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=ext4 rootwait fixrtc
xyz_load_image=fatload mmc 0:1 0x80300000 ${kernel_file}
xyz_load_initrd=fatload mmc 0:1 0x81600000 ${initrd_file}; setenv initrd_size ${filesize}
xyz_load_dtb=fatload mmc 0:1 0x815f0000 ${dtb_file}
mmcargs=setenv bootargs console=${console} ${optargs} vram=${vram} omapfb.mode=${defaultdisplay}:${dvimode} omapdss.def_disp=${defaultdisplay} root=${mmcroot} rootfstype=${mmcrootfstype} ${device_args}
xyz_mmcboot=run xyz_load_image; run xyz_load_initrd; echo Booting from mmc …
optargs=console=tty0
deviceargs=setenv device_args buddy=${buddy} buddy2=${buddy2}
loaduimage=run xyz_mmcboot; run deviceargs; run mmcargs; ${boot} 0x80300000 0x81600000:${initrd_size}
buddy=spidev

If not here, where set it up?

root@omap:~# uname -a

Linux omap 3.2.24-x14 #1 SMP Fri Jul 27 02:42:04 UTC 2012 armv7l armv7l
armv7l GNU/Linux

So it is the same kernel build, but somehow in my case Beagle isn't
recognized.

root@omap:~# dmesg | grep beagle

Umm, it's case sensitive.. (so grep for "Beagle" or "-i beagle"

voodoo@beagle-xm-512mb-a3:~$ dmesg | grep -i beagle
[ 0.000000] Machine: OMAP3 Beagle Board
[ 0.000000] Beagle expansionboard: none
[ 0.000000] Beagle second expansionboard: none
[ 0.053497] OMAP3 Beagle Rev: xM Ax/Bx
[ 4.277862] Registered led device: beagleboard::usr0
[ 4.277954] Registered led device: beagleboard::usr1
[ 4.282958] Registered led device: beagleboard::pmu_stat
[ 14.833526] OMAP3 Beagle/Devkit8000 SoC init

[ 0.052368] beagle_opp_init: opp default init failed

But this ^^ is interesting:

as it infers 800Mhz is not enabled:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=blob;f=arch/arm/mach-omap2/board-omap3beagle.c;h=4a71cb7e42d4b02517d30be11a0151b93ef1e18f;hb=refs/heads/linux-3.2.y#l483

Can you upload you whole dmesg to pastebin.com for me to see it..?

After pasting that, any chance can you test 3.4.x to see if it enables
it for higher clock speeds?

wget http://rcn-ee.net/deb/precise-armhf/v3.4.9-x1/install-me.sh
/bin/bash install-me.sh

[ 4.089721] Registered led device: beagleboard::usr0
[ 4.089874] Registered led device: beagleboard::usr1
[ 4.091735] Registered led device: beagleboard::pmu_stat

Regards,

root@omap:~# dmesg | grep Beagle
[ 0.000000] Machine: OMAP3 Beagle Board
[ 0.000000] Beagle expansionboard: spidev
[ 0.000000] Beagle second expansionboard: none
[ 0.052459] OMAP3 Beagle Rev: xM C
[ 0.056060] Beagle expansionboard: registering SPIDEV
[ 9.943145] OMAP3 Beagle/Devkit8000 SoC init

Sorry for that, I didn’t notice case differences.

Whole dmesg:
http://pastebin.com/duUA70bW

as it infers 800Mhz is not enabled:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=blob;f=arch/arm/mach-omap2/board-omap3beagle.c;h=4a71cb7e42d4b02517d30be11a0151b93ef1e18f;hb=refs/heads/linux-3.2.y#l483

Btw, is this a right kernel source to compile with using configuration from eg.
http://rcn-ee.net/deb/precise-armhf/v3.4.9-x1/defconfig

to set proper pin muxes, spi speed and mode and replace it in Ubuntu distribution?

After pasting that, any chance can you test 3.4.x to see if it enables
it for higher clock speeds?

wget http://rcn-ee.net/deb/precise-armhf/v3.4.9-x1/install-me.sh
/bin/bash install-me.sh

I will do it now.

root@omap:~# wget http://rcn-ee.net/deb/precise-armhf/v3.4.9-x1/install-me.sh
–2012-08-22 07:31:49-- http://rcn-ee.net/deb/precise-armhf/v3.4.9-x1/install-me.sh
Resolving rcn-ee.net (rcn-ee.net)… 69.163.149.169
Connecting to rcn-ee.net (rcn-ee.net)|69.163.149.169|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 3834 (3.7K) [application/x-sh]
Saving to: install-me.sh' 100%[======================================>] 3,834 --.-K/s in 0s 2012-08-22 07:31:50 (20.0 MB/s) - install-me.sh’ saved [3834/3834]
root@omap:~# chmod +x
chmod: missing operand after +x' Try chmod --help’ for more information.
root@omap:~# chmod +x ./install-me.sh
root@omap:~# ./install-me.sh
./install-me.sh: 9: [: xarmv7l: unexpected operator
Sorry Not Implemented yet, run this script directly on armv7l target

I have also downloaded recently file http://rcn-ee.net/deb/rootfs/wheezy/debian-wheezy-minimal-armhf-2012-07-29.tar.xz, can I install from it on sd card from pc?

root@omap:~# wget
http://rcn-ee.net/deb/precise-armhf/v3.4.9-x1/install-me.sh
--2012-08-22 07:31:49--
http://rcn-ee.net/deb/precise-armhf/v3.4.9-x1/install-me.sh
Resolving rcn-ee.net (rcn-ee.net)... 69.163.149.169
Connecting to rcn-ee.net (rcn-ee.net)|69.163.149.169|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3834 (3.7K) [application/x-sh]
Saving to: `install-me.sh'
100%[======================================>] 3,834 --.-K/s in 0s
2012-08-22 07:31:50 (20.0 MB/s) - `install-me.sh' saved [3834/3834]
root@omap:~# chmod +x
chmod: missing operand after `+x'
Try `chmod --help' for more information.
root@omap:~# chmod +x ./install-me.sh
root@omap:~# ./install-me.sh
./install-me.sh: 9: [: xarmv7l: unexpected operator
Sorry Not Implemented yet, run this script directly on armv7l target

Run it with bash..

/bin/bash install-me.sh

I have also downloaded recently file
http://rcn-ee.net/deb/rootfs/wheezy/debian-wheezy-minimal-armhf-2012-07-29.tar.xz,
can I install from it on sd card from pc?

Sure, but it's the "exact" same kernel used in the ubuntu images "2012-07-29"...

The only thing different is the userspace..

Regards,

Yes, along with the patch in that directory...

Regards,

Run it with bash…

/bin/bash install-me.sh

Ok, now it worked:
http://pastebin.com/WkUzeDE1

But there’s a problem. Kernel freezes or has wrong serial output:
http://pastebin.com/BKzCnSZ0

uEnv.txt has the same console setting as previously.

I have also downloaded recently file
http://rcn-ee.net/deb/rootfs/wheezy/debian-wheezy-minimal-armhf-2012-07-29.tar.xz,
can I install from it on sd card from pc?

Sure, but it’s the “exact” same kernel used in the ubuntu images “2012-07-29”…

The only thing different is the userspace…

I stayed with previous image.

Run it with bash..

/bin/bash install-me.sh

Ok, now it worked:
root@omap:~# wget http://rcn-ee.net/deb/precise-armhf/v3.4.9-x1/install-me.sh- - Pastebin.com

But there's a problem. Kernel freezes or has wrong serial output:
U-Boot SPL 2012.07-00005-ge63776f (Aug 16 2012 - 07:18:18)Texas Instruments Re - Pastebin.com

That is very strange.. It works fine here on my xM C..
http://paste.ubuntu.com/1160858/

The previous image is backed-up as "*old"... Just replace the
zImage/initrd with the same name but the *old versions of them..

uEnv.txt has the same console setting as previously.

I dumped my uEnv.txt to that pastebin..

Regards,

I copied your uEnv.txt from pastebin, to be 1:1 the same, but it also didin’t worked. System works on old zImage and initrd…