knurling-rs / probe-run

Run embedded programs just like native ones
Apache License 2.0
645 stars 75 forks source link

Flashing is very slow (15-20s for an 8KB binary) #268

Closed leo60228 closed 2 years ago

leo60228 commented 2 years ago

Describe the bug Flashing is very slow, taking ~15-20s for an 8KB binary.

To Reproduce Flash a binary.

Expected and observed behavior I expected it to be faster.

config.toml

# samd21 is a Cortex-M0 and thus thumbv6m

[build]
target = "thumbv6m-none-eabi"

[target.thumbv6m-none-eabi]
runner = 'probe-run --chip ATSAMD21E18A'

rustflags = [

  # This is needed if your flash or ram addresses are not aligned to 0x10000 in memory.x
  # See https://github.com/rust-embedded/cortex-m-quickstart/pull/95
  "-C", "link-arg=--nmagic",

  "-C", "link-arg=-Tlink.x",
]

Probe details

[nix-shell:~/atsamd/boards/pyruler]$ probe-rs-cli list
The following devices were found:
[0]: J-Link (J-Link) (VID: 1366, PID: 0101, Serial: 000801029937, JLink)

Operating System: Linux

ELF file (attachment) ptc_regs.zip

Additional context I'm flashing an ATSAMD21E18A using a J-Link EDU Mini.

leo60228 commented 2 years ago

I'm aware that this isn't a very detailed issue, but I'm not sure what information would be helpful for troubleshooting.

Urhengulas commented 2 years ago

Hi @leo60228, Can you please test if it also is slow when using https://github.com/probe-rs/cargo-embed? If it is, it might be a probe-rs issue.

leo60228 commented 2 years ago

It is.

On Mon, Oct 11, 2021, 8:23 AM Johann Hemmann @.***> wrote:

Hi @leo60228 https://github.com/leo60228, Can you please test if it also is slow when using https://github.com/probe-rs/cargo-embed? If it is, it might be a probe-rs issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/knurling-rs/probe-run/issues/268#issuecomment-939981030, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7X32KYHTJKTHY724C3ZILUGLJKNANCNFSM5FOYV5OQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Urhengulas commented 2 years ago

Then it is very likely that it is an probe-rs issue.

Please open a bug report there! (And please link the issue here. I'd be interested in the cause of the problem ;D)