Is it possible to shutdown Main CPU but keep PRU running?

Hello there!

Is it possible to boot the Black, load a PRU binary, start it, shutdown the Main CPU again and keep a PRU Running?

Would this reduce energy consumption? Can sb. approximate by which factor?

Is it possible to start the Main System agein and read the Results or Logs from PRU work out of the memory again?

How would that look like practicle? Load PRU Program, shutdown linux distro without -h and -P arguments to keep power supply, boot distro after some time, relink to pru completion interruptevent, read the memory for results?

I’m sorry I’m not very experienced with this. I read and workesd through the Book “Exploring Beaglebone Tools and Techniques for building with embedded Linux” by Derek Molloy and found it extremly helpfull!

But I couldn’t find out about the above questions.

Thanks in advance!

Stefan

Is it possible to boot the Black, load a PRU binary, start it, shutdown the Main CPU again and keep a PRU Running?

The hardware can do this without any problem. Be sure to use a recent -ti kernel rather than a -bone kernel to ensure you have the latest power management features available. However, since it is not one of the standard power modes implemented in software, some patching or workarounds will be needed…

At face value, entering standby should in principle do almost what you’re asking: it powers down the CPU while keeping the peripheral domain powered. One issue is that it normally puts all PLLs in bypass, which means PRUSS and the L3 interconnect would be clocked at 24 MHz instead of 200 MHz. Assuming that’s not desirable, you’d either need to locate the code responsible and patch it, or have PRU reenable the PLL(s) you need after entry into standby is complete.

It’s also quite possible that some code will try to be helpful by noticing PRUSS is being used and either block entry into suspend, or disable PRUSS prior to entering suspend. In that case you’ll need to hunt that down and kill it. :wink:

Would this reduce energy consumption? Can sb. approximate by which factor?

It would obviously reduce energy consumption, but I have no idea how much. If you want to keep PRU at full performance you obviously won’t save as much as standby mode normally would. Note btw that if you’re okay with slower L3/L4 interconnects it’s possible to use the display PLL instead of the core PLL as clock source for PRUSS, and allow the core PLL to go into bypass. Obviously the LCD controller would need to be disabled for this. (If you need the display when not in standby you could probably make a switchover, but that would be yet another complication.)

Is it possible to start the Main System agein and read the Results or Logs from PRU work out of the memory again?

The “wakeup via gpio” method could be used, with PRU toggling the GPIO (or just manually setting the irq bit to make it look like it toggled). PRU may also be able to directly signal the cortex-M3 to wake up the system, though its firmware would need to be examined (or changed) for that.

The cortex-M3 then proceeds to power up the cortex-A8. Boot ROM notices the power up is due to resume rather cold power up and jumps to the resume address in on-chip SRAM, where linux has put the resume-from-suspend code.

BTW, now that you mention memory: the external DDR3 memory would normally be put into self-refresh mode when in standby, so if you need access to it that would be one more thing to prevent or undo.

Anyhow, the summary is: yes, it is absolutely possible, but tinkering will be required to get it to work.

References:

  • chapter 8 (PRCM) of the AM335x TRM, especially section 8.1.4.6
  • the cortex-M3 firmware
  • various bits of the linux source tree:
  • arch/arm/mach-omap2/pm33xx.c and sleep33xx.c
  • search for files named wkup_m3_*
1 Like

Hello Matthijs van Duin,

Thank you very much for taking your time and answereing my this detailed and precise!

Everything you wrote was very interesting and I used the information as keywords for further investigations.

Unfortunetly I think I am far away from beeing advanced enough for some of this. But I will try to get there.

Thx a lot!

Stefan