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

MCUXpresso_MCUS: Apply K64F us_ticker fix across all MCU's #6287

Merged
merged 1 commit into from Mar 14, 2018

Conversation

Projects
None yet
4 participants
@mmahadevan108
Contributor

mmahadevan108 commented Mar 6, 2018

No description provided.

@cmonr cmonr added the needs: work label Mar 6, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented Mar 6, 2018

@mmahadevan108 Please fill out this PR's description.

Basic information such as where the fix is coming and/or what issues this is fixing would be appreciated. We provide a PR template as a quick way to get it started.

@mmahadevan108

This comment has been minimized.

Contributor

mmahadevan108 commented Mar 6, 2018

The below change was applied to K64F.


commit b6a01de
Author: Przemyslaw Stekiel przemyslaw.stekiel@mobica.com
Date: Fri Feb 9 14:29:24 2018 +0100

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.

diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/us_ticker.c b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/us_ticker.c
index dc6ab710f..e4796608a 100644
--- a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/us_ticker.c
+++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/us_ticker.c
@@ -83,10 +83,15 @@ void us_ticker_clear_interrupt(void)

void us_ticker_set_interrupt(timestamp_t timestamp)
{

  • uint32_t now_us, delta_us;
  • now_us = us_ticker_read();
  • delta_us = timestamp >= now_us ? timestamp - now_us : (uint32_t)((uint64_t)timestamp + 0xFFFFFFFF - now_us);
  • uint32_t delta = timestamp - us_ticker_read();
    PIT_StopTimer(PIT, kPIT_Chnl_3);
    PIT_StopTimer(PIT, kPIT_Chnl_2);
  • PIT_SetTimerPeriod(PIT, kPIT_Chnl_3, (uint32_t)delta);
  • PIT_SetTimerPeriod(PIT, kPIT_Chnl_3, (uint32_t)delta_us);
    PIT_EnableInterrupts(PIT, kPIT_Chnl_3, kPIT_TimerInterruptEnable);
    PIT_StartTimer(PIT, kPIT_Chnl_3);
    PIT_StartTimer(PIT, kPIT_Chnl_2);

This PR includes this change for other MCUXpresso platforms.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Mar 6, 2018

@mprse Fyi.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Mar 6, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Mar 6, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Mar 7, 2018

@mmahadevan108 The info shared above about the fix should be part of the commit message. It is not clear what is this fixing and how (can you amend the commit message to add there the info from #6287 (comment)) ?

MCUXpresso_MCUS: Apply K64F us_ticker fix across all MCU's
Applied changes from commit b6a01de
for other MCUXpresso MCUs

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>

@mmahadevan108 mmahadevan108 force-pushed the NXPmicro:Update_usticker branch from 2712eca to 7ed36e4 Mar 7, 2018

@mmahadevan108

This comment has been minimized.

Contributor

mmahadevan108 commented Mar 7, 2018

@0xc0170 I have updated the commit message.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Mar 7, 2018

/morph build

@0xc0170

0xc0170 approved these changes Mar 7, 2018

@mbed-ci

This comment has been minimized.

mbed-ci commented Mar 7, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Mar 8, 2018

/morph test

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Mar 8, 2018

/morph test

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Mar 9, 2018

@cmonr cmonr merged commit 5523d53 into ARMmbed:master Mar 14, 2018

19 checks passed

AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Local events testing has passed
Details
travis-ci/littlefs Passed, code size is 10060B (+0.00%)
Details
travis-ci/mbed2-ATMEL Local mbed2-ATMEL testing has passed
Details
travis-ci/mbed2-MAXIM Local mbed2-MAXIM testing has passed
Details
travis-ci/mbed2-NORDIC Local mbed2-NORDIC testing has passed
Details
travis-ci/mbed2-NUVOTON Local mbed2-NUVOTON testing has passed
Details
travis-ci/mbed2-NXP Local mbed2-NXP testing has passed
Details
travis-ci/mbed2-RENESAS Local mbed2-RENESAS testing has passed
Details
travis-ci/mbed2-SILICON_LABS Local mbed2-SILICON_LABS testing has passed
Details
travis-ci/mbed2-STM Local mbed2-STM testing has passed
Details
travis-ci/tools Local tools testing has passed
Details

@mmahadevan108 mmahadevan108 deleted the NXPmicro:Update_usticker branch Mar 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment