2023-11-28 09:42 AM
Hello! I'm trying to figure out if the M4 has the ability to put the A7 to sleep but haven't quite figured out how to get the info from the M4 to the A7 at this time. I've been going through the forums and the Ecosystem V5 page and haven't had much luck.
There's an example of how to put the A7 (and M4) into different sleep modes via the command line, I can see examples of sending a string to the A7 over the virtual UART/OPENAMP, but I haven't seen an example that is able to place the A7 in sleep mode from the A4.
The core issue might be my understanding on how the A7 handles commands it's received (from the M4 or from the command line). With the M4 code, I can see what code is being executed and where, I haven't quite seen that on the A7 (not sure where this code might be configured for viewing). I assume the example projects are designed for the starter version of the code and the command line and there are pre-configured scripts setup in it to be able to execute the example projects?
Here's an example of the low power example readme:
2.0 - Set Exti line 61 (IPCC interrupt CPU1) as source of wakeup.
> echo enabled > /sys/devices/platform/soc/4c001000.mailbox/power/wakeup
Note: This commands allows CA7 mailbox wakeup capability. EXTI->IMR2(61) will be configured
only when Linux command to move CA7 in low power mode will be done.
2.1 - Configure CM4 to wakeup CA7 after 20 seconds
> echo "*delay" >/dev/ttyRPMSG0
On reception of this message, CM4 waits for 20 seconds before sending a message
to CA7 which will activate Exti line 61 (IPCC interrupt CPU1)
2.2 - Move CA7 in CStop mode before 20 seconds delay expiration
> systemctl suspend
In that case, this command moves CA7 in CStop mode keeping System on Run Mode
as CM4 is still on CRun
LED8 stops toggling (Linux heartbeat)
2.3 - Move CA7 in CRun mode using Exti line 61 (IPCC interrupt CPU1)
After a 20 second delay, you get "*delay" in Linux console as configured
in step 2.1
LED8 toggles (Linux heartbeat)
Based on the above, I assume there's a script that runs when it receives, say, the "*delay" message over the RPMSG0 which is setup with the following lines of code:
stty -onlcr -echo -F /dev/ttyRPMSG0
cat /dev/ttyRPMSG0 &
I also assume that somewhere on the A7, there's some code running in the background that controls the LED8 "Linux Heartbeat".
I assume this same code section can be configured to execute when it receives that command from the UART/OpenAMP from the M4, but I'm not entirely sure where to find said code (and later on, where to change this code in the image so it's pre-compiled with this added to a new image. I assume I will need to move to the developer or distributor version in order to do this, which is the eventual next step).
Any help you can give me to understand how to approach being able to place the A7 in sleep mode from the M4 would be greatly appreciated! I tried to think through the process best I can but I still have a few knowledge gaps I need to fill in.
Thanks!