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

Easy firmware flashing #311

Closed
Disasm opened this issue Feb 15, 2019 · 8 comments
Closed

Easy firmware flashing #311

Disasm opened this issue Feb 15, 2019 · 8 comments
Labels

Comments

@Disasm
Copy link
Member

Disasm commented Feb 15, 2019

We need some tool to make firmware upload process as easy as running "cargo flash".
Possible functions:

  • Automatic detection of programmer hardware
  • Building additional crates for interfacing programmer hardware
  • Download additional toolchains/openocd
  • Configuration (with Cargo.toml or separate file)
  • Complicated upload process declaration in flash.rs?
  • Building the user's project before flashing it

Original comments:
#256 (comment)
rust-embedded/book#12 (comment)

@Yatekii
Copy link

Yatekii commented Mar 12, 2019

@therealprof and I have started working on this some time ago: https://github.com/Yatekii/probe-rs
Atm it's very ARM specific and not all that well finished & polished, but we are making progress.
The idea would be to have a foundation lib to make it easy to write tools like cargo flash.

@Disasm
Copy link
Member Author

Disasm commented Mar 13, 2019

@Yatekii sure, it will be helpful. However, it seems like we still need a gdb layer for debugging. Do you have any ideas about using gdb with probe-rs?

@therealprof
Copy link
Contributor

therealprof commented Mar 13, 2019

@Disasm If someone wants to write a gdbserver protocol adapter, that'd be one option. Better ideas (IMHO, of course) would be:

  • Provide a simple command line tool (something I'm working on)
  • Have a GDB/MI protocol adapter
  • Have a VSCode plugin
  • Nothing of the above and instead have develop a kickass native Rust debugging application with direct compiler support

@ryankurte
Copy link
Contributor

Hey totally agreed it'd be excellent to make this easy! A couple of thoughts:

  • VSCode + Cortex Debug is interesting on the ARM side. Loads SVDs and shows memory nicely, talks to a few different types of debuggers, it might be worth considering how that could be extended for other targets?
  • It's probably worth looking at bobbin-cli which can do some of this already

@Yatekii
Copy link

Yatekii commented Mar 20, 2019

Definitely cool projects you have here!

The problem at least for myself is, that I'd like to eliminate unnecessary layers like GDB, which all of those tools don't. They basically encapsulate the bazzillion tools there is. Each and every of them has it's own quirks and implementations of the GDB protocol. Flashing might or might not work, etc.

I will definitely have a look at those projects, especially the Cortex Debug one, but on the long run, I would love to have a standalone tool without the layer cake.

@ejpcmac
Copy link

ejpcmac commented Mar 20, 2019

@ryankurte Can you flash with Cortex Debug? I am currently using a pre-launch task to do this in C/C++, it would be neat to avoid this.

@ryankurte
Copy link
Contributor

@Yatekii interesting! i can see the benefit of not having the layers and quirks (though personally might be a little attached to GDB).

@ejpcmac i've been doing the same. there is however an option to pre-run gdb commands on connect in the launch configuration, in which case something like ["halt", "load"] might do it.

@eldruin
Copy link
Member

eldruin commented Oct 6, 2020

probe-rs has made tremendous progress and provides cargo flash and cargo embed which work very well. Further ideas can be sent there.

@eldruin eldruin closed this as completed Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants