<div dir="ltr">Greetings Steve, I have modified your code so the standard task only toggles one LED and the interrupt on GPIO12 should toggle the other 3. However, IO cannot for the life of me find which pin is GPIO12 so I can test on the hardware. I have posted the code with the mods I made at the bottom of this email<div><br></div><div><a href="http://beagleboard.org/support/bone101">http://beagleboard.org/support/bone101</a><br></div><div><br></div><div>What physical pin should I be toggling to make it work?</div><div><br></div><div>Thanks</div><div><br></div><div><div>/*</div><div> * COPYRIGHT (c) 1989-2007.</div><div> * On-Line Applications Research Corporation (OAR).</div><div> *</div><div> * The license and distribution terms for this file may be</div><div> * found in the file LICENSE in this distribution or at</div><div> * <a href="http://www.rtems.com/license/LICENSE">http://www.rtems.com/license/LICENSE</a>.</div><div> */</div><div><br></div><div>#include <stdio.h></div><div>#include <stdlib.h></div><div>#include <stdint.h></div><div>#include <bsp.h></div><div><br></div><div>#include "./testmacros.h"</div><div><br></div><div>#define GPIO_IRQSTATUS_0 0x2C</div><div>#define GPIO_IRQSTATUS_1 0x30</div><div><br></div><div>#define GPIO_IRQSTATUS_SET_0 0x34</div><div>#define GPIO_IRQSTATUS_SET_1 0x38</div><div>#define OE_ADDR 0x134</div><div>#define GPIO_DATAOUT 0x13C</div><div>#define GPIO_DATAIN 0x138</div><div>#define GPIO_RISINGDETECT 0x148</div><div>#define GPIO_FALLINGDETECT 0x14C</div><div><br></div><div>#define GPIO0_ADDR 0x44E07000</div><div>#define GPIO1_ADDR 0x4804C000</div><div>#define GPIO2_ADDR 0x481AC000</div><div>#define GPIO3_ADDR 0x481AF000</div><div><br></div><div>#define GPIO1_IRQn 99 //GPIO INT1A</div><div><br></div><div><br></div><div><br></div><div>rtems_id Task_id[ 4 ]; /* array of task ids */</div><div>rtems_name Task_name[ 4 ]; /* array of task names */</div><div><br></div><div>rtems_task Test_task(</div><div> rtems_task_argument task_index</div><div>)</div><div>{</div><div> rtems_time_of_day time;</div><div> rtems_interval ticks;</div><div><br></div><div> ticks = task_index * 2 * rtems_clock_get_ticks_per_second();</div><div><br></div><div> for ( ; ; ) {</div><div> (void) rtems_clock_get_tod( &time );</div><div> /*if ( time.second >= 35 ) {</div><div> puts( "*** END OF CLOCK TICK TEST ***" );</div><div> //exit( 0 );</div><div> while(1);</div><div> }*/</div><div> put_name( Task_name[ task_index ], FALSE );</div><div> print_time( " - rtems_clock_get_tod - ", &time, "\n" );</div><div> </div><div> //Toggle GPIO. ISR will wake up on rising edge of this,</div><div> // if P8_11 and P8_12 are jumped together.</div><div> *(unsigned long *)(GPIO1_ADDR+GPIO_DATAOUT) ^= (1<<13);</div><div><br></div><div> // toggle first led only</div><div> *(unsigned long *)(GPIO1_ADDR+GPIO_DATAOUT) ^= ((1<<21);</div><div> </div><div> (void) rtems_task_wake_after( ticks );</div><div> }</div><div>}</div><div><br></div><div>//ISR:</div><div>rtems_isr GPIO1_IRQHandler (rtems_vector_number vector)</div><div>{</div><div> //Toggle other three LEDs here:</div><div> *(unsigned long *)(GPIO1_ADDR+GPIO_DATAOUT) ^= ((1<<22)| (1<<23) |(1<<24));</div><div> </div><div> //Clear interrupt:</div><div> //Per AM335x technical reference manual, we can read IRQSTATUS,</div><div> // and then write corresponding bits on IRQSTATUS to clear whichever one was serviced.</div><div> // in this application it's hard coded to number 12 so I just write that bit.</div><div> // For some reason writing IRQSTATUS value back to itself doesn't clear the interrupt.</div><div> unsigned long irqstat = *(unsigned long*)(GPIO1_ADDR + GPIO_IRQSTATUS_1);</div><div> *(unsigned long*)(GPIO1_ADDR + GPIO_IRQSTATUS_1) = (1<<12);</div><div> //*(unsigned long*)(GPIO1_ADDR + GPIO_IRQSTATUS_1) = irqstat;</div><div> </div><div>}</div><div><br></div><div>rtems_task Init(</div><div> rtems_task_argument argument</div><div>)</div><div>{</div><div> rtems_time_of_day time;</div><div> </div><div> //Enable all four LEDs as outputs (GPIO1_21, 22, 23, 24), and one line to feed into IRQ line (I choose number 13):</div><div> *(unsigned long *)(GPIO1_ADDR+OE_ADDR) &= ~((1<<21) | (1<<22) | (1<<23) | (1<<24) | (1<<13));</div><div> //Set all outputs LOW to start:</div><div> *(unsigned long *)(GPIO1_ADDR+GPIO_DATAOUT) &= ~((1<<21) | (1<<22)| (1<<23) | (1<<24) | (1<<13));</div><div> </div><div> puts( "\n\n*** GPIO IRQ Test by Steve Battazzo modified by Angelo Fraietta***" );</div><div><br></div><div> time.year = 1988;</div><div> time.month = 12;</div><div> time.day = 31;</div><div> time.hour = 9;</div><div> time.minute = 0;</div><div> time.second = 0;</div><div> time.ticks = 0;</div><div><br></div><div> (void) rtems_clock_set( &time );</div><div> </div><div> *(unsigned long *)(GPIO1_ADDR+GPIO_IRQSTATUS_SET_1) = (1<<12); //Enable IRQ on GPIO1_12</div><div> *(unsigned long *)(GPIO1_ADDR+GPIO_RISINGDETECT) |= (1<<12); //Rising detect on GPIO1_12</div><div> </div><div> //Install ISR</div><div> rtems_status_code status = rtems_interrupt_handler_install(GPIO1_IRQn, "GPIO", RTEMS_INTERRUPT_UNIQUE, \</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>(rtems_interrupt_handler) GPIO1_IRQHandler, NULL);</div><div> if (status != RTEMS_SUCCESSFUL)</div><div> {</div><div> puts("\r\nCould not install interrupt handler.\r\n");</div><div> }</div><div> else</div><div> {</div><div> puts("\r\nInterrupt handler installed.\r\n");</div><div> }</div><div> </div><div> Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );</div><div><br></div><div> (void) rtems_task_create(</div><div> Task_name[ 1 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,</div><div> RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ]</div><div> );</div><div><br></div><div> (void) rtems_task_start( Task_id[ 1 ], Test_task, 1 );</div><div><br></div><div> (void) rtems_task_delete( RTEMS_SELF );</div><div>}</div><div><br></div><div>/**************** START OF CONFIGURATION INFORMATION ****************/</div><div><br></div><div>#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER</div><div>#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER</div><div><br></div><div>#define CONFIGURE_MAXIMUM_TASKS 4</div><div><br></div><div>#define CONFIGURE_RTEMS_INIT_TASKS_TABLE</div><div>#define CONFIGURE_INIT_TASK_STACK_SIZE (2 * RTEMS_MINIMUM_STACK_SIZE)</div><div><br></div><div>#define CONFIGURE_EXTRA_TASK_STACKS (4 * RTEMS_MINIMUM_STACK_SIZE)</div><div><br></div><div>#define CONFIGURE_INIT</div><div>#include <rtems/confdefs.h></div><div><br></div><div>/**************** END OF CONFIGURATION INFORMATION ****************/</div><div><br></div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 21, 2015 at 4:26 AM, Steve B <span dir="ltr"><<a href="mailto:sbattazzo@gmail.com" target="_blank">sbattazzo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>I think Xenomai (alongside Linux) works quite well on Beaglebone Black in my experience, so you might consider that. There's a pretty easy to follow guide on getting that up and running, also.<br><br>I was considering RTEMS for a particular project but device drivers were not available and I wasn't sure about developing those from the ground up. I ended up having to port drivers for Xenomai eventually but I think the actual work of driver porting took less time than it would have with RTEMS.<br></div>For an example of how to get an interrupt off of a GPIO, this white paper may be useful, it looks like they did something close to what you want to do: <cite><a href="https://www.osadl.org/fileadmin/dam/rtlws/12/Brown.pdf" target="_blank">https://www.osadl.org/fileadmin/dam/rtlws/12/Brown.pdf</a> <br></cite></div><cite><br></cite></div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Mon, Feb 16, 2015 at 12:59 PM, angelo fraietta <span dir="ltr"><<a href="mailto:newsgroups@smartcontroller.com.au" target="_blank">newsgroups@smartcontroller.com.au</a>></span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><span><br>
On 16/02/2015 5:34 PM, Mathew Benson wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You're doing that in the CPU? If all your doing is toggling a GPIO at a steady rate, why don't you just use the PRU and a PWM pin? Or do you have RTEMS running in the PRU?<br>
</blockquote>
<br></span>
That is all I did in the test to see what sort of performance I could get just toggling a pin. What I actually need to do is interrupt every 640ns, and during that time, read 14 pins and store values in memory. Then, after 16 of these, toggle a pint. After 10ms of this, I need to raise an event to read the 10ms worth of data, encode it, and send it via UDP.</span><div><div><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sent from my iPad<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
On Feb 16, 2015, at 12:15 AM, angelo fraietta <<a href="mailto:newsgroups@smartcontroller.com.au" target="_blank">newsgroups@smartcontroller.<u></u>com.au</a>> wrote:<br>
<br>
Greetings<br>
<br>
Have you got interrupts working on the GPIOs. Also, do you have any sample of reading and writing to GPIO. I need to see whether it is going to be fast enough,<br>
<br>
I ran a program (on linux) on beagle that used registers basically toggling an output. EG<br>
</span><a href="http://vabi-robotics.blogspot.com.au/2013/10/register-access-to-gpios-of-beaglebone.html" target="_blank">http://vabi-robotics.blogspot.<u></u>com.au/2013/10/register-<u></u>access-to-gpios-of-beaglebone.<u></u>html</a><span class=""><br>
<br>
It toggled at rate of just under 1Mhz, and what was just doing a while 1 loop. I did not look even look at interrupts there and did nothing else - I didn't even do any reads of GPIO.<br>
<br>
I want to get interrupts happening at 1.56Mhz (preferable) and read 14 GPOI, sbut I could go to half the rate by reducing my sample rate. The beagle runs at 1Ghz, so I think it should be able to handle it.<br>
<br>
<br>
Thanks<br>
<br>
<br>
<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
On 23/01/2015 4:19 PM, Ben Gras wrote:<br>
All,<br>
<br>
A while ago I finished the basics needed to use the beaglebones and<br>
beagleboards with RTEMS. The hardware support isn't very complete yet.<br>
The code is merged with RTEMS mainline though. My fork of rtems-tools<br>
and RSB is needed for help with building.<br>
<br>
Full details on how to build it are here:<br>
</span><a href="http://www.shrike-systems.com/beagleboard-xm-beaglebone-black-and-everything-else-rtems-on-the-beagles.html" target="_blank">http://www.shrike-systems.com/<u></u>beagleboard-xm-beaglebone-<u></u>black-and-everything-else-<u></u>rtems-on-the-beagles.html</a><span class=""><br>
<br>
I hope you like it :-). Let me know if you'd like any followup.<br>
<br>
Cheers,<br>
Ben<br>
<br>
<br>
<br>
<br>
On Thu, Jan 22, 2015 at 4:46 AM, angelo fraietta<br></span>
<<a href="mailto:newsgroups@smartcontroller.com.au" target="_blank">newsgroups@smartcontroller.<u></u>com.au</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Greetings<br>
Does anyone know the status of the beaglebone port?<br>
<br>
Thanks<br>
<br>
---<br>
This email has been checked for viruses by Avast antivirus software.<br>
</span><a href="http://www.avast.com" target="_blank">http://www.avast.com</a><br>
<br>
______________________________<u></u>_________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" target="_blank">http://lists.rtems.org/<u></u>mailman/listinfo/users</a><br>
</blockquote></blockquote><span class="">
-- <br>
Dr Angelo Fraietta<br>
A.Eng, A.Mus.A, BA(Hons), Ph.D.<br>
<br>
PO Box 859<br>
Hamilton NSW 2303<br>
<br>
Home Page<br>
<br>
<br>
</span><a href="http://www.smartcontroller.com.au/" target="_blank">http://www.smartcontroller.<u></u>com.au/</a><span class=""><br>
<br>
There are those who seek knowledge for the sake of knowledge - that is CURIOSITY<br>
There are those who seek knowledge to be known by others - that is VANITY<br>
There are those who seek knowledge in order to serve - that is LOVE<br>
Bernard of Clairvaux (1090 - 1153)<br>
<br>
<br>
---<br>
This email has been checked for viruses by Avast antivirus software.<br>
</span><a href="http://www.avast.com" target="_blank">http://www.avast.com</a><br>
<br>
______________________________<u></u>_________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" target="_blank">http://lists.rtems.org/<u></u>mailman/listinfo/users</a><br>
</blockquote></blockquote><span class="">
<br>
---<br>
This email has been checked for viruses by Avast antivirus software.<br>
</span><a href="http://www.avast.com" target="_blank">http://www.avast.com</a><br>
<br>
______________________________<u></u>_________________<br>
users mailing list<span class=""><br>
<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" target="_blank">http://lists.rtems.org/<u></u>mailman/listinfo/users</a><br>
</span></div></div></blockquote></div><br></div>
</blockquote></div><br></div>