Commit Graph

32 Commits (9aef9d36612ea4f75f93d254ee442ded0a1ffde0)

Author SHA1 Message Date
David Saada 542744d03c Support erase value in Flash HAL drivers, FlashIAP and block devices 2018-11-07 14:23:07 +02:00
Cruz Monrreal 0db896036c
Merge pull request #8485 from NXPmicro/feature-qspi-kinetis
Feature qspi kinetis
2018-10-23 12:38:11 -05:00
Mahesh Mahadevan e28fb7466b MCUXpresso: Add the QSPI HAL driver
This should support QSPI on Kinetis devices

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-10-18 12:14:23 -05:00
Mahesh Mahadevan ebf31c67f0 MCUXpresso: Ensure the RTC OSC is running at bootup on Kinetis platforms
This is a fix for Issue 5348.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-10-18 08:55:48 -05:00
Mahesh Mahadevan 9a47915791 MCUXpresso Flash Driver: Update Flash driver to support RAPIDIOT
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-10-16 08:52:15 -05:00
Oren Cohen 787317b7eb Remove uVisor from mbed-os 2018-08-22 16:36:59 +03:00
Oren Cohen 795248bcaf Restore lp_ticker_free to previous implementation when running with uvisor
This is a temporary patch until uvisor is removed
2018-08-20 13:20:45 +03:00
Przemyslaw Stekiel ace821017f Add implementation of ticker_free() function to CI boards.
This PR provides implementation of ticker_free() function for the following boards:
ARCH_PRO
EV_COG_AD3029LZ
EV_COG_AD4050LZ
K22F
K64F
K82F
KW24D
KW41Z
LPC546XX
NRF51_DK
NRF52_DK
NUCLEO_F207ZG
NUCLEO_F401RE
NUCLEO_F429ZI
NUCLEO_F746ZG
REALTEK_RTL8195AM
2018-08-02 09:48:10 +02:00
Przemyslaw Stekiel c0ee843d63 Add lp/us ticker_free() functions stub.
This patch adds only empty stubs of `us_ticker_free()` and `lp_ticker_free()` for all boards where these functions are not implemented.
2018-07-25 08:58:38 +02:00
Bartek Szatkowski a305d849a8 Rename LOWPOWERTIMER to LPTICKER 2018-05-25 13:06:56 -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
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
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
Bartek Szatkowski 6e9f04bf2f Rename DEVICE_LOWPOWERTIMER to DEVICE_LPTICKER
That's to match DEVICE_USTICKER.
2018-05-25 12:20:09 -05:00
Przemyslaw Stekiel 39852f772c Adapt K64F lp ticker driver to the new standards.
Low power ticker time counter is created based on RTC which is driven by 32KHz clock. Additional low power timer is used to generate interrupts.
We need to adapt driver to operate on ticks instead of us.

Perform the following updates:
- provide lp ticker configuration: 32KHz/32 bit counter.
- lp_ticker_init() routine disables lp ticker interrupts .
- adapt the driver functions to operate on ticks instead us.
- adapt comments.
- add us_ticker_free() routine.
2018-05-25 12:18:55 -05:00
Mahesh Mahadevan 72011173fc MCUXpresso: Fix deepsleep implementation for Kinetis parts
1. Fix the check to look for if MCG has a PLL
2. Do setup before and after deep sleep mode execution

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-04-10 08:16:41 -05:00
Mahesh Mahadevan 5230bcaf6f MCUXpresso: Update the I2C implmentation for byte read and write
1. Start function: Issue repeat start when bus is busy
2. Byte write function: Do not call SDK function as this does
   not work for some of the Kinetis device
3. Byte read function: Do not call SDK function as this would
   issue a START and STOP signal which is not required for
   I2C byte functions

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-03-09 08:32:22 -06:00
Mahesh Mahadevan 53fa4e5fc4 MCUXpresso: Enable I2C SDA & SCL pins internal pullup resistors
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2018-03-09 08:18:21 -06:00
Przemyslaw Stekiel b6a01de070 K64F lp ticker driver - calculation bug fix.
Delta calculation from lp_ticker_set_interrupt() function:
delta_us = timestamp > now_us ? timestamp - now_us : (uint32_t)((uint64_t)timestamp + 0xFFFFFFFF - now_us);

Lets assume that timestam == now_us.
Expected delta value should be 0 and in this current version is 0xFFFFFFFF.

The following condition:
timestamp > now_us
should have the following form:
timestamp >= now_us

Additionally modified us ticker driver to provide the same logic.
2018-02-09 14:29:24 +01:00
Mahadevan Mahesh bc5c94517c MCUXpresso: Fix LPTimer issue when using multiple timeout objects
Fix for Issue #5150

Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2017-10-19 11:38:22 +01:00
Mahadevan Mahesh 1dadb055f7 RTC HAL: Allow writing 0 to the seconds register
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2017-09-21 13:33:07 -05:00
Mahadevan Mahesh 8a8553e8a0 Add call to DAC_Enable as this is no longer done as part of DAC_Init
Fixes Issue #3999

Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2017-08-10 09:36:48 -05:00
Martin Kojtal 10ea63b8e7 Ticker: add fire interrupt now function
fire_interrupt function should be used for events in the past. As we have now
64bit timestamp, we can figure out what is in the past, and ask a target to invoke
an interrupt immediately. The previous attemps in the target HAL tickers were not ideal, as it can wrap around easily (16 or 32 bit counters). This new
functionality should solve this problem.

set_interrupt for tickers in HAL code should not handle anything but the next match interrupt. If it was in the past is handled by the upper layer.

It is possible that we are setting next event to the close future, so once it is set it is already in the past. Therefore we add a check after set interrupt to verify it is in future.
If it is not, we fire interrupt immediately. This results in
two events - first one immediate, correct one. The second one might be scheduled in far future (almost entire ticker range),
that should be discarded.

The specification for the fire_interrupts are:
- should set pending bit for the ticker interrupt (as soon as possible),
the event we are scheduling is already in the past, and we do not want to skip
any events
- no arguments are provided, neither return value, not needed
- ticker should be initialized prior calling this function (no need to check if it is already initialized)

All our targets provide this new functionality, removing old misleading if (timestamp is in the past) checks.
2017-07-13 12:23:25 +01:00
Deepika 251fae34ac Resolving: unused variable 'mode' [-Wunused-variable]. mode is used to determine kMCG_ModePEE in case of PEE to switch back manually as default after wakeup MCG is in PBE mode. this is required only when PEE mode is required 2017-06-15 12:14:04 -05:00
Mahadevan Mahesh b3b0d21c8b Flash API support using the MCUXpresso drivers
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2017-06-09 11:20:23 -05:00
Russ Butler f749a2990b Safely initialize RTC on kinetis devices
When initializing the RTC on Kinetis devices, handle the case where
the time overflow interrupt is pending and the case where the time
alarm flag is pending. These flags persist across reset and if not
handled will cause a crash when powering up the low power ticker.

This problem manifested as a lp_ticker test failure on the K22F and
K64F on CI only when running a nightly. This problem has been present
but was made obvious by PR #4094 which configures all tickers to
interrupt at least every MBED_TICKER_INTERRUPT_TIMESTAMP_MAX_DELTA
(~31 minutes). This caused the RTC alarm to fire 31 minutes after the lp_ticker
or lp_timeout test and caused the next run of the lp_ticker test to
crash on boot.
2017-06-06 15:30:41 -05:00
Bartek Szatkowski 6a045a49a9 Platform: Add sleep/deepsleep user facing functions
Add sleep/deepsleep functions to platform layer which are replacing HAL
functions with the same name, rename existing symbols in HAL layer
to hal_sleep/hal_deepsleep. This way sleep functions
are always available, even if target doesn't implement them, which makes
the code using sleep clearer. It also enables us to make decision on in
which builds (debug/release) the sleep will be enabled.
2017-01-19 09:39:29 +00:00
Sam Grove be28fd85a9 Merge pull request #3438 from NXPmicro/SERIAL_ASYNC_API
K64F: Add support for SERIAL ASYNCH API
2017-01-09 10:46:46 -06:00
Mahadevan Mahesh 1280dfcca5 MCUXpresso I2C: Handle 0 byte write
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-12-28 08:03:49 -06:00
Mahadevan Mahesh ece7b6f05b K64F: Add support for SERIAL ASYNCH API
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-12-21 11:35:27 -06:00
Mahadevan Mahesh e5ba1d2b37 Rename KSDK2 to MCUXpresso. This is the new name of this package from NXP
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-12-19 14:20:25 -06:00