Merge #1085

1085: build(deps): bump simplelog from 0.11.2 to 0.12.0 in /target-gen r=Tiwalun a=dependabot[bot]

Bumps [simplelog](https://github.com/drakulix/simplelog.rs) from 0.11.2 to 0.12.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/Drakulix/simplelog.rs/blob/master/CHANGELOG.md">simplelog's changelog</a>.</em></p>
<blockquote>
<h2>v0.12.0</h2>
<pre><code>- Replaces the semingly unmainted chrono library with the time crate.
- Addresses through this update 
    - RUSTSEC-2020-0159 (chrono)
    - RUSTSEC-2020-0071 (time)
- `ConfigBuilder::set_time_to_local` is replaced by `ConfigBuilder::set_time_offset_to_local`.
    - This function requires the new (and by default activated) `local-offset` feature.
    - This function may fail, for more information read the docs.
    - simplelog will not determine the local offset dynamically anymore, but only once, when this config option is set.
        - Due to safety reasons there is no way to provide this property currently.
- `ConfigBuilder::set_time_offset` now takes a `time::UtcOffset` instead of a `chrono::FixedOffset`.
- `ConfigBuilder::set_time_format` has been replaced by three new variants
    - `ConfigBuilder::set_time_format_rfc2822` sets the time format to use the format described by rfc2822.
    - `ConfigBuilder::set_time_format_rfc3339` sets the time format to use the format described by rfc3339.
    - `ConfigBuilder::set_time_format_custom` sets the time format to a custom time format best created using `time::macros::format_description`.
        - Runtime provided time format configuration is possible, but difficult due to lifetime constraints.
        - Fixing this will require a solution to https://github.com/time-rs/time/issues/429
    - *Note*: The default format is unchanged &quot;[hour]:[minute]:[second]&quot;
</code></pre>
<h2>v0.11.0</h2>
<pre><code>- Add colored log levels using `ansi_term` (PR [#88](https://github.com/drakulix/simplelog.rs/issues/88), credits to `@manio)`
- Add target padding (PR [#85](https://github.com/drakulix/simplelog.rs/issues/85), credits to `@bytebeamio)`
- Add optional color and style support using `paris` crate (PR [#84](https://github.com/drakulix/simplelog.rs/issues/84), credits to `@manio)`
</code></pre>
<h2>v0.10.2</h2>
<pre><code>- Fix flushing with `BufferedStandardStreams` (PR [#82](https://github.com/drakulix/simplelog.rs/issues/82), credits to `@mrkline)`
</code></pre>
<h2>v0.10.1</h2>
<pre><code>- Fix TermLogger performance using `termcolor::BufferedStandardStream` (PR [#80](https://github.com/drakulix/simplelog.rs/issues/80), credits to `@mrkline)`
- Add write thread name support for `termlog` (PR [#76](https://github.com/drakulix/simplelog.rs/issues/76), credits to `@zeroflaw)`
</code></pre>
<h2>v0.10.0</h2>
<pre><code>- Fix wrong argument naming (PR [#70](https://github.com/drakulix/simplelog.rs/issues/70), credits to `@scvalex)`
- *Breaking*: More color customization options (PR [#72](https://github.com/drakulix/simplelog.rs/issues/72), credits to `@mrkline)`
- Clarify docs on config levels
</code></pre>
<h2>v0.9.0</h2>
<pre><code>- Add customizable level label colors (PR [#69](https://github.com/drakulix/simplelog.rs/issues/69). credits to `@JarrettBillingsley)`
- Remove unneeded TermLogError
- Future-proof config by adding `#[non_exhaustive]`
- Fix compiling with minimal-versions
</code></pre>
<h2>v0.8.0</h2>
<pre><code>- Switch from `term` to `termcolor` (PR [#59](https://github.com/drakulix/simplelog.rs/issues/59). credits to `@raybritton)`
- Fix typo in docs (PR [#58](https://github.com/drakulix/simplelog.rs/issues/58), credits to `@anthonyjmartinez)`
- Switch default padding to `Off`. Padding is annoyingly controversal, just set it to whatever you prefer, if you want it.
</code></pre>
<h2>v0.7.6</h2>
<pre><code>- Derive `Clone`,`Copy`,`PartialEq`,`Eq`,`Debug` and `Hash` for `TerminalMode`. (PR [#56](https://github.com/drakulix/simplelog.rs/issues/56), credits to `@panhania)`
</code></pre>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/95275c88b14f204a5e8278cd98072e4ffb0bc7d8"><code>95275c8</code></a> v0.12.0</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/f137eb4a2934faaec2d45652d14065f8560e5c49"><code>f137eb4</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/101">#101</a> from jacobtread/patch-1</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/ba172540f9e8eb0b31c65e43e234fe3cdc979ee6"><code>ba17254</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/99">#99</a> from zjp-CN/master</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/44a294fcff08818f5a8a889901508e62adb1bd29"><code>44a294f</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/95">#95</a> from Drakulix/fix/chrono_dep</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/d9257919d9e4afdf9d7385c4eb07f6031b6a17d9"><code>d925791</code></a> Out of place space?</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/81c6293f9228c78517e19e7801406dd0e5a22e0b"><code>81c6293</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/100">#100</a> from rusty-snake/patch-1</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/d49c3fd102ba16aa49012ff271e8fcb3d83db6fd"><code>d49c3fd</code></a> config.rs: docs: Add intra-doc links</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/568309c339f936ddf1defad1729a71feddb75a3a"><code>568309c</code></a> add demo for paris feature</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/40808ea9f585b0199368884d56eebfe30a7fcb79"><code>40808ea</code></a> fix the problem of macro hygiene when paris is enabled</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/cf8fc32c318c510afc40fec2d9bdcc8ec4590eed"><code>cf8fc32</code></a> fix TestLogger</li>
<li>Additional commits viewable in <a href="https://github.com/drakulix/simplelog.rs/compare/v0.11.2...v0.12.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=simplelog&package-manager=cargo&previous-version=0.11.2&new-version=0.12.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
tree: 273ebc3a33c0262dd7f4182a6930a54f8505c77c
  1. .cargo/
  2. .github/
  3. .vscode/
  4. cli/
  5. debugger/
  6. doc/
  7. gdb-server/
  8. probe-rs/
  9. probe-rs-cli-util/
  10. probe-rs-target/
  11. rtt/
  12. rtthost/
  13. smoke-tester/
  14. target-gen/
  15. xtask/
  16. .gitattributes
  17. .gitignore
  18. Cargo.toml
  19. CHANGELOG.md
  20. CONTRIBUTING.md
  21. LICENSE-APACHE
  22. LICENSE-MIT
  23. README.md
  24. RESOURCES.md
README.md

probe-rs

a modern, embedded debugging toolkit, written in Rust

crates.io documentation Actions Status chat

The goal of this library is to provide a toolset to interact with a variety of embedded MCUs and debug probes.

Similar projects like OpenOCD, PyOCD, Segger Toolset, ST Tooling, etc. exist. They all implement the GDB protocol and their own protocol on top of it to enable GDB to communicate with the debug probe. Only Segger provides a closed source DLL which you can use for talking to the JLink.

This project gets rid of the GDB layer and provides a direct interface to the debug probe, which then enables other software to use its debug functionality.

The end goal of this project is to have a complete library toolset to enable other tools to communicate with embedded targets.

Functionality

As of version 0.10.0 this library can

  • connect to a DAPLink, STLink or JLink
  • talk to ARM and Risc-V cores via SWD or JTAG
  • read and write arbitrary memory of the target
  • halt, run, step, breakpoint and much more the core
  • download ELF, BIN and IHEX binaries using standard CMSIS-Pack flash algorithms to ARM cores
  • provide debug information about the target state (stacktrace, stackframe, etc.)

To see what new functionality was added have a look at the CHANGELOG

Support

If you think probe-rs makes your embedded journey more enjoyable or even earns you money, please consider supporting the project on Github Sponsors for better support and more features.

Downloading a file

The cargo-flash utility can be used as a cargo subcommand to download a compiled Rust program onto a target device. It can also be used to download arbitrary ELF files that might come out of a C/C++ compiler. Have a look at cargo-flash for more information.

Better debugging with probe-rs

If you are looking for a more extended debugging experience, please head over to cargo-embed which provides support for GDB, RTT, and config files.

VSCode

We are implementing Microsoft DAP. This makes embedded debugging via probe-rs available in modern code editors implementing the standard, such as VSCode. To support this, probe-rs includes a debugger which supports both basic command line debugging, and more extensive capabilities when run as a DAP server. Please see probe-rs-debugger and vscode for more information.

Usage Examples

Halting the attached chip

use probe_rs::Probe;

fn main() -> Result<(), probe_rs::Error> {
    // Get a list of all available debug probes.
    let probes = Probe::list_all();

    // Use the first probe found.
    let probe = probes[0].open()?;

    // Attach to a chip.
    let mut session = probe.attach("nrf52")?;

    // Select a core.
    let mut core = session.core(0)?;

    // Halt the attached core.
    core.halt(std::time::Duration::from_millis(300))?;

    Ok(())
}

Reading from RAM

use probe_rs::{MemoryInterface, Session};

fn main() -> Result<(), probe_rs::Error> {
    // Attach to a chip.
    let mut session = Session::auto_attach("nrf52")?;

    // Select a core.
    let mut core = session.core(0)?;

    // Read a block of 50 32 bit words.
    let mut buff = [0u32; 50];
    core.read_32(0x2000_0000, &mut buff)?;

    // Read a single 32 bit word.
    let word = core.read_word_32(0x2000_0000)?;

    // Writing is just as simple.
    let buff = [0u32; 50];
    core.write_32(0x2000_0000, &buff)?;

    // of course we can also write 8bit words.
    let buff = [0u8; 50];
    core.write_8(0x2000_0000, &buff)?;

    Ok(())
}

FAQ

I need help!

Don't hesitate to file an issue, ask questions on Matrix, or contact @Yatekii via e-mail.

How can I help?

Please have a look at the issues or open one if you feel that something is needed.

Any contributions are very welcome!

Also have a look at CONTRIBUTING.md.

Our company needs feature X and would pay for its development

Please reach out to @Yatekii

Building

Building requires Rust and Cargo which can be installed using rustup. probe-rs also depends on libusb and libftdi. On linux these can be installed with your package manager:

# Ubuntu
> sudo apt install -y libusb-1.0-0-dev libftdi1-dev libudev-dev

# Fedora
> sudo dnf install -y libusbx-devel libftdi-devel libudev-devel

On Windows you can use vcpkg:

# dynamic linking 64-bit
> vcpkg install libftdi1:x64-windows libusb:x64-windows
> set VCPKGRS_DYNAMIC=1

# static linking 64-bit
> vcpkg install libftdi1:x64-windows-static-md libusb:x64-windows-static-md

See the vcpkg crate documentation for more information about configuring vcpkg with rust.

Adding Targets

Target files are generated using target-gen from CMSIS packs provided here. Generated files are then placed in probe-rs/targets for inclusion in the probe-rs project.

Sponsors

Technokrat

Acknowledgements

In early stages of this library, we profited invaluably from the pyOCD code to understand how flashing works. Also it's always a good reference to cross check how ARM specific things work. So, a big thank you to the team behind pyOCD!

License

Licensed under either of

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.