Passing Mailbox messages between ARM and PRU

I read this thread for the first time today… the topic is very specific, and not one that I am particularly interested in. HOWEVER if you are interested in gomer’s $.02 you might abandon your quest to decipher remoteproc.

If your project is at the prototype / poc stage (just my guess), you might consider revisiting the trusty BBB. It still has a lot going for it despite its’ age, like coherent documentation.

At the risk of being a Johnny one note, I’m going to suggest that you abandon remotemsg, and look into ring buffer(s) for your communication between ARM and PRU. At minimum, you could put up your poc without dealing with the poor documentation for more current BB products.

if you take a look at the app that I’ve made available, you’ll see that its’ ARM utilization is barely measurable even though the most complex processing is done there. it takes very few ARM cycles to do the ring buffer processing. While this clock app has no feedback from PRU to ARM, it would be trivial to implement (as a poc).

Ring buffers have lot’s of advantages over even the vaporware speak of remotemsg. They are always async, low overhead, and don’t rely on interrupts.

this gif is the best explanation of how they work, the text of the wikipedia article sadly is meh.

@FredEckert has recently posted that he successfully implemented this application. This gives me confidence that I haven’t missed any critical code or instructions to get it running. Thanks again Fred.

For your timing needs, I’m going to suggest this approach that I use routinely in other projects:

  • set up a 1mhz pwm signal into a pru fast input
  • increment a register for each pulse of the pwm (accurate 1uS timer)
  • segment your pru code into instruction blocks < 200 instructions (run in < 1uS)
  • block (waste) the remainder of the uS waiting for the pwm pulse.

the math of this approach is 4G / 1M = 4K. 4K seconds is about 68minutes 15 seconds then you have to code for rollover.

good luck!
gomer

1 Like