Skip to content

Merge feature-hal-spec-rtc to master #6996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 26 commits into from
Closed

Conversation

bulislaw
Copy link
Member

Description

Bring new RTC HAL API to master.

Pull request type

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

@cmonr last one here.

kjbracey
kjbracey previously approved these changes May 24, 2018
jeromecoutant
jeromecoutant previously approved these changes May 24, 2018
c1728p9
c1728p9 previously approved these changes May 24, 2018
@cmonr
Copy link
Contributor

cmonr commented May 24, 2018

Marking as DNM since this will be coming in a larger PR.

c1728p9 and others added 18 commits May 24, 2018 11:23
Keep the prototypes in rtc_api.h even when DEVICE_RTC is not defined.
This allows devices that aren't fully compliant with the RTC API to
still use the header and prototypes.
Keep the RTC code if either DEVICE_RTC or DEVICE_LOWPOWERTIMER is
defined on the devices which use the RTC for both the rtc api and the
low power timer api. This allows DEVICE_LOWPOWERTIMER to be enabled while
DEVICE_RTC is turned off.
Add requirements, tests, an example implementation and additional
function documentation to the HAL RTC API.
Turn off RTC for all devices. When support for a device is added this
should be re-enabled.
Provide minor fixes for existing test cases.
Add additional test cases.
…it is done.

Since some platforms use RTC for low power timer RTC may be already enabled.
Because of that we will only verify if rtc_isenabled() returns 1 in case when init is done and RTC time is set.
Verified that on some platforms 30s is not enough.
ARM_CM3DS_MPS2: `device_has` section is provided twice for this target with and without LOWPOWERTIMER support. Probably this is some rebasing issue which needs to be fixed. Enable LOWPOWERTIMER support for this board.

MIMXRT1050_EVK: LOWPOWERTIMER is created based on RTC on this board. Since RTC is disabled LOWPOWERTIMER support also needs to be disabled.
…is executed

RTC reset test was failing when board has been just powered and RTC reset test was executed for the first time (issue has been detected on CI). In such case RTC initialization takes more time than in futher rtc_init calls. This has impact on green-tea communication. Commands send by host immediately after init command (write, read) were not handled on the device side and no response to the host was provided.
To fix this problem test communication flow has been modified. Device sends ack to the host after RTC init is done. Host sends further RTC commands when ack from the device has been received.

Edit:
There are still some communication issues on the CI. Add ack from the device after each executed command. Increase test timeout and wait after reset.
This board inherits from STM_FAMILY, but drivers for this board are not consistent with the new standards.
This board needs to be disabled for now.
rtc_free() does not stop the RTC from counting. Only disables clock gate since processor no longer needs to read RTC registers.
Make rtc_isenabled() to return 1 if the RTC is initialized and the time has been set; 0 otherwise.
Disable clock gate on exit from this function if RTC was initialized.
I implemented the RTC feature.
The mainly changing is here.
- rtc_init()
  Previously, I have initialized the time information register in the function, so the time count was cleaned by every calling rtc_init().
  Currently, rtc_init() doesn't stop RTC from counting, and rtc_init() is safe to call repeatedly.
  Therefore in order to satisfy specifications,I removed the initialization process of the time information register in the function.

- rtc_free()
  Previously, I have initialized the RTC related register same as rtc_init(), so the time count was cleaned by calling rtc_free().
  Currently, rtc_free() doesn't stop RTC from counting.
  Therefore in order to satisfy specifications,I removed the process and decided not to do anything in the function.
  If powerdown the RTC, Supply of the clock to the RTC is stopped, cannot keeping the count.
mbed RTC specifications now dictate that the RTC needs to retain and keep on counting through reset. On Silicon Labs parts, this means the RTC API can not be backed by the Silicon Labs RTC peripheral, since that doesn't provide retention functionality.
Therefore:
* On EFM32GG, EFM32WG, EFM32LG: mbed RTC API is now backed by BURTC.
* On EFM32PG, EFR32MG, EFM32PG12, EFR32MG12: mbed RTC API is now backed by RTCC.
* On EFM32ZG, EFM32HG: mbed RTC API is sadly no longer supported, since these chips don't have retained memory.
@cmonr
Copy link
Contributor

cmonr commented May 24, 2018

Removed labeling to make 5.9 tags easier to sort through. Will be brought in with #7009.

@0xc0170 0xc0170 closed this May 28, 2018
@0xc0170 0xc0170 deleted the feature-hal-spec-rtc branch June 21, 2018 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.