Skip to content

Conversation

TomoYamanaka
Copy link
Contributor

@TomoYamanaka TomoYamanaka commented Mar 28, 2018

Description

I implemented SLEEP feature in GR-PEACH.

Pull request type

[X] Fix
[ ] Refactor
[ ] New target
[] Feature
[ ] Breaking change

@TomoYamanaka TomoYamanaka force-pushed the feature-hal-spec-sleep branch from a682b61 to 1c92778 Compare March 28, 2018 22:02
volatile uint8_t dummy_8;

CPG.STBCR1 = 0x00;
dummy_8 = CPG.STBCR1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this dummy read needed?

volatile uint8_t wk_CPGSTBCR12 = CPGSTBCR12;
volatile uint8_t wk_CPGSTBCR13 = CPGSTBCR13;

CPGSTBCR3 = 0xFF;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are all of these registers doing?

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is many constants/values that are not clear (@cmonr pointed few). Can you provide some description for those? Naming, code comments, git commit message helps.

can you share the tests results as part of this?

@TomoYamanaka
Copy link
Contributor Author

Sorry for my late reply.
I will revise this committed code for writing out in a few days.
In that case, I will provide descriptions against the above comments and attach the test result.

@TomoYamanaka TomoYamanaka force-pushed the feature-hal-spec-sleep branch from 1c92778 to d19aa20 Compare April 5, 2018 10:16
@TomoYamanaka TomoYamanaka changed the title Implementation of SLEEP feature in GR-PEACH Implementation of SLEEP feature for Renesas mbed boards Apr 5, 2018
@TomoYamanaka
Copy link
Contributor Author

I modified this commit code with writing out and reflected the above comments, added the description.
Test result of SLEEP is here.
PEACH_GCC.txtLYCHEE_GCC.txt

volatile uint8_t dummy_8;

core_util_critical_section_enter();
wk_CPGSTBCR3 = CPGSTBCR3;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are these lines doing? Can you add a commentaas for some you did (line 130 for instance). Could be for entire block. By looking at the lines, I have no understanding of why lines 116 - 127 are doing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a process for temporarily saving register values for powerdown the peripheral module.
I added a comment in the code.

module_standby_out();
core_util_critical_section_exit();

(void)dummy_8;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

specific meaning to do this dummy8 after waking up?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is intended to implicitly avoid warnings to unused variables and has no particular meaning.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 5, 2018

The updated commit message 👍 I still do not understand some lines in the code that should be documented? Please review my latest comments if we could add some clarification to the implementation (what is the intention with those device specific values)

I implemented the SLEEP feature for Rnesas mbed boards.
The mainly changing is here.
- hal_sleep()
  To satisfy the mbed specificationm, I implemented this function newly by using "sleep" that is one of low power mode that is incorporated in our hardware(RZ_A1).
  In the "sleep", peripheral and memory state are maintained, and the peripherals continue to work and can generate interrupts.

- hal_deepsleep()
  To satisfy the mbed specificationm, I implemented this function newly by combined using "sleep" and "module standby" that is the low power mode that is incorporated in our hardware(RZ_A1).
  The "module standby" is peripheral module's powerdown.
  Also in case of our "module standby", it need to read register as dummy when access to each register.
@TomoYamanaka TomoYamanaka force-pushed the feature-hal-spec-sleep branch from d19aa20 to d247407 Compare April 6, 2018 02:49
Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 6, 2018

BTW, the jenkins CI failure - there are few PR affected - github is investigating these ref failures.

/morph build

@mbed-ci
Copy link

mbed-ci commented Apr 6, 2018

Build : FAILURE

Build number : 1677
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6501/

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 9, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Apr 9, 2018

Build : FAILURE

Build number : 1683
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6501/

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 9, 2018

the failure are not related to this , but its on the branch. investigating

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 9, 2018

@mprse The commit 7faa2ac217ff2d964637 breaks the build (I reverted it, and can compile). Can you please review?

@mprse
Copy link
Contributor

mprse commented Apr 10, 2018

Looks like solution has been provided here PR #6492. It has been merged yesterday, so I think now should be all ok.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 10, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Apr 10, 2018

Build : SUCCESS

Build number : 1697
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6501/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Apr 10, 2018

@mbed-ci
Copy link

mbed-ci commented Apr 10, 2018

@0xc0170 0xc0170 merged commit 1befcc2 into ARMmbed:feature-hal-spec-sleep Apr 13, 2018
@TomoYamanaka TomoYamanaka deleted the feature-hal-spec-sleep branch July 12, 2018 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants