scheduled wake up

0 views
Skip to first unread message

David Retana

unread,
Jun 9, 2013, 10:28:19 AM6/9/13
to pico-S...@googlegroups.com
Hi there,

I was wondering if is picosam capable of wake up at certain programmed timestamp?

Let's say there is a cron task which suspend or shutdown the unit and, using for example the rtc
device, the picosam can wakes up or boots.

Does somebody have an idea ho to perform this?

thanks

Daniel Palmer

unread,
Jun 9, 2013, 10:43:15 AM6/9/13
to pico-S...@googlegroups.com
I would check the datasheet for the AT91SAM9G45 to see if it can do that. On my board at least the RTC drifts a lot when it's powered down so I don't know how useful it would be.


--
You received this message because you are subscribed to the Google Groups "pico-SAM9G45 Mini-Box.com ARM embedded system board" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pico-SAM9G45...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Erik van Luijk

unread,
Jun 9, 2013, 12:20:36 PM6/9/13
to pico-S...@googlegroups.com

rtcwake -s 120 -m no; poweroff

Is use it to powecycle the mini pci express device.

Op 9 jun. 2013 16:28 schreef "David Retana" <dvd...@gmail.com> het volgende:
--

Erik van Luijk

unread,
Jun 9, 2013, 12:22:20 PM6/9/13
to pico-S...@googlegroups.com

And you need a kernelpatch. I will send that tomorrow (utc)

Op 9 jun. 2013 18:20 schreef "Erik van Luijk" <its...@gmail.com> het volgende:

Erik van Luijk

unread,
Jun 10, 2013, 6:22:36 AM6/10/13
to pico-S...@googlegroups.com
The rtcwken is not enabled in the Nicu Pavel kernel to fix this apply the following patch:

diff --git a/arch/arm/mach-at91/board-picosam9g45.c b/arch/arm/mach-at91/board-picosam9g45.c
index 1059d5a..fd47d69 100644
--- a/arch/arm/mach-at91/board-picosam9g45.c
+++ b/arch/arm/mach-at91/board-picosam9g45.c
@@ -64,6 +64,11 @@ static void __init picosam9g45_init_early(void)
 #endif
        /* set serial console to ttyS0 (ie, DBGU) */
        at91_set_serial_console(0);
+        /* shutdown controller, wakeup button (5 msec low) */
+        at91_sys_write(AT91_SHDW_MR, AT91_SHDW_CPTWK0_(10) | AT91_SHDW_WKMODE0_LOW
+                               | AT91_SHDW_RTTWKEN
+                               | AT91_SHDW_RTCWKEN);
+
 }

 /*
diff --git a/arch/arm/mach-at91/include/mach/at91_shdwc.h b/arch/arm/mach-at91/include/mach/at91_shdwc.h
index c4ce07e..7f81d93 100644
--- a/arch/arm/mach-at91/include/mach/at91_shdwc.h
+++ b/arch/arm/mach-at91/include/mach/at91_shdwc.h
@@ -29,6 +29,7 @@
 #define                AT91_SHDW_CPTWK0        (0xf << 4)              /* Counter On Wake Up 0 */
 #define                        AT91_SHDW_CPTWK0_(x)    ((x) << 4)
 #define                AT91_SHDW_RTTWKEN       (1   << 16)             /* Real Time Timer Wake-up Enable */
+#define         AT91_SHDW_RTCWKEN       (1   << 17)             /* Real Time Clock Wake-up Enable */

 #define AT91_SHDW_SR           (AT91_SHDWC + 0x08)     /* Shut Down Status Register */
 #define                AT91_SHDW_WAKEUP0       (1 <<  0)               /* Wake-up 0 Status */


regards Erik
Reply all
Reply to author
Forward
0 new messages