Beaglebone Black GPMC Tutorial

Hi everyone,

Does anyone know a good GPMC tutorial? Or examples of code for this with BBB.

I know how to change the Pin Mode already with device tree.

Is anyone out there working on GPMC??

This is very difficult!

How are you planning on using the GPMC bus?

Gerald

Hi Gerald,

I wish to store the signals that comes in from a ADC. But I know very little about the GPMC.

A number of questions that I have:

  1. How do I set up the GPMC such that it will start doing that? Do I do that in the device tree layout or in code? If so, do you have any examples that I can follow.

  2. How do I use the Direct Memory Access (DMA) function? I can’t seem to find a detailed explanation of this.

Jack

I have no idea. That sounds like a software question to me.

Gerald

Jack


the TRM discusses GPMC and EDMA

7.1 GPMC
7.1.1 Introduction


Examples on How to set it up might be tough I would check the starterware


I know of one military SDR app needed this so for OMAP4 I am sure the GPMC is similar but you wont find that code in the public domain


Dont expect any help from most the SW people on here they spend their lives writing convoluted scripts to build Linux and have no real


Your asking for help in a area ecompassing REAL world applications
in a forum
addressing some hobbyist version of Linux that targets the mobile world and is DOMINATED by FAE scripsters adept at convoluting how to build a kernel


TI TRM’s usually has a step by step sequence that explains what to do and you will have
to code it




— On Mon, 6/17/13, Jack Zhang jackzhang273@gmail.com wrote:


> From: Jack Zhang jackzhang273@gmail.com
> Subject: Re: [beagleboard] Re: Beaglebone Black GPMC Tutorial
> To: beagleboard@googlegroups.com
> Date: Monday, June 17, 2013, 10:50 AM
>
> Hi Gerald,
>
> I wish to store the signals that comes in from a ADC. But I know very little about the GPMC.
>
> A number of questions that I have:
>
> 1. How do I set up the GPMC such that it will start doing that? Do I do that in the device tree layout or in code? If so, do you have any examples that I can follow.
>
> 2. How do I use the Direct Memory Access (DMA) function? I can’t seem to find a detailed explanation of this.
>
> Jack
>
> On Friday, June 14, 2013 4:23:13 PM UTC-7, Gerald wrote:
>
> > How are you planning on using the GPMC bus?
> >
> > Gerald
> >
> > On Fri, Jun 14, 2013 at 5:44 PM, Jack Zhang jackzh...@gmail.com wrote:
> >
> > > Is anyone out there working on GPMC??
> > >
> > > This is very difficult!
> > >
> > > On Thursday, May 30, 2013 10:49:12 AM UTC-7, Jack Zhang wrote:
> > >
> > > > Hi everyone,
> > > >
> > > > Does anyone know a good GPMC tutorial? Or examples of code for this with BBB.
> > > >
> > > > I know how to change the Pin Mode already with device tree.
> > >
> > > –
> > > For more options, visit http://beagleboard.org/discuss
> > > —
> > > You received this message because you are subscribed to the Google Groups “BeagleBoard” group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard…@ googlegroups.com.
> > > For more options, visit https://groups.google.com/ groups/opt_out.
> >
> > –
> >
> > Gerald
> >
> > ger...@beagleboard.org
> > g-co...@ti.com
> > http://beagleboard.org/
> > http://circuitco.com/support/
>
> –
> For more options, visit http://beagleboard.org/discuss
> —
> You received this message because you are subscribed to the Google Groups “BeagleBoard” group.
> To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



|

Jack


I do remember the timing of the FPGA or ASIC has to match what the GPMC was intended for ie see below . I do know customer got this to work eventually.


Once you get the software working Gerald or some of the excellant HW people on here may guide you in narrowing down/debugging it if it doesnt work the first time but that may be beyond the scope of the this forum. Good Luck



The general-purpose memory controller (GPMC) is an unified memory controller dedicated to interfacing
external memory devices:
• Asynchronous SRAM-like memories and application-specific integrated circuit (ASIC) devices
• Asynchronous, synchronous, and page mode (only available in non-multiplexed mode) burst NOR flash
devices
• NAND Flash
• Pseudo-SRAM devices

— On Mon, 6/17/13, Jack Zhang jackzhang273@gmail.com wrote:


> From: Jack Zhang jackzhang273@gmail.com
> Subject: Re: [beagleboard] Re: Beaglebone Black GPMC Tutorial
> To: beagleboard@googlegroups.com
> Date: Monday, June 17, 2013, 10:50 AM
>
> Hi Gerald,
>
> I wish to store the signals that comes in from a ADC. But I know very little about the GPMC.
>
> A number of questions that I have:
>
> 1. How do I set up the GPMC such that it will start doing that? Do I do that in the device tree layout or in code? If so, do you have any examples that I can follow.
>
> 2. How do I use the Direct Memory Access (DMA) function? I can’t seem to find a detailed explanation of this.
>
> Jack
>
> On Friday, June 14, 2013 4:23:13 PM UTC-7, Gerald wrote:
>
> > How are you planning on using the GPMC bus?
> >
> > Gerald
> >
> > On Fri, Jun 14, 2013 at 5:44 PM, Jack Zhang jackzh...@gmail.com wrote:
> >
> > > Is anyone out there working on GPMC??
> > >
> > > This is very difficult!
> > >
> > > On Thursday, May 30, 2013 10:49:12 AM UTC-7, Jack Zhang wrote:
> > >
> > > > Hi everyone,
> > > >
> > > > Does anyone know a good GPMC tutorial? Or examples of code for this with BBB.
> > > >
> > > > I know how to change the Pin Mode already with device tree.
> > >
> > > –
> > > For more options, visit http://beagleboard.org/discuss
> > > —
> > > You received this message because you are subscribed to the Google Groups “BeagleBoard” group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard…@ googlegroups.com.
> > > For more options, visit https://groups.google.com/ groups/opt_out.
> >
> > –
> >
> > Gerald
> >
> > ger...@beagleboard.org
> > g-co...@ti.com
> > http://beagleboard.org/
> > http://circuitco.com/support/
>
> –
> For more options, visit http://beagleboard.org/discuss
> —
> You received this message because you are subscribed to the Google Groups “BeagleBoard” group.
> To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.


|

Jack

  the TRM discusses GPMC and EDMA
7.1 GPMC
7.1.1 Introduction

Examples on How to set it up might be tough I would check the starterware

I know of one military SDR app needed this so for OMAP4 I am sure the
GPMC is similar but you wont find that code in the public domain

Dont expect any help from most the SW people on here they spend their
lives writing convoluted scripts to build Linux and have no real

Heh, there are some extremely talented people on this list, who will answer properly phrased questions; where previous research and attempts at solutions are presented.

Your asking for help in a area ecompassing REAL world applications
in a forum
addressing some hobbyist version of Linux that targets the mobile world
and is DOMINATED by FAE scripsters adept at convoluting how to build a
kernel

I think you'll find that those convoluted kernel scripts enable me to build professional broadcasting products based on Linux in a _deterministic_ way. I would imagine that is as real world as it gets, and is no way related to anything mobile; what you have stated is nonsense.

I think there is an FPGA cape which uses the GPMC bus, whether that uses it in a similar way to what you are envisioning; I don't know, but the code is GPL licensed, and as such available to view.

If you wish to do low level work like this I would recommend you either delve into some Linux Kernel programming guides or move to something a little closer to the metal, such as the suggested StarterWare, which TI provides support for.

The mmc and spi drivers that the 'convoluted' kernel scrips build, make use of edma within the Linux kernel, that would also be a good place to go exploring.

Cheers,

I did this a while back:

https://github.com/balister/linux-omap-philip/blob/e100-2.6.38/drivers/misc/usrp_e.c

and (for GPMC setup see):

https://github.com/balister/linux-omap-philip/blob/e100-2.6.38/arch/arm/mach-omap2/board-overo.c

No devicetree help here though. I also do build system work and ignore Lazerman.

Philip




— On Mon, 6/17/13, Jack Mitchell ml@communistcode.co.uk wrote:I think there is an FPGA cape which uses the GPMC bus, whether that uses it in a similar way to what you are envisioning; I don’t know, but the code is GPL licensed, and as such available to view



Good news for Jack if
1) Device is similar
2) He can find the code


Thanks for Jack



|

I read somewhere that I need to send a DMA request to get the GPMC to store the input data from the expansion to set to the memory.

Does anyone know how to do this?

Jack

You do not need to use DMA to talk to devices attached the the GPMC.

Here are two githubs for the Blank Canvas Cape, an fpga add-on cape for the beaglebone. https://github.com/emeb/bcc_lib and https://github.com/ka6sox/bcc_software.

The first one is by the cape creator, Erik Brombaugh, and includes everything you need to program the fpga from the beaglebone. The second link is from Tom King and includes a DTS file for the blank canvas cape, and an example verilog implementation of SRAM for the fpga.

I think the .dts will help you get started setting up the gpmc and IO pins. If you can provide more information on what you are trying to connect to the beaglebone I probably better advise where you can look. As mentioned by others the AM335x datasheet and Technical Reference Manual will be your best friends. (http://www.ti.com/litv/pdf/sprs717f and http://www.ti.com/litv/pdf/spruh73h).

A quick google also revealed these two pages that will be of interest to you: http://processors.wiki.ti.com/index.php/AM335x_NAND_Driver’s_Guide and http://processors.wiki.ti.com/index.php/Tips_for_configuring_OMAP35x,_AM35x,_and_AM-DM37x_GPMC_registers

Best of luck, and report back how things work out. :slight_smile:

For now, I just want something as simple as connecting some 3.3 V to the expansion set (having switched the mode to GPMC), which will form some form of an 8 bit input (for example: 10101010).

My question, how do I configure the GPMC such that it will store that input into the memory and how can I read on that, say on the console?

Jack

Ah, in that case take a look at this: http://engineersofthecorn.blogspot.ca/2012/06/faux-gpmc-interfacing-with-beaglebone.html. It’s exactly what you want to do, but for pre-device tree, so you will have to adjust for that.

Thanks that really helped. I can get that to work on my beaglebone.

But eventually I have to get it working on my beaglebone black. As you probably know, the difficulty with that is change in the Pin Mux to mode 0 for the input. Beaglebone black does not let you do that, because it has something to do with eMMC. Do you know how to bypass that?

Thanks!

Jack

The beaglebone black boots off the eMMC, so takes exclusive access of the GPMC pins. You have to boot off the sdcard and disable the eMMC. I remember seeing a post about this… want to hold the eMMC in reset I believe. I can’t find the post right now, but you should be able to get at it somewhere in google groups. I only have beaglebone whites, so have never had to do this.

Good luck, and please report back what you find.

Took a quick look around, this looks like it will be useful: https://groups.google.com/forum/#!searchin/beagleboard/emmc$20disable/beagleboard/pSOre-xZz8o/fh9GdHn_JXsJ

Finally found out how to do this.

In your uEnv.txt file which you can access on the USB. Delete whatever is on that, and add the following line:

optargs=quiet drm.debug=7 capemgr.disable_partno=BB-BONE-EMMC-2G

This will disable the EMMC. When you “cat /sys/devices/bone_capemgr.9/slots” you will get

0: 54:PF—
1: 55:PF—
2: 56:PF—
3: 57:PF—
4: ff:P-O-- Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI

Now you can load your device tree. Here is a sample of my code.

/*

  • FL-PCONV-001-001.dts

There is a problem with this, that I am trying to investigate.

After a while, the BBB will just freeze with USER2 (activity indicator) and USER3 (eMMC) on.