Hello everyone,

Thank you for all the input. It's been a busy few days so I'm just getting
back to it.

First, I was talking about AdafruitBB_IO. I was just being lazy and/or
confused in typing BBB_IO, but I now see that BBBIO
<https://github.com/tomtzook/BBBIO> is a different C library for the
Beaglebone Black. I do write C code for microcontrollers, so I don't know
why I felt like a program on an SBC should be in Python, but I don't want
to start over from scratch now.

The PCBA test program is a long series of while loops, if statements and
timeout counters that wait for inputs and evaluate them, or move on if
they're taking too long. I was thinking of using an AdafruitBB_IO edge
detect to watch for an abort button press, then having that trigger a
function that handles any wrap-up tasks and calls a *break* function to pop
out of the main test loop to another outer loop so that it returns to the
top of the test. I'm actually doing this now to halt the test if the
in-circuit programmer reports a flashing failure. The difference is: the
programmer failure happens at a known point where I know to look for it,
but the abort button should be able to be used at any time.

One idea I've had but not tested yet is to replace the *sleep()* functions
I judiciously use for timing throughout the test with a custom function
that breaks the sleep period (anywhere from 10 ms to 10 s) into smaller
chunks interspersed with checking of the abort button GPIO. This I could do
just with libpruio as suggested by TJF. Theoretically, I could wait for
every subsequent while loop to time out at 60 seconds each, but that's not
practical for test throughput, or when you are billed for testing by the
minute.

Somewhat separate from all this, though: I've been finding the device tree,
overlays and pinmuxes to be some of the more difficult BBB/Linux topics to
wrap my head around, so I would appreciate any recommended tutorials on the
subject. There are tutorials that come up in Google searches, but with the
changes to both Linux and Beaglebone over the years, it's hard to know if
they are pertinent to the state of my system right now (I've not updated to
the latest kernel etc. because I don't want to break any of my past work).

Thanks,
--
Don Pancoe, P.E.
Industrial Designer, Electrical Engineer
DonPancoe.com <http://donpancoe.com/>


On Wed, Mar 3, 2021 at 4:09 AM TJF <jeli.freih...@gmail.com> wrote:

> Hello Don Pancoe!
>
> Why do you think you'll need an IRQ for the "abort" button?
>
> Drop Adafruit_BBIO! Just setup the GPIO in libpruio and poll the state in
> your main loop (or in a timered thread).
>
> Regards
> donp...@gmail.com schrieb am Montag, 1. März 2021 um 19:27:01 UTC+1:
>
>> Hello all,
>>
>> I have a BBB Python application (PCBA test fixture) where I am using
>> libpruio, specifically for access to the eCAP pins. Libpruio requires that
>> the universal cape be disabled, but when I needed a UART and I2C, I was
>> able to add those back in using the existing dtbo files from /lib/firmware
>> (shown below) in my uEnv.txt.
>>
>> uboot_overlay_addr0=/lib/firmware/BB-I2C1-00A0.dtbo
>> uboot_overlay_addr1=/lib/firmware/BB-UART4-00A0.dtbo
>> uboot_overlay_addr2=/lib/firmware/DP-GPIO-PCBATest-00A0.dtbo (I talk
>> about this below)
>>
>>
>> Now I want to add an "abort" button to the test fixture since the
>> technicians have reported it takes a lot of time to reset if the board
>> under test locks up. I expect that wiring a pushbutton to a GPIO with an
>> interrupt is the way to handle this, and I've been thinking that there are
>> two ways to get there.
>>
>>    1. Include another dtbo file to add a single GPIO that I can then
>>    access with Adafruit_BBIO (this is where my efforts have focused so far), 
>> or
>>    2. Figure out how to work with the hardware-based IRQ of the PRU
>>    with libpruio (which I've been avoiding because it looks even more scary)
>>
>> I've tried to make a custom dtbo by following an example from Derek
>> Molloy (github.com/derekmolloy/boneDeviceTree) and while it compiled and
>> booted OK, I still get the following error when I run a simple test
>> program. The same error as when I tried running the program before I
>> created the dtbo.
>>
>> kapsul@beaglebone:~/pyDev$ sudo python3 abortTest.py
>> Traceback (most recent call last):
>>   File "abortTest.py", line 6, in <module>
>>     GPIO.setup("P9_12", GPIO.IN)
>> ValueError: Set gpio mode failed, missing file or invalid permissions.
>>
>>
>> Further, when I do the following (with or without the dtbo), I get the
>> following...
>>
>> kapsul@beaglebone:~/pyDev$ config-pin -q p9.12
>> P9_12 pinmux file not found!
>> Cannot read pinmux file: /sys/devices/platform/ocp/ocp*P9_12_pinmux/state
>>
>>
>> Any input would be appreciated, whether it is correcting me on path 1 or
>> steering me towards path 2. I will happily provide any additional info, but
>> I didn't want to start uploading stuff until I know what, exactly, will be
>> helpful.
>>
>> Thanks,
>> --
>> Don Pancoe, P.E.
>> Industrial Designer, Electrical Engineer
>> DonPancoe.com <http://donpancoe.com/>
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beagleboard/e16d3e52-0239-4df2-bb47-8aac7776728dn%40googlegroups.com
> <https://groups.google.com/d/msgid/beagleboard/e16d3e52-0239-4df2-bb47-8aac7776728dn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAP3tSUNNhEyWrJTcAGyS_mTZnKOQ6GYykELgS1Kj5iNJ-Gv0Bg%40mail.gmail.com.

Reply via email to