7 years, 5 months ago.

GR-PEACH low power/standby mode with mbed and rtos

Has anybody had any success in getting the GR-PEACH into and out of any of the low power modes with mbed? Since there are no Renesas RZ/A1 BSP libraries (or any others that I could find) for sleep/deepsleep, I can't get the RZ/A1 to wake up from any power down mode by porting Renesas example code for other platforms.

Any pointers or sample code is appreciated.

Ed

2 Answers

7 years, 5 months ago.

Generic Wake up ARM Technical Reference details:

For reference, example code files are attached and you can consult the following: • What is the purpose of WFI and WFE instructions and the event signals? • Why does the processor enter standby when using WFE instruction but not when using WFI instruction? • WIC - Wakeup using WIC Upon receipt of Wake-up Interrupt Controller Signal, processor immediately resumes execution of instruction. This feature is optional and when implemented usually applies to Deep Sleep wakeup only

A pdf and two example projects (zip files) are attached. Sleep wake up options:

The short detailed documents on the WFE, WFI and WCI instructions are:

3.7.11. WFE Wait For Event. Syntax WFE

Operation If the event register is 0, WFE suspends execution until one of the following events occurs: (i) an exception, unless masked by the exception mask registers or the current priority level (ii) an exception enters the Pending state, if SEVONPEND in the System Control Register is set (iii) a Debug Entry request, if debug is enabled (iv) an event signaled by a peripheral or another processor in a multiprocessor system using the SEV instruction.

If the event register is 1, WFE clears it to 0 and completes immediately. For more information see Power management. Note WFE is intended for power saving only. When writing software assume that WFE might behave as NOP. Restrictions There are no restrictions. Condition flags This instruction does not change the flags. Examples WFE ; Wait for event

The WFI: 3.7.12. WFI Wait for Interrupt. Syntax WFI

Operation WFI suspends execution until one of the following events occurs: (i) an exception (ii) an interrupt becomes pending, which would preempt if PRIMASK was clear (iii) a Debug Entry request, regardless of whether debug is enabled. Note WFI is intended for power saving only. When writing software assume that WFI might behave as a NOP operation. Restrictions There are no restrictions. Condition flags This instruction does not change the flags. Examples WFI ; Wait for interrupt

/media/uploads/pateshian/wfi_wake_up_from_sleep_11_17_2016_.pdf /media/uploads/pateshian/mbed_sleep_blinky_gcc_arm_rz_a1h.zip /media/uploads/pateshian/an_r01an2189ej0081_rza1h_rtc.zip

7 years, 5 months ago.

How about the following sample?

Import programSleep_test_no_OS

This is a sample to make sleep without using OS.

Import programSleep_test_use_OS

This is a sample to make sleep using OS.

Import programSoftwareStanby_test_use_OS

This is a sample to make Software Standby using OS.


Change interrupt edge.

Edge setting

    // Both edges
    button.fall(&interrupt_button);
    button.rise(&interrupt_button);

    // Rising edge only
    button.fall(NULL);
    button.rise(&interrupt_button);

    // Falling edge only
    button.fall(&interrupt_button);
    button.rise(NULL);