Commit Graph

16723 Commits (bd8572e20ff0ca147da5f4114c8d366996764c00)

Author SHA1 Message Date
Bartek Szatkowski 2826e4e416 Disable platforms not supporting new RTC 2018-05-25 13:01:19 -05:00
Steven Cooreman 81e6c96014 Code style fixes requested by @0xc0170
Tests still passing
2018-05-25 12:59:19 -05:00
Steven Cooreman 4b3bde1082 Re-implement RTC for Silicon Labs targets
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.
2018-05-25 12:57:30 -05:00
TomoYamanaka f55becef9a Implement of RTC feature for Renesas mbed boards
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.
2018-05-25 12:53:06 -05:00
Przemyslaw Stekiel 1e46895f75 K64F: adapt RTC drivers to the new standards (is_enabled function)
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.
2018-05-25 12:52:40 -05:00
Przemyslaw Stekiel 377db73100 K64F: adapt RTC drivers to the new standards (free function)
rtc_free() does not stop the RTC from counting. Only disables clock gate since processor no longer needs to read RTC registers.
2018-05-25 12:52:40 -05:00
Przemyslaw Stekiel 4fc3d07bd0 Enable RTC support for K64F board. 2018-05-25 12:52:39 -05:00
Przemyslaw Stekiel 7f451c6705 Disable RTC support for UBLOX_EVK_ODIN_W2.
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.
2018-05-25 12:52:02 -05:00
Przemyslaw Stekiel c437e9d2c6 tests-mbed_hal-rtc_reset: Add ack from the device after each command 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.
2018-05-25 12:52:02 -05:00
Przemyslaw Stekiel a1d92e5168 HAL rtc test: increase test timeout.
Verified that on some platforms 30s is not enough.
2018-05-25 12:49:48 -05:00
Przemyslaw Stekiel 105b0ab851 HAL rtc test: check only if rtc_isenabled() returns 1 in case when init 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.
2018-05-25 12:49:48 -05:00
Przemyslaw Stekiel c93ab168bd Enable RTC support for FAMILY_STM32. 2018-05-25 12:49:48 -05:00
Bartek Szatkowski 93a7db5d84 Add clarification to rtc_free doxygen 2018-05-25 12:49:11 -05:00
Przemyslaw Stekiel a0f1627316 Update of RTC HAL API tests.
Provide minor fixes for existing test cases.
Add additional test cases.
2018-05-25 12:49:11 -05:00
Przemyslaw Stekiel 5a79655d05 Modify rtc_api.h header file - update tests specification. 2018-05-25 12:49:11 -05:00
Russ Butler 6d90c2716d Turn off RTC until updated
Turn off RTC for all devices. When support for a device is added this
should be re-enabled.
2018-05-25 12:49:11 -05:00
Cruz Monrreal 5709c04cae
Merge pull request #7019 from mikaleppanen/lwip_lpc_mem_conf
Made lwip memory configuration more specific for NXP targets
2018-05-25 12:47:29 -05:00
Russ Butler 1f97f11373 Add documentation and test the HAL RTC API
Add requirements, tests, an example implementation and additional
function documentation to the HAL RTC API.
2018-05-25 12:37:19 -05:00
Russ Butler a0a9626420 Keep rtc code if low power timer is used
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.
2018-05-25 12:37:19 -05:00
adbridge d5941e022c Add 2 more examples and remove deprecated one.
Removed:
mbed-os-example-fat-filesystem
Added:
mbed-os-example-error-handling
mbed-os-example-blockdevice
2018-05-25 18:35:31 +01:00
Russ Butler 77637682a0 Keep RTC API prototypes even when not enabled
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.
2018-05-25 12:33:43 -05:00
Bartek Szatkowski efd307fa79 Rename new occurrences of LOWPOWERTIMER to LPTICKER 2018-05-25 12:33:43 -05:00
Przemyslaw Stekiel 3850c80b43 Make common_rtc.c compatible with SDK 14.2 and move it common dir 2018-05-25 12:33:43 -05:00
Przemyslaw Stekiel f32f866f00 NRF52840_DK: Enable lp us ticker support 2018-05-25 12:33:42 -05:00
Ashok Rao 96ca7c22ed Adding usticker to MTB_ODIN 2018-05-25 12:33:42 -05:00
Jesse Marroquin 0ddec48efc mbed-os v5.9 LPTICKER implementation 2018-05-25 12:33:42 -05:00
Jesse Marroquin b88329acb8 mbed-os v5.9 USTICKER implementation 2018-05-25 12:33:42 -05:00
Przemyslaw Stekiel 11748bf95c Enable us lp ticker support for entire MCU_NRF52832 family 2018-05-25 12:33:42 -05:00
Przemyslaw Stekiel 1d1b6cd571 NRF52_DK: disable us ticker in deep-sleep mode
This functionality is required by new sleep standards.
2018-05-25 12:33:42 -05:00
Przemyslaw Stekiel e7fa5fc599 tests-mbed_hal-flash: optimieze time_cpu_cycles() function
This function should perform instruction cycles count in critical section.
Additionally remove redundant code.
2018-05-25 12:33:42 -05:00
Przemyslaw Stekiel be098399a8 tests-mbed_hal-flash: Remove 5% extra tolerance for NRF52_DK
NRF52_DK is now based on fast and accurate 1MHz counter.
2018-05-25 12:33:42 -05:00
Przemyslaw Stekiel 06c6db5119 tests-mbed_drivers-lp_timer: modify tolerance to percentage form
Represent tolerance value as it is done in `tests-mbed_drivers_timer`.
Use 5% tolerance for lp ticker.
2018-05-25 12:33:42 -05:00
Przemyslaw Stekiel a0a07d9725 tests-mbed_drivers-timerevent: increase tolerance for NRF52_DK
Test inserts event into the TimerEvent object which is scheduled 50 ms in the future. Then test thread hangs on the semaphore for 51 ms and after that time we expect that event handler has been executed. This test fails sometimes on NRF51_DK, NRF52_DK since different clocks are used for event handling and delay. TimerEvent class uses fast us ticker and semaphores are based on lp ticker (NRF51_DK) or System Tick Timer (NRF52_DK).
We assume that ticker measurement error is 10% and our 1 [ms] extra corresponds to 2% error. I suggest to increase delay to 2 [ms] (4%). This should be enough for all boards at this moment.
2018-05-25 12:33:42 -05:00
Przemyslaw Stekiel 50a5e2c1f4 tests-mbed_hal-common_tickers: fix bug in ticker increment test case
It is possible that the difference between base and next tick count on some platforms is greater than 1, in this case we need to repeat counting with the reduced number of cycles (for slower boards).
If number of cycles has been reduced than base tick count needs to be redefined. This operation is missing and is added by this patch.
2018-05-25 12:33:42 -05:00
Przemyslaw Stekiel b0153574d4 NRF52_DK: Enable lp ticker and us ticker support 2018-05-25 12:33:42 -05:00
Przemyslaw Stekiel 9ef0083f92 NRF52_DK: use new ticker driver designed for NRF51_DK 2018-05-25 12:33:41 -05:00
Mahesh Mahadevan fb622a2081 MIMXRT1050_EVK: Update lpticker implementation
Use only the GPT module and avoid using RTC.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-05-25 12:33:41 -05:00
Mahesh Mahadevan 3b7b0f1307 KW41Z, KL43Z, KL27Z: Enable LPTICKER
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-05-25 12:33:41 -05:00
Mahesh Mahadevan d46af14bb6 KL27Z: Update usticker to use TPM instead of LPTMR for ticker
This will free up the LPTMR to be used as lpticker

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-05-25 12:33:41 -05:00
Mahesh Mahadevan a21d21e700 KL43Z: Update usticker to use TPM instead of LPTMR for ticker
This will free up the LPTMR to be used as lpticker

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-05-25 12:33:41 -05:00
Mahesh Mahadevan 62254c2bae KW41Z: Update usticker to use TPM instead of LPTMR for ticker
This will free up the LPTMR to be used as lpticker

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-05-25 12:33:41 -05:00
Bartek Szatkowski 95559ad3e1 Change LPTICKER spec to allow clock freq starting at 4kHz 2018-05-25 12:32:39 -05:00
Edmund Hsu e514c2c70d Fix us_ticker.c to support "USTICKER"
- Disable microsecond ticker interrupt on reinitialization
- Skip us_ticker_set_interrupt() if timestamp is already past
- Eliminate tmr2Config since tmrConfig is adequate for all timer config
2018-05-25 12:32:38 -05:00
Mahesh Mahadevan 774de11d1f MCUXpresso: Enable usticker on MIMXRT1050_EVK
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-05-25 12:32:38 -05:00
Mahesh Mahadevan 659be61e4b MCUXpresso: Enable usticker for LPC546XX and LPC54114
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-05-25 12:32:38 -05:00
Mahesh Mahadevan 4eb8841dc1 MCUXpresso: Update the usticker implementation
Enabled usticker for K22F, K24F, K66F, K82F, KL82Z, KW24D

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-05-25 12:32:38 -05:00
Mahesh Mahadevan 0d0321a7f0 MCUXpresso: Update Low Power Ticker
1. Enable LPTICKER for K22, K24, K64, K66, K82, KL82F, KW24D
2. Change the implementation to only use the LPTMR which reduces
   the amount of interrupts generated which is required for tickless
   operation

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-05-25 12:32:38 -05:00
Mahesh Mahadevan 132dc87f3e KL05, KL25, KL26, KL46: Enable usticker
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-05-25 12:30:53 -05:00
Mahesh Mahadevan 870600400d LPC1768: Enable usticker
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-05-25 12:30:53 -05:00
Przemyslaw Stekiel c18763bb41 tests-mbed_hal-common_tickers: disable os tick while running test cases
It has been noticed on NRF51_DK board that occurrence of system tick have impact on test execution.
NRF51_DK is a slow board with fast us ticker and handling of system tick interrupt takes about 250 us ticker ticks which have huge influence on interrupt tests where interrupt is set to <current count> + 100, 200, 500 ticks.
2018-05-25 12:30:52 -05:00