Skip to content

[STM32F401xE] Freeze master timer on stop/breakpoint #4881

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

Merged
merged 1 commit into from
Sep 6, 2017

Conversation

betzw
Copy link
Contributor

@betzw betzw commented Aug 9, 2017

Description

Freeze master timer when debugging enabled and execution hits a breakpoint or gets stop by user.

Status

READY

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 10, 2017

There are CI failures, please look at them.

Is this intended to stop counters (something that API should specify) ? What are the +/- ?
I have seen this feature in some timers, but not certain all would support it.

cc @c1728p9 @bulislaw

@betzw
Copy link
Contributor Author

betzw commented Aug 10, 2017

There are CI failures, please look at them.

As most often, my PRs are just proposals to be extended to all ST platforms. In this case only platform TARGET_STM32F401xE is currently supported.
It will be up to a product division (i.e. @bcostm & @LMESTM) together with ARMmbed to decide if and how to proceed.

Is this intended to stop counters (something that API should specify) ? What are the +/- ?
I have seen this feature in some timers, but not certain all would support it.

Well, I won't see it as something an API should specify, it's simply something which makes debugging easier as timers will stop when a debugger stops the exeuction of an application. Typically, having timers continue to run while execution is stopped is an intrusion which often makes it impossible to continue execution afterwards without impacting also the overall behabior (e.g. by running immediately into a timeout).
It's likely that not all platforms support something like this, but the ones which support it would help their programmers when they try to debug their application.

@c1728p9
Copy link
Contributor

c1728p9 commented Aug 10, 2017

Hi @betzw, you might want to leave the RTC counting even when the target is halted. I would expect this to keep time regardless of debugging.

@betzw
Copy link
Contributor Author

betzw commented Aug 11, 2017

This might be reasonable, I have actually never faced a situation where the RTC created problems/timeouts during debugging, even if I believe you cannot exclude it. It's kind of "there is no right or wrong" ...

@bcostm
Copy link
Contributor

bcostm commented Aug 11, 2017

It's ok with me.

I have some remarks:

  • Add STM32F401xE in the title
  • Add #ifdef TIM_MST_DBGMCU_FREEZE because the hal_tick_xxx.c files are common to all ST devices
  • Add the possibility to enable/disable this feature using mbed_app.json file ?

@betzw
Copy link
Contributor Author

betzw commented Aug 11, 2017

@bcostm
Well, as said before this PR must be extended (in a new PR) to all STM32 platforms by your group, so you can add your modifications there.

@theotherjimmy
Copy link
Contributor

@bcostm Do you have plans to extend this PR?

@bcostm
Copy link
Contributor

bcostm commented Aug 22, 2017

I didn't know you were waiting for me... Well, I'd prefer to wait that this PR is accepted and merged first on this target (F401RE). Then sure we'll extend it on all other targets.

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 22, 2017

I didn't know you were waiting for me... Well, I'd prefer to wait that this PR is accepted and merged first on this target (F401RE). Then sure we'll extend it on all other targets.

It needs some work - RTC not freeze, test it (all CI green)

@betzw betzw changed the title Freeze master timer & rtc on stop/breakpoint [STM32F401xE] Freeze master timer & rtc on stop/breakpoint Aug 28, 2017
@betzw
Copy link
Contributor Author

betzw commented Aug 30, 2017

@0xc0170 now all 3 CI test are passing.
Are you ok with merging this PR now?

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 30, 2017

LGTM

@c1728p9 @bulislaw Please review

Copy link
Contributor

@c1728p9 c1728p9 left a comment

Choose a reason for hiding this comment

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

I'm use to having the RTC keep accurate time even when debugging. Its understandable to want to halt it when debugging if it is used for scheduling. As long as everyone is happy with this tradeoff, I'm all for it.

@bcostm
Copy link
Contributor

bcostm commented Aug 31, 2017

@betzw I see that RTC freeze has been removed in your commit. Can you please update the PR title and description and remove the RTC also ? Thanks.

@betzw betzw changed the title [STM32F401xE] Freeze master timer & rtc on stop/breakpoint [STM32F401xE] Freeze master timer on stop/breakpoint Aug 31, 2017
@betzw
Copy link
Contributor Author

betzw commented Aug 31, 2017

@betzw I see that RTC freeze has been removed in your commit. Can you please update the PR title and description and remove the RTC also ? Thanks.

Done.

@studavekar
Copy link
Contributor

/morph test

@mbed-bot
Copy link

mbed-bot commented Sep 5, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1218

All builds and test passed!

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.

8 participants