Skip to content
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

mbed-os-5.15: Nuvoton: Fix NuMaker I2C timeout #13709

Merged
merged 3 commits into from
Nov 2, 2020

Conversation

cyliangtw
Copy link
Contributor

Summary of changes

This PR is to fix I2C timeout measurement for NuMaker platforms instead of hardcode max timer count on OS-5.15 branch.
The same commit got approval in PR #13679 on OS-6.x master branch.

Impact of changes

Migration actions required

Documentation


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


@0xc0170
@andypowers

  some H/W timer count is 24 bits only, hardcode 0xffffffff causing
  wrong judgement of timeout as while H/W timer counting overflow.
@ciarmcom ciarmcom requested review from 0xc0170, andypowers and a team October 5, 2020 04:00
@ciarmcom
Copy link
Member

ciarmcom commented Oct 5, 2020

@cyliangtw, thank you for your changes.
@andypowers @0xc0170 @ARMmbed/mbed-os-maintainers please review.

andypowers
andypowers previously approved these changes Oct 12, 2020
Copy link
Collaborator

@andypowers andypowers left a comment

Choose a reason for hiding this comment

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

Approved.

@mergify mergify bot added needs: CI and removed needs: review labels Oct 12, 2020
0xc0170
0xc0170 previously approved these changes Oct 13, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Oct 13, 2020

CI started

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 21, 2020

CI restarted

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 30, 2020

@cyliangtw Can you review line endings for files in this PR:

targets/TARGET_NUVOTON/TARGET_NANO100/i2c_api.c
targets/TARGET_NUVOTON/TARGET_NANO100/i2c_api.c

Please fix

@cyliangtw
Copy link
Contributor Author

cyliangtw commented Oct 30, 2020

@cyliangtw Can you review line endings for files in this PR:

targets/TARGET_NUVOTON/TARGET_NANO100/i2c_api.c
targets/TARGET_NUVOTON/TARGET_NANO100/i2c_api.c

Please fix

@0xc0170 , Hi
I compared with other platform i2c_api.c, such like as /TARGET_M480/i2c_api.c and TARGET_M251/i2c_api.c . All of the line endings are the same as 0x0d 0x0a. Even, checked TARGET_M480/gpio_api.c, the line endings are still the same.
I can't open the details of continuous-integration/jenkins/pr-head.
So far, I don't know what's the problem on /TARGET_NANO100/i2c_api.c .
More, I just built NANO130 blinky sample with i2c manipulation, it's successful.
How could I reproduce the error of jenkins checking ?

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 30, 2020

If I follow the steps here on Github, I am on 5.15 branch:

git checkout -b OpenNuvoton-nvt_i2c_timeout_5.15 mbed-os-5.15
git pull https://github.com/OpenNuvoton/mbed.git nvt_i2c_timeout_5.15

git status

On branch OpenNuvoton-nvt_i2c_timeout_5.15
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   targets/TARGET_NUVOTON/TARGET_M451/i2c_api.c
        modified:   targets/TARGET_NUVOTON/TARGET_NANO100/i2c_api.c

no changes added to commit (use "git add" and/or "git commit -a")

git diff:

warning: CRLF will be replaced by LF in targets/TARGET_NUVOTON/TARGET_M451/i2c_api.c.
The file will have its original line endings in your working directory
warning: CRLF will be replaced by LF in targets/TARGET_NUVOTON/TARGET_NANO100/i2c_api.c.
The file will have its original line endings in your working directory
diff --git a/targets/TARGET_NUVOTON/TARGET_M451/i2c_api.c b/targets/TARGET_NUVOTON/TARGET_M451/i2c_api.c

There are line endings errors.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 30, 2020

Would git add --renormalize fix both files?

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 30, 2020

If executing above command, it should be simple to just amend the previous comments to fix it. I would like to start CI asap to get this in for the next release (early next week).

@mergify mergify bot dismissed stale reviews from andypowers and 0xc0170 November 2, 2020 03:41

Pull request has been modified.

@cyliangtw
Copy link
Contributor Author

@0xc0170 , Thanks a lot of your recommendation.
I fixed the line ending issue at commit 3d0be7d and also could pass the merge steps locally.

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 2, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Nov 2, 2020

Test run: SUCCESS

Summary: 10 of 10 test jobs passed
Build number : 7
Build artifacts

@0xc0170 0xc0170 merged commit e4f42d8 into ARMmbed:mbed-os-5.15 Nov 2, 2020
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.

5 participants