Skip to content

M487: Add some bugfixes #5366

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 2 commits into from
Closed

M487: Add some bugfixes #5366

wants to merge 2 commits into from

Conversation

ccli8
Copy link
Contributor

@ccli8 ccli8 commented Oct 24, 2017

Description

This PR includes the following bugfixes with NUMAKER_PFM_M487 target:

  1. Enable uVisor core debug message output via semihosting
  2. Fix premature lp_ticker interrupt

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 27, 2017

@Patater Is there anyone else who should review uvisor changes? please add as reviewer

@Patater Patater requested a review from alzix October 30, 2017 15:15
Copy link
Contributor

@Patater Patater left a comment

Choose a reason for hiding this comment

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

uVisor-related changes look OK to me.

wakeup_tick = timestamp;

Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't add trailing whitespace.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Patater I remove trailing whitespace in 44131d8.

*/
#ifdef TARGET_DEBUG
#if defined(MBED_CONF_TARGET_UVISOR_DEBUG_SEMIHOSTING_ENABLE) && MBED_CONF_TARGET_UVISOR_DEBUG_SEMIHOSTING_ENABLE
uvisor_api.debug_semihosting_enable();
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @ccli8 ,
I think you are missing the point of having uvisor_api.debug_semihosting_enable().

The idea was to have a single binary that can be executed both with debugger attached and debugger detached. There is no way to reliably programmatically determine whether debugger is attached (on all ther platforms). So we added this function to prevent MCU from halting on BKPT instruction.
We need a debugger to be attached to get the semihosting prints. In such a case - you can add a simply call to uvisor_api.debug_semihosting_enable() to the debugger init script.

Calling uvisor_api.debug_semihosting_enable() function statically guarded by ifdef is misaligned with our goal.

Please refer to the https://github.com/ARMmbed/uvisor/blob/master/docs/lib/DEBUGGING.md

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alzix The NUMAKER_PFM_M487 target doesn't support GDB debugger. Currently I can debug by following the Build with GCC and Debug with uVIsion guide. Do you know how to call uvisor_api.debug_semihosting_enable() in uVision debugger?

Copy link
Contributor

Choose a reason for hiding this comment

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

There is field under Debugger settings tab in uVision5 that allows specifying Initialization file.
uvisor_api.debug_semihosting_enable() can be called from it.
You will probably need to clear the Run to main() checkbox, otherwise initialization file commands will only be executed once you reach main.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alzix The approach is failed on my uVision 5.24. I try with another simple example and find C function call by debugger doesn't work whether in Initialization File, Command Window, or Watch Window.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alzix I remove the commit with uvisor_api.debug_semihosting_enable(). If there are other means to enable uvisor semi-hosting in Keil debugger, please let me know. Thanks.

ccli8 added 2 commits November 8, 2017 14:13
Old lp_ticker handles past event, but it has a bug with premature go-off.
The bug can re-produce on mbed-os-tests-mbed_drivers-lp_timeout/mbed-os-tests-mbed_hal-lp_us_tickers (mbed-os commit: 9c1fd48).
Because upper layer (mbed-os/hal/mbed_ticker_api.c) has handled past event, this code can be removed from lp_ticker.

The similar fix also applies to us_ticker.
@theotherjimmy
Copy link
Contributor

@Patater @alzix Could you take another look?

@alzix
Copy link
Contributor

alzix commented Nov 14, 2017

LGTM

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 14, 2017

@ccli8 There's travis again not reporting. Are you logged into travis? I was told that would help to eliminate abuse detected statuses. I can not locate this PR in travis. I'll close and open

Please update the pull request thread with the latest status (in this case this was reworked to remove uvisor changes) and only tickers fix is present.

@ccli8
Copy link
Contributor Author

ccli8 commented Nov 14, 2017

@0xc0170 I don't log in travis. I will update status after you re-open this PR.

@0xc0170 0xc0170 reopened this Nov 14, 2017
@ccli8
Copy link
Contributor Author

ccli8 commented Nov 14, 2017

Current status for this PR:

  • Fix premature lp_ticker interrupt

Enable uVisor core debug message output via semihosting (removed)

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 14, 2017

Abuse detected in the logs.

@ccli8 I was asking about travis logging, because I received a response from travis help team yesterday:

For the time being, a work around would be to have someone in the XXX organization create an account with Travis. They can do so right here: https://www.travis-ci.org This should prevent these pull requests from being flagged. If you still encounter issues after that, please don't hesitate to reach out and we'll investigate again.

They mention the organization however seems like this is valid also for a user :( Therefore I was asking if you can at least once log into travis, this would not flag this PR as abuse. This is the second time I am seeing this abuse detected status in travis this month.

As my reopening did not help, the only way I know is to open a new PR or try to logging to travis CI and we can reopen this again.

@ccli8
Copy link
Contributor Author

ccli8 commented Nov 14, 2017

@0xc0170 I've logged in travis CI. Please re-try the travis test.

@0xc0170 0xc0170 closed this Nov 14, 2017
@ccli8
Copy link
Contributor Author

ccli8 commented Nov 20, 2017

@0xc0170 Could the abuse issue be fixed? Or I need to raise another PR?

@0xc0170 0xc0170 reopened this Nov 20, 2017
@0xc0170
Copy link
Contributor

0xc0170 commented Nov 20, 2017

I contacted your colleague @cyliangtw the previous week to resolve this. I resent the email just now including you also there to agree on the next steps with this PR.

Lets send new pull request.

@ccli8
Copy link
Contributor Author

ccli8 commented Nov 22, 2017

@0xc0170 I resend the PR in #5552.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants