-
Notifications
You must be signed in to change notification settings - Fork 23
Migration to cargo-embed #16
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
bors merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are a few comments. Of course they apply to all the examples, not just to the one I commented on 🙂
# for the comprehensive list of options | ||
|
||
[default.general] | ||
chip = "STM32F103" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this even work? I thought the chip needs to be more specific than that. (That's the problem with cargo-embed config files, we cannot omit the chip 🙂 I think I'll open a feature request for that.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I just found out that apparently cargo-embed now supports specifying the chip on the command line! Very nice.
Therefore I'd suggest leaving away the chip
configuration in the .embed.toml
file and instead telling the user to run the command as cargo embed --release --chip <chip-spec>
. That way no config files need to be adjusted!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I missed these comments. Could you transfer this to a new PR?
|
||
We will use openocd to upload the code wit simple one-line one-command script: | ||
Flashing with a standard STLink v2 is easy with `cargo-embed`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why even mention the STLink? Any probe that is supported by probe-rs can be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I missed these comments. Could you transfer this to a new PR?
```txt | ||
source [find interface/stlink.cfg] | ||
``` | ||
Please review the `.embed.toml` file to change your target IC among other options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line should be moved up, so that people read it before running the cargo embed --release
command (which will fail if the wrong chip is selected).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I missed these comments. Could you transfer this to a new PR?
bors ping |
pong |
bors try |
tryBuild succeeded: |
bors merge |
@korken89 regarding the comments above, should they be in a separate PR, or do you disagree with them? |
Ah, just saw your reply now! Yes, they can be in a separate PR. |
Sorry, I missed the comments. Could you transfer them to a new PR? |
Build succeeded: |
@dbrgn Yeah, I didn't expect @korken89 to merge that fast (thanks! ;P)... my fault, I should have opened as Draft PR until I had certainty that the original authors tested it on their respective boards (I don't own all those :-S). Granted, I could have tried with other targets, but then I might have fallen into a HAL differences rabbit hole, best to let the authors test if their boards still work and adjust things like RTT |
@brainstorm the only note for the heartbeat-stm32l4 example is that rtt-target is actually not used (yet) and therefore a big warning is shown after flashing. Most probably at next update I'll use some |
Related twitter thread: https://twitter.com/korken89/status/1327567447654850560
Original authors, please, would you mind reviewing if this still works fine on your respective boards?
Please add the appropriate RTT statements and imports for better debugging experience (i.e, see: https://github.com/rtic-rs/rtic-examples/blob/master/rtic_v5/hid_mouse_stm32f0/src/main.rs#L154).
/cc @dbrgn @korken89 @cavokz @AfoHT
Fixes #9