Beaglebone Black GPIO Interrupt, and minor JTAG/gdb issue

Chris Johns chrisj at rtems.org
Mon Jun 22 20:36:19 UTC 2015



On 22/06/2015 3:13 pm, Steve B wrote:
> Hello all,
> 
> I'm playing around with getting an interrupt service routine going on
> Beaglebone Black.
> 
> I am aware that Ketul with GSoC is working on the GPIO code but for now
> I have just decided to manually peek and poke the registers from my
> application code, as I didn't see anything IRQ related yet in the patch
> on the github site for that effort.
> 
> Here's what I have done:
> 1. Set GPIO1_13 as an output, physically jumped GPIO1_13 (P8, 11) to
> GPIO1_12 (P8, 12).
> 2. Set bit (1 << 12) to the GPIO_IRQENABLE_SET_1 and
> GPIO_IRQENABLE_SET_0 registers for GPIO1, per AM338x technical reference
> manual.
> 3. Set bit (1 << 12) to the GPIO_RISINGDETECT register for GPIO1.
> 4. Installed an ISR to GPIO number 98 or 99 which is the IRQ for GPIO1.
> 
> I hacked this into the "ticker" demo from examples-v2 and added a line
> of code to toggle GPIO1_13 in the periodic task to stimulate the interrupt.
> 
> I may be close but something is not quite right here.
> Whenever the interrupt happens, the CPU resets and runs the uboot that
> is stored on its eMMC instead of going to my ISR. Any thoughts on why
> that might be?
> Attaching my code here also. Sorry it's kind of an ugly hack for now, I
> just punched a few lines of code into the ticker example.
> 
> And an unrelated note, anytime I do a "load" and run my application
> through GDB, if I try to halt and load again, the CPU always starts from
> uboot on the eMMC and I have to halt and load one extra time. This is
> with flyswatter2 and OpenOCD. Anyone experienced this?

I typically reset and reload each debug cycle.

With the Beagle Board XM I used when Ben and I played with this stuff a
while ago I loaded the MIO code from uboot with OpenOCD via GDB. The
details can be found here:

https://git.rtems.org/rtems-tools/tree/tester/rtems/testing/bsps/beagleboardxm.mc

The GDB fragment of interest is:

  target remote kaka:3333
  mon beagleboard_xm_mlo /path/bb/uboot/u-boot/MLO
  load
  b _Terminate_CPU_Fatal_halt
  continue

And the OpenOCD TCL for beagleboard_xm_mlo can be found here:

 https://git.rtems.org/rtems/tree/c/src/lib/libbsp/arm/beagle/simscripts/bbxm.cfg

Chris


More information about the users mailing list