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

hosted: fix ephemeral max frequency #1738

Merged
merged 2 commits into from
Jan 27, 2024

Conversation

perigoso
Copy link
Contributor

@perigoso perigoso commented Jan 17, 2024

Detailed description

On BMDA, the scan routines set the interface frequencies according to command line options, always, meaning any changes by the user through monitor commands are overriden. This fixes that, this is a rather simplistic fix, that just resolves the issue, there is space for improvement on this code generally, but that would be more involved and can be done later.

This adds storage to the max frequency, meaning the frequency set by the user will be remembered over the initial command line value.

Before:

setting SWD frequency with mon freq 400000
immediately followed by a scan mon swd

Speed set to 0.400MHz for SWD
Speed set to 1.600MHz for SWD
-> jlink_swd_init(0)
Switching out of dormant state into SWD
jlink_swd_seq_out 32 clock_cycles: ffffffff

...

After:
setting SWD frequency with mon freq 400000
immediately followed by a scan mon swd

Speed set to 0.400MHz for SWD
Speed set to 0.400MHz for SWD
-> jlink_swd_init(0)
Switching out of dormant state into SWD
jlink_swd_seq_out 32 clock_cycles: ffffffff

...

Your checklist for this pull request

Closing issues

fixes #1691

@dragonmux dragonmux added this to the v2.0 release milestone Jan 17, 2024
@dragonmux dragonmux added Bug Confirmed bug BMD App Black Magic Debug App (aka. PC hosted) (not firmware) labels Jan 17, 2024
Copy link
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

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

There are a couple of wording items we'd like to discuss that may need some change, but otherwise this looks great.

src/command.c Outdated Show resolved Hide resolved
src/platforms/hosted/platform.c Outdated Show resolved Hide resolved
On hosted, the max frequency was being set on every scan routine to the value set by the command line options, even if the user set a new value with the monitor command

This adds storage to the max frequency, meaning the frequency set by the user will be remembered over the initial command line value
@perigoso perigoso force-pushed the fix/ephemeral-frequency branch from 81f3ed2 to 60f2511 Compare January 17, 2024 13:55
Copy link
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

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

LGTM, we'll test this tomorrow and get it merged once we have.

@dragonmux dragonmux merged commit bc19545 into blackmagic-debug:main Jan 27, 2024
17 checks passed
@dragonmux dragonmux deleted the fix/ephemeral-frequency branch January 27, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BMD App Black Magic Debug App (aka. PC hosted) (not firmware) Bug Confirmed bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BMDA probe frequency is ephemeral
2 participants