Check out:
http://elinux.org/BeagleBoard/SPI
I'm running the latest 3.0 based kernel and I'm running a spi display
on McSPI3 and I didn't have to patch anything.
Regards,
Brian
I haven't used Narcissus lately but I would think you could pull down
images (and a ready to go toolchain) based on the latest 3.0 kernel,
that way you don't have to patch anything for McSPI.
I usually just work with bitbake and the git repositories. It may
appear overwhelming, but it would be better to run with a new kernel
and if you can't get it from Narcissus then you can clone the git
repository and use bitbake to make whatever image or package you need.
See http://www.angstrom-distribution.org/building-angstrom Koen has
made scripts that makes it easy to clone everything and get setup for
you to type bitbake <something>. I usually start out with bitbake
console-image which will build u-boot, kernel, and a small basic root
filesystem that you just have to populate these images on the SD Card.
To setup your SPI, you are going to have to modify
arch/arm/mach-omap2/board-omap3beagle.c to add that platform driver
struct etc. in the elinux spi link I sent you to setup the particular
McSPI channel you want to use.
If you poke around the elinux site, you will find all kinds of good
info on how to do things with the beagleboard. You can change pinmux
in u-boot or the kernel and the elinux site had examples of how to do
both.
Don't shy away from using bitbake with Angstrom or even Yocto (both
use OE (OpenEmbedded) meta data. It takes effort to get your head
around but the benefits are well worth it.
I'm just giving you the 30,000 foot overview here.
Welcome to Embedded Linux!
Hopefully others will chime in if I'm sending you in the wrong direction.
Regards,
Brian
Whatever you do, you are going to need the source so you can rebuild
the kernel. It won't help you to have Narcissus build you an image
because you need to make modifications to it. If you get a recent
kernel, it has support for all the McSPI's.
The default .config for the kernel in Angstrom usually already has
CONFIG_SPI_SPIDEV=y set. So you will just have to add the platform
driver to config the McSPI channel you want to use as in the elinux
SPI example. You also need to setup pinmux according to the McSPI
channel you want to use.
I assume you are going to be hooking to the expansion connector. If
you look in the beagle board system reference manual, each of those
pins can have many different functions. So you setup pinmux to give
the pins the function you want.
I don't know which BB you have but the system reference manuals to all
of them are here http://beagleboard.org/
Regards,
Brian
Once you have all the images - MLO, u-boot.bin, uImage ... you will put these images on the FAT32 partition of the SDCard. There should be directions on elinux for doing that. The root filesystem files will be untared to a ext3/4 filesystem. Again, elinux has the info.
Your user app will use the /dev/spidev device.
Again, this is high level, you'll have to dig through elinux for the details.
Regards,
Brian
From Droid Incredible.
The tincan tools board would make it easier and less prone to smoke something.
Yes, that one will work. The BeagleBoard expansion header signals are
1.8V so you'll have to translate to whatever voltage the SPI device
you are attempting to hook up uses. The tincan tools trainer boards
have the voltage level stuff you'll need and a nice breakout board
area for your circuits.
They didn't have these when I did my first BB project ... a EE friend
that was working on the same project had to make basically the same
thing as the trainer board to do the level shifting ... so these
trainer boards are nice and make things a lot easier. They make a
cool JTAG (Flyswatter) debugger interface that works with OpenOCD too.
Regards,
Brian
If it includes the source for the kernel and a cross toolchain to
rebuild it ... then yes. If it is just a kernel image, then no ...
unless someone registered a SPI platform driver in the image. If you
do a ls of /dev/ and see a device called spidevX.X then the kernel has
a SPI driver configured (now you have to figure out which pins it is
using). If you don't see that then you have to modify the kernel code
to register the SPI driver (the elinux SPI example) so the device
shows up in /dev for your userspace app to use.
So with OE, you got to the point where you had all the repos cloned
and an environment setup and were able to do something like bitbake
console-image and MLO failed to build?
Regards,
Brian
Sorry, it is kind of hard to know best how to advise you. I mean, you
could just checkout the latest kernel from git and then just build the
kernel with an external toolchain like CodeSourcery, but then you
would have to know how to config the kernel, take the kernel modules
and put them in the proper place in your rootfs and have knowledge of
building Linux system from scratch. I'm guessing you don't know all
that so even though it looks probably crazy to you .... I kind of
thought maybe following the Angstrom Getting Started instructions
(http://www.angstrom-distribution.org/building-angstrom) would be best
for you. Since it is a well traveled path, you do what is on Koen's
page and you magically get the result you want (almost).
Once you clone the scripts from git and run the setup script, it goes
and gets everything for you.
This is pretty much what you need to do (on the angstrom link above):
MACHINE=beagleboard ./oebb.sh config beagleboard
MACHINE=beagleboard ./oebb.sh update
MACHINE=beagleboard ./oebb.sh bitbake virtual/kernel
Instead of bitbake virtual/kernel, I suggested console-image (you can
do both but console-image is smaller and faster to build)
This takes hours (maybe 6+) depending on how fast your machine and
Internet connection is because it goes off and pulls down the
toolchain and the source for u-boot, kernel, packages in the rootfs
etc. and builds the world for you.
When it completes .... if all goes well ... look for the dir
build/tmp-angstrom_2010_x-eglibc/deploy/images/beagleboard (this is
the location of my last build I did with Angstrom and should look
similar for you) and that directory will contain all you need to put
on the SDCard ... MLO, u-boot, uImage (all goes in FAT, copy MLO first
after you setup the FAT partition) then untar the rootfs into your
ext3/4 partition on the SDCard. You may have to learn how to write a
boot.scr file but all of this is covered on the elinux site and
elsewhere. But the end state of this procedure is a set of components
that is all known to work together. Once you get that far, you can
edit your kernel to setup the SPI driver (probably McSPI3 as it is on
the expansion connector) and then rebuild the kernel.
About the only way to avoid doing all the above is to find a kernel
uImage that is already configured say for McSPI3 on the expansion
connector and hope that the speed, SPI mode etc. will work with
whatever you are trying to hook to it.
Follow the Angstrom getting started then report back when you get a
console-image etc. built ... then you are almost there. Stay on the
path (the steps on the getting started page), don't go into the weeds
trying to understand all this at the moment because your head will
explode ... it will take you a while to fully absorb what all is going
on behind the scenes of this process.
Regards,
Brian
I'm a big Debian (Ubuntu) fan but I've never tried running it on a ARM
so I just don't have experience there.
What kind of things do you need that Ubuntu has but you think Angstrom
doesn't have? I find the structure of Angstrom/Arago/Yocto very
Debian like and OE core has just about every package I've ever needed.
I would think that since you are wanting to run on a TI processor,
you would want to be using a distro that directly uses those layers
instead of trying to figure out how to back port TI ARM kernel
features to some Ubuntu kernel. I may be totally out of line with
that comment as I admit I don't have experience running the
Debian/Ubuntu ARM ports on TI processors. I'm not sure Ubuntu cares
what it's kernel is ... you very well could take an Angstrom built
BeagleBoard kernel and use with Ubuntu.
If you are wanting to learn embedded Linux using a BeagleBoard, then
you should start with Angstrom or Yocto as both will easily build
running systems once you know a few command. Once you do that, there
is enough meat there to figure out how all this works to keep you busy
for quite a while and give you quite the education. Once you learn
what all the parts are and how to build them individually etc., then I
would think you could pretty much do whatever you want with regard to
mixing various components from other projects.
Regards,
Brian
> -----Original Message-----
> From: beagl...@googlegroups.com [mailto:beagl...@googlegroups.com]
> On Behalf Of Vasilis
> Sent: Thursday, February 02, 2012 4:15 PM
> To: Beagle Board
> Subject: [beagleboard] Re: Beagleboard xM - SPI
>
> I created a folder which, after configuration, contains openembedded,
> bitbake, pixhawk and build subfolders. Then I tried to bitbake x-load
> but keeps sending a parsing error message. As for the demo beagleboard
> repository I linked, there is a uImage of 3.0.17 kernel but when I
> download the rootfs, under /boot directory there is a 2.6.32 uImage.
> This is what confuses me...Thanks for your patience!
MLO or x-loader is built as part for u-boot so you no longer have to build
it separately. When you build console-image, u-boot and uImage are built for
you and this is why you see uImage in the /boot folder. You will save
yourself a lot of time learning to use Angstrom. Follow Brian's response to
this post as he did a nice job of explaining how to use Angstrom.
Kind Regards,
John
>
> On Feb 3, 2:05 am, Brian Hutchinson <b.hutch...@gmail.com> wrote:
> > On Thu, Feb 2, 2012 at 6:55 PM, Vasilis <vasilis.vasi...@gmail.com>
wrote:
> > > Hello again! I didn't make it out with OpenEmbedded as I get parsing
> > > errors when I am trying to build the MLO file...Seriously is this the
> > > only way I can get SPI working? I saw that in Beagleboard demo files
> > > (http://www.angstrom-distribution.org/demo/beagleboard) there is a new
> > > kernel (3.0.17)... Can I take advantage of that and build somehow a
> > > new kernel?
> >
> > If it includes the source for the kernel and a cross toolchain to
> > rebuild it ... then yes. If it is just a kernel image, then no ...
> > unless someone registered a SPI platform driver in the image. If you
> > do a ls of /dev/ and see a device called spidevX.X then the kernel has
> > a SPI driver configured (now you have to figure out which pins it is
> > using). If you don't see that then you have to modify the kernel code
> > to register the SPI driver (the elinux SPI example) so the device
> > shows up in /dev for your userspace app to use.
> >
> > So with OE, you got to the point where you had all the repos cloned
> > and an environment setup and were able to do something like bitbake
> > console-image and MLO failed to build?
> >
> > Regards,
> >
> > Brian
>
> --
> To join: http://beagleboard.org/discuss
> To unsubscribe from this group, send email to:
> beagleboard...@googlegroups.com
> Frequently asked questions: http://beagleboard.org/faq
On Sun Feb 5 2:39 , bhensley <bjhens...@gmail.com> sent:
Very nice writeup, Brian.
Dumb question, maybe: how much of this
might apply to the standard Beagleboard?
/Rafe
OK good! You are almost there. Now it is time to get your hands dirty.
I'm going to use my last build as an example which should be similar
to what you should see but your mileage may vary :)
The quick and dirty way to make your changes (this is "a way" not "the
way" - as there are many):
The kernel comes from git and gets patches applied to it for your
target (machine) during the bitbake process and the product of that
processes ended up in a work directory. My board-omap3beagle.c file
is in:
build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/linux-3.0.17-r115c/git/arch/arm/mach-omap2
directory.
Refer to the elinux spi page in earlier messages of this thread but
basically ....
Make your SPI changes to this file (board-omap3beagle.c ). To use my
project as an example I added the following changes/sections:
#include <linux/spi/spi.h>
// For McSPI3 on expansion connector
static struct spi_board_info beagle_mcspi_board_info[] = {
{
.modalias = "spidev",
.max_speed_hz = 100000, //100 KHz
.bus_num = 3,
.chip_select = 0,
.mode = SPI_CS_HIGH | SPI_MODE_1,
}
};
In omap3_beagle_init I added:
//BTH - For McSPI3
spi_register_board_info(beagle_mcspi_board_info,
ARRAY_SIZE(beagle_mcspi_board_info));
Now for the fun part. After you make these changes, if you run the
bitbake virtual/whatever you will most likely wipe out your changes
(at least that was my experience when I was learning). Oh, you will
get a kernel image but it will take kernel from git and apply the
patches and the result will over write the files you just changed.
You want to just recompile the kernel (everything else has already
been done for you if you did say a console-image etc.) so you need to
do that with a command like:
bitbake -f -c compile linux-3.0.17
When this is done ... your uImage will be somewhere like:
build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/linux-3.0.17-r115c/git/arch/arm/boot
... but will not be in the image directory.
Run the deploy command on the kernel:
bitbake -f -c deploy linux-3.0.17
... and you should have ready-to-go images in a directory that looks
something like:
build/tmp-angstrom_2010_x-eglibc/deploy/images/beagleboard
Put these in the proper place on the SD Card and enjoy. Go get
yourself a cold beverage ... you earned it. Enjoy watching the board
boot the kernel you just modified. You'll have to rename the files on
the SD Card to be MLO, u-boot.bin, uImage etc. There is the small
detail of a boot.scr or uEnv.txt script that you'll need but you can
google for how to construct one of those too.
look in /dev/ to see if you have a /dev/spidev3.0 device (the result
of my example above). If it is there, then you should be good to go.
Write a user space program to use it. Checkout and google spidev_test
as an example.
Regards,
Brian
If you don't have normal kernel files in a directory similar to:
build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/linux-3.0.17-r115c/git
... then it could be that the bitbake command you ran to build the
system (console-image etc.) is cleaning up after itself and you may
have to run bitbake -f -c linux-3.0.17 (or whatever it is now ... this
was the last git pull I did) so that the kernel is built and the final
source is left in place.
You might have to run some find commands to make sure you aren't
getting lost in the directory jungle.
cd into build/ and run find . -name "board-omap3beagle.c" ... it
should be in a directory similar to what I described.
Regards,
Brian
> -----Original Message-----
> From: beagl...@googlegroups.com [mailto:beagl...@googlegroups.com]
> On Behalf Of Tomas Selldén
> Sent: Thursday, February 09, 2012 6:00 AM
> To: Beagle Board
> Subject: [beagleboard] Re: Beagleboard xM - SPI
>
> It would appear as if i only can find .h files in the sysroot/
> beagleboard/kernel/arch/arm/mach-omap2/ directory. No board- omap3beagle.c
or
> any other .c file there. So i'm afraid i'm really stuck on how to get on
from now on.
In your local.conf file, there is a line that removes the source code after
a successful build. You need to comment out the line:
INHERIT += "rm_work"
Regards,
John
>
> On Feb 9, 11:17 am, Tomas Selldén <tomas.sell...@gmail.com> wrote:
> > Hi,
> >
> > I'm currently working on getting my SPI running and found this thopic
> > very interesting. I tried building it like Vasilis and ran into the
> > same problem, so now i have followed Brians instructions on using
> > thehttp://www.angstrom-distribution.org/building-angstrom. What i have
done is
> to download the files and then i ran:
> >
> > MACHINE=beagleboard ./oebb.sh config beagleboard MACHINE=beagleboard
> > ./oebb.sh update MACHINE=beagleboard ./oebb.sh bitbake console-image
> >
> > This took a couple of hours as expected, and i got everything
> > generated as intended(i think). I could locate uboot, uImage etc in
> > the deploy folder.But now i'm at the stage where i want to update the
> > arch/arm/mach-omap2/board-omap3beagle.c to expose McSPI3 & 4 to the
> > userspace(http://elinux.org/BeagleBoard/SPI).
> > The problem i have is that i'm not certain how to do this. Shall i go
> > into the
> > "build/tmp-angstrom_2010_x-eglibc/sysroots/beagleboard/kernel/
> > arch/arm/mach-omap2/board-omap3beagle.c", then apply the changes and
> > then run the three ./oebb.sh commands again?
> >
> > To add to my confusion i found this
> > website:http://www.slimlogic.co.uk/2011/05/openembeddedangstrom-kernel
> > -workflow/ Having read it, i wonder, is this the suitable work order
> > when using the scripts and files downloaded from building-angstrom
> > site? If thats the case i'm abit confused about the bitbake, because i
> > tried to run the first commands listed and it said i had to install
> > bitbake(but i can clearly see bitbake in the sources/ directory i got
> > when downloading the angstrom build).
> >
> > Best regards, a linux begginer
> > Tomas
>
If you have an uImage there then you can use that. It is the same one
that gets copied over into the images directory during the deploy
phase.
>
> The problem i have right now is deploying it. I run the deploy but the
> files in the directory: build/tmp-angstrom_2010_x-eglibc/deploy/images/
> beagleboard are not utdated.
>
Not sure why this is. Sorry.
> I'm not sure if i might be the one causing the problem or not, when i
> looked at the build-angstroms site where you use the "MACHINE=beagle ./
Hopefully you are setting it to MACHINE=beagleboard :)
Regards,
Brian
> I managed to get it working.
Outstanding! Now you'll have to figure out how to do the same thing
with Device Trees so you don't have to modify the board file!
Unfortunately, folks like me that are stuck on older ARM kernels
(2.6.37) still have to modify the board file to configure platform
devices.
Regards,
Brian
j.
> --
> To join: http://beagleboard.org/discuss
> To unsubscribe from this group, send email to:
> beagleboard...@googlegroups.com
> Frequently asked questions: http://beagleboard.org/faq
--
Given a choice between two theories, take the one which is funnier
j.
Apparently.
> indeed! Isn't it possible to run this spitest through SPI4? Basically,
> I am not aware of the spitest source code, so I feel a bit blind!
You probably know about spitest more than I do, but I'd start from
shorting MISO and MOSI pins on SPI4 and modifying path passed through
'-D' option.
j.
j.
j.
j.
GPIO131 does not control direction of any of the buffers.
>> Not 131. Also, read again how to control GPIOs.
> I searched the list and I found out that this is one of the ways to
> access GPIOs through shell commands. Where exactly is the error in
> this command? Thank you in advance!
The page with instructions how to control GPIOs on beagleboard is
linked from TrainerBoard's page on elinux.org.
If you want to receive a helpful advice from the group, you should
really put more effort into doing your homework.
j.