[Sleep and wake up for Odroid C2]

Post Reply
boycece1
Posts: 5
Joined: Thu Nov 29, 2018 5:23 pm
languages_spoken: english
ODROIDs: Odroid C2
Contact:

[Sleep and wake up for Odroid C2]

Unread post by boycece1 » Thu Nov 29, 2018 5:31 pm

I'm newbie with C2 board, I want to sleep board in 5 minutes and wake up. What I need to do?
On linux i have find out command "$ systemctl hibernate", but it's not work on C2.

Thanks.

User avatar
odroid
Site Admin
Posts: 30028
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: [Sleep and wake up for Odroid C2]

Unread post by odroid » Thu Nov 29, 2018 5:50 pm

Our ARM boards don't support the suspend (sleep/wakeup) feature. Sorry about that.

User avatar
mad_ady
Posts: 5428
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Contact:

Re: [Sleep and wake up for Odroid C2]

Unread post by mad_ady » Thu Nov 29, 2018 8:59 pm

I think the best you can do is wake up via ir.

https://wiki.odroid.com/odroid-c2/appli ... ir_wake_up

User avatar
rooted
Posts: 6440
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Contact:

Re: [Sleep and wake up for Odroid C2]

Unread post by rooted » Fri Nov 30, 2018 5:21 am

mad_ady wrote:I think the best you can do is wake up via ir.
Or possibly with rtc alarm, it works on XU4 it may work on C2?

viewtopic.php?f=146&t=26667&view=unread

User avatar
odroid
Site Admin
Posts: 30028
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: [Sleep and wake up for Odroid C2]

Unread post by odroid » Fri Nov 30, 2018 9:26 am

@rooted,
No. XU4 RTC is included in the PMIC.
But, this C2 GPIO wake up with the RTC Shield Interrupt output could be a solution.
https://wiki.odroid.com/odroid-c2/appli ... key_wakeup

boycece1
Posts: 5
Joined: Thu Nov 29, 2018 5:23 pm
languages_spoken: english
ODROIDs: Odroid C2
Contact:

Re: [Sleep and wake up for Odroid C2]

Unread post by boycece1 » Fri Nov 30, 2018 10:04 am

odroid wrote:Our ARM boards don't support the suspend (sleep/wakeup) feature. Sorry about that.
oke, i know, thanks a lot.

User avatar
mad_ady
Posts: 5428
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Contact:

Re: [Sleep and wake up for Odroid C2]

Unread post by mad_ady » Fri Nov 30, 2018 5:20 pm

I'm speculating wildly as usual, but when you put the c2 in sleep what is left running? Who is listening for IR? Is it the Cortex M0 controller or a cpu core? Is uboot involved?
My wild guess is uboot could be modified to count ticks and issue a wakeup similar to how the ir works.

User avatar
rooted
Posts: 6440
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Contact:

Re: [Sleep and wake up for Odroid C2]

Unread post by rooted » Fri Nov 30, 2018 5:24 pm

The C2 isn't in standby, it's fully powered down. My guess is the M0 is still running.

joy
Posts: 678
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X
Contact:

Re: [Sleep and wake up for Odroid C2]

Unread post by joy » Fri Dec 21, 2018 2:48 pm

Yes.
As rooted mentioned, secure_task in bl301 is alive after power off.

After power off, C2 enters suspend of secure_task.
https://github.com/hardkernel/u-boot_fi ... task.c#L61
https://github.com/hardkernel/u-boot_fi ... pend.c#L72

Then, on a registered function, detect_key, some conditions are checked periodically here.
https://github.com/hardkernel/u-boot_fi ... trl.c#L257

Code: Select all

unsigned int detect_key(unsigned int suspend_from)
{
.....
.....
	do {
//----------- CEC wakeup check....
#ifdef CONFIG_CEC_WAKEUP
		if ((hdmi_cec_func_config >> CEC_FUNC_MASK) & 0x1) {
			if (cec_msg.log_addr) {
				cec_handler();
				if (cec_msg.cec_power == 0x1) {  //cec power key
					uart_puts("CEC wakeup event!\n");
					exit_reason = CEC_WAKEUP;
					break;
				}
			} else {
				cec_node_init();
			}
		}
#endif

//----------- IR remote check....

		if (remote_detect_key()) {
			exit_reason = REMOTE_WAKEUP;
			break;
		}
		
//----------- GPIO Wakeup key check....	
#ifdef CONFIG_GPIO_WAKEUP
		if (is_gpiokey) {
			if (gpio_detect_key()) {
				exit_reason = GPIO_WAKEUP;
				break;
			}
		}
#endif
.....
.....
	return exit_reason;
}
If you want to handle wake-up, you can adjust these routines.
But, note that it's not suspend or sleep,
so after wakeup, everything goes to the sw reboot flow.
Also please check AO (always on) blocks.

boycece1
Posts: 5
Joined: Thu Nov 29, 2018 5:23 pm
languages_spoken: english
ODROIDs: Odroid C2
Contact:

Re: [Sleep and wake up for Odroid C2]

Unread post by boycece1 » Mon Mar 18, 2019 4:57 pm

thanks for all reply !!

boycece1
Posts: 5
Joined: Thu Nov 29, 2018 5:23 pm
languages_spoken: english
ODROIDs: Odroid C2
Contact:

Re: [Sleep and wake up for Odroid C2]

Unread post by boycece1 » Tue Mar 19, 2019 4:23 pm

rooted wrote:
Fri Nov 30, 2018 5:21 am
mad_ady wrote:I think the best you can do is wake up via ir.
Or possibly with rtc alarm, it works on XU4 it may work on C2?

viewtopic.php?f=146&t=26667&view=unread
i have try and fail. thanks fỏ your help!

boycece1
Posts: 5
Joined: Thu Nov 29, 2018 5:23 pm
languages_spoken: english
ODROIDs: Odroid C2
Contact:

Re: [Sleep and wake up for Odroid C2]

Unread post by boycece1 » Tue Mar 19, 2019 4:27 pm

joy wrote:
Fri Dec 21, 2018 2:48 pm
Yes.
As rooted mentioned, secure_task in bl301 is alive after power off.

After power off, C2 enters suspend of secure_task.
https://github.com/hardkernel/u-boot_fi ... task.c#L61
https://github.com/hardkernel/u-boot_fi ... pend.c#L72

Then, on a registered function, detect_key, some conditions are checked periodically here.
https://github.com/hardkernel/u-boot_fi ... trl.c#L257

Code: Select all

unsigned int detect_key(unsigned int suspend_from)
{
.....
.....
	do {
//----------- CEC wakeup check....
#ifdef CONFIG_CEC_WAKEUP
		if ((hdmi_cec_func_config >> CEC_FUNC_MASK) & 0x1) {
			if (cec_msg.log_addr) {
				cec_handler();
				if (cec_msg.cec_power == 0x1) {  //cec power key
					uart_puts("CEC wakeup event!\n");
					exit_reason = CEC_WAKEUP;
					break;
				}
			} else {
				cec_node_init();
			}
		}
#endif

//----------- IR remote check....

		if (remote_detect_key()) {
			exit_reason = REMOTE_WAKEUP;
			break;
		}
		
//----------- GPIO Wakeup key check....	
#ifdef CONFIG_GPIO_WAKEUP
		if (is_gpiokey) {
			if (gpio_detect_key()) {
				exit_reason = GPIO_WAKEUP;
				break;
			}
		}
#endif
.....
.....
	return exit_reason;
}
If you want to handle wake-up, you can adjust these routines.
But, note that it's not suspend or sleep,
so after wakeup, everything goes to the sw reboot flow.
Also please check AO (always on) blocks.
this good suggestion, I will try!

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 1 guest