cancel
Showing results for 
Search instead for 
Did you mean: 

M4 -> A7 Wakeup mechanisms

NGajic
Associate III

Hi,

I'm interested in all possible mechanisms of M4 waking A7. I know that this can be done with virtual UART and GPIO pins (6 of them if I'm right), but are there other ways to do it?

Nenad

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

did you add  __HAL_RCC_RTCAPB_CLK_ENABLE(); ?

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

7 REPLIES 7
PatrickF
ST Employee

hi,

I assume your are talking about A7 in Stop mode while M4 is running.

You could find more information inside Reference Manual (PWR section).

Apart IPCC (used by OpenAMP/RPMsg for, as you pointed, e.g. for Virtual UART), MCU Send Event (SEV instruction) could be used (if enabled in EXTI).

GPIOs 6 x WKUP pins are not really M4 to A7 wakeup, they are more seen as external event wake up to A7 (or M4).

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
NGajic
Associate III

Hi @PatrickF​ ,

I have another question. I have A7 program which is doing task and then it is going to low power mode (virtual uart wakeup is enabled), and M4 core is sending message to A7 to wake it up when USER1 button is pressed on DK2 board. I noticed that A7 is not waking up and then everything is working when I press WAKEUP button, button interrupt is remembered and message is sent to A7. I added toggling of diode on 5 seconds and I found out that diode is toggling while A7 is in run mode, and when it goes to low power, M4 also stops toggling diode. Why M4 stops running, what can be reason for that?

Thanks in advance,

Nenad

Please check the Device Tree, A7 (Linux) should be aware of M4 resources which he does not have to stop when entering in low power (e.g. the GPIO handling the LED).

See https://wiki.st.com/stm32mpu/wiki/Resource_manager_for_coprocessing

Example for DK2 default DT (suitable for CubeMP1 M4 examples)

&m4_rproc {
	m4_system_resources {
		status = "okay";
 
		button {
			compatible = "rproc-srm-dev";
			interrupt-parent = <&gpioa>;
			interrupts = <14 2>;
			interrupt-names = "irq";
			status = "okay";
		};
 
		m4_led: m4_led {
			compatible = "rproc-srm-dev";
			pinctrl-names = "default";
			pinctrl-0 = <&m4_leds_orange_pins>;
			status = "okay";
		};
	};
};

See also M4 example in Projects\STM32MP157C-DK2\Applications\OpenAMP\OpenAMP_TTY_echo_wakeup

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
NGajic
Associate III

After long examination and trying, we figured out that reason for this behavior was using HAL_RTC_GetTime and HAL_RTC_GetDate on Cortex M4 when A7 was in low power mode. I read somewhere that HAL RTC driver is not ready for use, but we managed to get time and date and that worked. Is there way to make RTC working in low power, to be read from Cortex M4?

Hi,

did you add  __HAL_RCC_RTCAPB_CLK_ENABLE(); ?

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
NGajic
Associate III

Hi @PatrickF​ ​ ,

I added that now and everything is working now, diode is toggled meaning that we are not stuck on HAL RTC functions. Thanks ​

Glad to see it is working.

Regards.

In order to give better visibility on the answered topics, please click on 'Select as Best' if my reply solved your issue or answered your question. See also 'Best Answers'

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.