Pocket Beagle 2 M4: Best First Steps to Programming?

What is generally the best path to learn how to program the M4, found inside the PB2? Code Composer via JTAG? Writing and loading firmware via Linux? I see the Zephyr RTOS integration is a WIP, and I haven’t found much on getting that setup either. Any help is appreciated.

1 Like

Writing and loading Zephyr RTOS firmware using remoteproc is the standard way. One can use Code Composer with Ti FreeRTOS based sdk, but most of the focus from BeagleBoard.org is on Zephyr.

The instructions to build and load a simple hello world Zephyr firmware can be found here. Other than that, everything is standard zephyr. If you follow along with any zephyr tutorials (I remember going through CircuitDojo), you should be fine.

NOTE: If you want to use any peripherals/pins from M4, they do need to be disabled on the Linux side.

1 Like

My guess is looking at

/sys/class/remoteproc/remoteproc0/firmware

Is you could write code, put it in

/lib/firmware/am62-mcu-m4f0_0-fw

Then

echo start > /sys/class/remoteproc/remoteproc0/state

Should start it running. You’ll have to check that whatever pins you are using, are set to the M4 using them …

Well, technically yes. The problem is that the last step to start/stop m4 does not work in 6.12 kernel. So you need to restart pb2 in those kernel versions.

In 6.18, you can start and stop m4 at runtime.

1 Like