-- To join: http://beagleboard.org/discuss
To unsubscribe from this group, send email to:
beagleboard...@googlegroups.com
Frequently asked questions: http://beagleboard.org/faq
You can take a look at the following source for the example how to
control PWM's on the BeagleBoard xM using direct memory writes:
https://www.gitorious.org/veter/vehicle/blobs/master/src/xenopwm.c
Actual GPIO toggling is in pwm_func() and all the required
initialization is in the initpwm() function.
You can also take a look at the following article for some more
details and context:
http://veter-project.blogspot.co.uk/2011/09/real-time-enough-about-pwms-and-shaky.html
Since many months I want to re-write the code as a kernel module
(xenomai RTDM driver) but did not get to it yet (it is just a hobby
project). Stars will come to the right position :-) maybe I would be
able to do it on this weekend. Anyway I will post results as soon as
they will be available.
Andrey.
David
>Would you not be better off writing some PRUSS code, and doing the GPIO
>from there?
If just driving a shift register, using one of the synchronous serial
ports (such as McASP or SPI) would also make sense rather than using GPIO.
>
On Friday 23 Mar 2012, Jerrill wrote:
> I'm working on a BeagleBone project that needs to drive a few GPIO pretty
> fast (driving a 110-bit shift register, chip selects, etc. with a full SR
> update occurring every 4 ms). I've got my add-on hardware proven out using
> sys/class/gpio but it's way too slow. My next thought before going off and
> changing the hardware design is to write a kernel module to do the heavy
> lifting of driving the GPIO pins.
>
> My initial attempts at building just a "Hello, World!" type module
> ultimately lead to a dead end with a missing header file that doesn't
> exist. I'm sure I'm missing something pretty simple (like a define
> somewhere that needs to be adjusted) but I would be eternally grateful to
> anyone who can know down the learning curve a bit.
>
> Does anyone have a working example of how to build a kernel module that
> flashes, say, the USR3 LED without using sys/class/gpio. Source code and
> Makefile would be great. Thanks in advance for any assistance, links, etc.
>
> Jerrill
>
> -- To join: http://beagleboard.org/discuss
> To unsubscribe from this group, send email to:
> beagleboard+unsubscribe@googlegroups.com
I looked at the PRU module information in the Sitara Technical Reference Manual here:
http://www.ti.com/product/am3358
Yes, it looks like this peripheral is intended for exactly what I want to do, though I've never used the peripheral before and would have some studying to do.
My background is firmware development (in C and assembly) on microcontrollers like the MSP430, 8050, PIC, etc. So I'm comfortable digesting this sort of documentation. However I'm new to ARM and new to Embedded Linux. What I'm missing is the experience with Linux to know how to even begin to interface to a GPIO (much less a PRU) from the higher level abstraction layers of the OS. Right now there is this big wall between me and all the horsepower the micro offers and it's called Linux and I'm just don't know enough (yet) to get around it.
Right now, my understanding is that unless I want to compile a custom kernel, then I need to build a custom kernel module. I don't know how to do either off the top of my head, but I imagine that the learning curve on the kernel module is less steep. I've done both in the past with some of the more commercial Linux versions following dirt simple tutorials, but haven't had much success doing the same for the BeagleBone yet.
Any direction is welcome. Thanks.
Jerrill
On 23-3-2012 17:10, Jerrill wrote:I looked at the PRU module information in the Sitara Technical Reference Manual here:
http://www.ti.com/product/am3358
Yes, it looks like this peripheral is intended for exactly what I want to do, though I've never used the peripheral before and would have some studying to do.
My background is firmware development (in C and assembly) on microcontrollers like the MSP430, 8050, PIC, etc. So I'm comfortable digesting this sort of documentation. However I'm new to ARM and new to Embedded Linux. What I'm missing is the experience with Linux to know how to even begin to interface to a GPIO (much less a PRU) from the higher level abstraction layers of the OS. Right now there is this big wall between me and all the horsepower the micro offers and it's called Linux and I'm just don't know enough (yet) to get around it.
Right now, my understanding is that unless I want to compile a custom kernel, then I need to build a custom kernel module. I don't know how to do either off the top of my head, but I imagine that the learning curve on the kernel module is less steep. I've done both in the past with some of the more commercial Linux versions following dirt simple tutorials, but haven't had much success doing the same for the BeagleBone yet.
Any direction is welcome. Thanks.
Jerrill
Hi Jerill,
-- 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 23-3-2012 17:10, Jerrill wrote:I looked at the PRU module information in the Sitara Technical Reference Manual here:
http://www.ti.com/product/am3358
Yes, it looks like this peripheral is intended for exactly what I want to do, though I've never used the peripheral before and would have some studying to do.
My background is firmware development (in C and assembly) on microcontrollers like the MSP430, 8050, PIC, etc. So I'm comfortable digesting this sort of documentation. However I'm new to ARM and new to Embedded Linux. What I'm missing is the experience with Linux to know how to even begin to interface to a GPIO (much less a PRU) from the higher level abstraction layers of the OS. Right now there is this big wall between me and all the horsepower the micro offers and it's called Linux and I'm just don't know enough (yet) to get around it.
Right now, my understanding is that unless I want to compile a custom kernel, then I need to build a custom kernel module. I don't know how to do either off the top of my head, but I imagine that the learning curve on the kernel module is less steep. I've done both in the past with some of the more commercial Linux versions following dirt simple tutorials, but haven't had much success doing the same for the BeagleBone yet.
Any direction is welcome. Thanks.
Jerrill
Hi Jerill,
You don't need to build a custom kernel module to use the PRUSS. You only need the uio_pruss module and a user space application to load and start a PRU.
I don't know if the uio_pruss module is enabled and built by default nowadays. If not, then you'll need to compile a kernel, or obtain the module from someone else.
It will be a steep learning curve, but all information is available if you search the newsgroup or otherwise ask around. And it's fun to do. You'll also find that the PRU is a fine design with plenty of debugging capabilities. Myself, I'm controlling 4 stepper motors with one PRU and each runs up to 60 kHz steprate (a limitation of the motor drivers, much headroom available). Acceleration is also done in the PRU. Linux is only used for the not hard-realtime code.
Success,
Bas
---
-- To join: http://beagleboard.org/discuss
To unsubscribe from this group, send email to:
beagleboard...@googlegroups.com
Frequently asked questions: http://beagleboard.org/faq
-- Jack Mitchell (ja...@embed.me.uk) Embedded Systems Engineer http://www.embed.me.uk --
Yeah I'm trying to get faster GPIO throughput too and have been able to reach about 5MHz using mmap. But this is still way slower than should be achievable because I can reach speeds of >25MHz by writing bare metal code for the BeagleBone. Does anyone know if writing a kernel driver would allow access w/o mmap and maybe improve throughput?
On Fri, 3 Aug 2012 04:03:59 -0700 (PDT)
Francois <majes...@gmail.com> wrote:
> Would anyone have any example of how to write a kernel driver for
> gpio ?
See LDD [1]. There's examples.
[1]: https://lwn.net/Kernel/LDD3/
-Andrew
I can ensure you that by using module, at least 10MHz were achieved by me.The MANNUAL says Bank0 can works under 100MHz with proper configuration of clk, but only bank0.if you set the registers and get this real, inform me please.Looking forward your seccess.2012-08-04
xiooozzz
发件人:jmelson发送时间:2012-07-17 05:40主题:Re: [beagleboard] BeagleBone kernel module for fast GPIO access
On Saturday, July 14, 2012 1:53:04 AM UTC-5, Hans wrote:Yeah I'm trying to get faster GPIO throughput too and have been able to reach about 5MHz using mmap. But this is still way slower than should be achievable because I can reach speeds of >25MHz by writing bare metal code for the BeagleBone. Does anyone know if writing a kernel driver would allow access w/o mmap and maybe improve throughput?My understanding is that using mmap you are already accessing the GPIO hardware at the lowest level. The trick they use to reduce power and-- To join: http://beagleboard.org/discuss
maybe complexity is to multiplex the GPIO by banks. On the original Beagle Board it is about 240 ns, apparently the bone cuts it to ~225 ns
with a faster clock, or maybe because it has fewer GPIO banks. So, I don't think you can go faster via GPIO accesses. When I started with this
I tried to figure out how to turn up the clock on the GPIO system, but I never got that to work.
At least what I've seen so far, there is no way to get 25 MHz out of the GPIO. Now, the MMC peripherals can go faster, but they are serial, so
that may not increase speed much over a byte-wide GPIO port.
Jon
To unsubscribe from this group, send email to: