Pocket Beagle software documentation

I am in the process of porting a board and code from the older Pocket Beagle to the new Pocket Beagle 2 and am looking for software development documentation. The board and code are on github here: GitHub - RobertPHeller/CommandStationsAndBoosters: Command Stations and Boosters · GitHub, specificly under PocketBeagleCommandStation_SMD (board) and BBBCommandStationOpenMRN-RevC-PB2 (software). The code will use the PRUs (both of them) for low-level bit-banging (DCC signals being sent to HBridge chips) and doing high-level management and control with the main ARM64 cores. There seems to be a lack of software development documentation. Is that documentation in the works? If so, when will it be available? And where?

If you have high-level guidance, even something like emphasizing the need for an article on porting existing PRU code from PocketBeagle to PocketBeagle 2, that could help drive the activity and I could give you a better guideline.

What I need help with right now is mapping from “GPIOi_j” to base level GPIO #’s – eg what to send to /sys/class/gpio/export. And what are the proper values to give to the config-pin command.

I’ll also need to know the correct /dev names for user mode SPI and I2C drivers. I think the PRU code itself does not need changing, depending on if the interprocess subsystem has changed.

Those days are over on mainline. Load an overlay with what gpio you want and use gpio-led for output control, gpio-key for input..

Here’s an example with ‘every’ gpio blinking… BeagleBoard-DeviceTrees/src/arm64/overlays/k3-am62-pocketbeagle2-led-all.dtso at v6.18.x · beagleboard/BeagleBoard-DeviceTrees · GitHub

if the gpio’s are controlled from the pru, just set the pru gpio configuration in the overlay.

Regards,

List of i2c/spi aliases (/dev/i2c0 = main_i2c0 for example)..

Is there documentation? The example is not documented in any meaningful way. I have a C++ program that needs to access selected pins under program control. How does the C++ code access GPIO pins. I understand about overlays setting pin control, but once set how does a user-mode C++ program actually access the pins? What does the API look like? The C++ program needs to set or clear certain pins. Other pins need to be “read”. In Arduino terms, I need functions like digital_read() and digital_write() (but obviously, not actually the Arduino library). I have an existing library here: openmrn/src/os/LinuxGpio.hxx at master · bakerstu/openmrn · GitHub that the existing version uses. I need a compatible API. Each pru needs to bit-bang one bit (just one output bit each).

Also, I need to know how the current incarnation of the interprocess communication system works. The main (Linux) system needs to send a [DCC] packet to the PRUs, that the PRUs will bit-bang out to the HBridge drivers (the pulses need to be properly timed to create the proper DCC square waves.

Random examples are not really helpful, I need real documentation. Does this documentation exist anywhere?

Output High:

voodoo@am6232-pb2-85:~$ echo 1 > /sys/class/leds/beaglebone\:green\:usr1/brightness

Output Low:

voodoo@am6232-pb2-85:~$ echo 0 > /sys/class/leds/beaglebone\:green\:usr1/brightness

Or you can use libgpiod, to access the gpio directly in your c/etc..

Regards,