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

Improve quick start docs #172

Merged
merged 8 commits into from
Jan 19, 2020
Merged

Conversation

TheZoq2
Copy link
Member

@TheZoq2 TheZoq2 commented Jan 18, 2020

I recently helped a friend start using this and noticed some documentation problems which this hopefully fixes:

  • Programs to install wasn't documented
  • Having to specify target when compiling
  • linker, gdb and cargo config wasn't documented
  • inline example was out of date (replaced with a link to the example)

I also decided to remove some redundant text from lib.rs and link to README instead, just to avoid having some parts of the docs drift out of date.

Oh, and I fixed the docs.rs build, so this closes #154

The docs are very linux centric at the moment, but I have no idea what the process is like on windows.

cc @FredTheDino who ran into all these issues :)

README.md Outdated

![blue pill pinout](BluePillPinout.jpg "opt title")

You will also need an [stlink](https://www.adafruit.com/product/2548) for
Copy link
Member

@therealprof therealprof Jan 18, 2020

Choose a reason for hiding this comment

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

This looks like a rebranded Chinesium ST-Link clone with pirated firmware (not sure how they can offer that on in the adafruit line). Can we recommend a genuine product instead (like the ST-Link V3 Mini) which is even cheaper, though quite a bit trickier to obtain, insteads?

Copy link
Member

Choose a reason for hiding this comment

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

Alternatively we could recommend an open product or maybe hint to an official Nucleo board which happens to include an ST-Link so works out-of-the-box.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we should use something compatible with blue pills since they seem pretty common in the rust community.

Recommending a better alternative to the weird stlink sounds like a good idea, got a link to one?

Copy link
Member

Choose a reason for hiding this comment

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

Any debug probe should be compatible with the blue pill. The question is only whether we want to stay with a native ST solution or recommend something else. The ST-Link v3 mini can be found here: https://www.st.com/en/development-tools/stlink-v3mini.html

```bash
cargo build --target thumbv7m-none-eabi
```

Copy link
Member

Choose a reason for hiding this comment

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

Maybe also include a few words about putting that into a .cargo/config here? Can also do this as a follow up.

README.md Outdated
Comment on lines 85 to 86
- [.cargo/config](.cargo/config)
- [memory.x](memory.x)
Copy link
Member

Choose a reason for hiding this comment

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

Uhm, that really should go in the section above as it is required (or at least useful in case of the .cargo/config) to build the software.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea, that might be a good idea.

However, my point in ordering it like this is that the project successfully compiles after the cargo build line. If people get there and build fails, they have less things to check when debugging.

Copy link
Member

Choose a reason for hiding this comment

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

If you don't have a memory.x there's a good chance it will not compile or throw linker errors (depending on circumstances) so that should go before any attempts to compile it. .cargo/config is a wash but would simplify the change for error in the naked cargo build above.

@TheZoq2
Copy link
Member Author

TheZoq2 commented Jan 18, 2020

I upgraded the text according to your comments

README.md Outdated
![blue pill pinout](BluePillPinout.jpg "opt title")

You will also need a debug probe, for example an [stlink v3
mini](https://www.adafruit.com/product/2548) for programming and debugging.
Copy link
Member

Choose a reason for hiding this comment

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

Wrong link

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, fixed

README.md Outdated Show resolved Hide resolved
Co-Authored-By: Daniel Egger <daniel@eggers-club.de>
README.md Outdated

### Setting up your project

Create a new rust project as you usually do with `cargo init`. The hello world
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Create a new rust project as you usually do with `cargo init`. The hello world
Create a new Rust project as you usually do with `cargo init`. The hello world

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated

If all went well, it should detect your microcontroller and say `Info :
stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints`. Keep it running in
the background
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
the background
the background.

TheZoq2 and others added 3 commits January 18, 2020 23:35
Co-Authored-By: Daniel Egger <daniel@eggers-club.de>
Co-Authored-By: Daniel Egger <daniel@eggers-club.de>
@TheZoq2
Copy link
Member Author

TheZoq2 commented Jan 19, 2020

I fixed the remaining issues and reworded the gdb section which sounded a bit strange after the updates. Mind giving it another look? @therealprof


[dependencies.stm32f1xx-hal]
version = "0.5.2"
features = ["rt", "stm32f103"]
Copy link
Member

Choose a reason for hiding this comment

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

features = ["rt", "stm32f103", "medium"]

Copy link
Member

@therealprof therealprof left a comment

Choose a reason for hiding this comment

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

LGTM

@therealprof therealprof merged commit 18033c0 into stm32-rs:master Jan 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs.rs builds failed
3 participants