Skip to content

Conversation

modulitos
Copy link

No description provided.

@modulitos modulitos requested a review from a team as a code owner August 31, 2019 01:35
@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ryankurte (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-resources labels Aug 31, 2019
@@ -104,7 +104,7 @@ Breakpoint 1, main () at src/06-hello-world/src/main.rs:10
10 let mut itm = aux6::init();
```

Note that there's a `.gdbinit` at the root of the Cargo project. It's pretty similar to the one we
Note that there's a `openocd.gdb` at the root of the Cargo project. It's pretty similar to the one we
Copy link
Author

Choose a reason for hiding this comment

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

It looks like openocd.gdb used to be named .gdbinit, and this doc wasn't updated when the file name changed.

@@ -22,4 +22,6 @@ Recommended steps to wire this up:
And that's it! You should be able to run all the programs you wrote in [section 11] without
modification! Just make sure you open the right serial device / COM port.

**NOTE** If you are having trouble communicating with the bluetooth device, you may need to initialize USART1 with a lower baud rate. Lowering it from 115,200 bps to 9,600 bps might help, as described [here](https://github.com/rust-embedded/discovery/blob/master/src/11-usart/auxiliary/src/lib.rs#L31)

Copy link
Author

@modulitos modulitos Aug 31, 2019

Choose a reason for hiding this comment

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

I was stuck on this step, and after some debugging, I discovered that the program was getting stuck on this line:

while usart1.isr.read().rxne().bit_is_clear() {}

(which can be seen in the solution file here: https://github.com/rust-embedded/discovery/blob/master/src/11-usart/my-solution.md)

After some exploration - and some help from a friend! - I discovered that it was due to the baud mismatch between the chip and the bluetooth module. Setting the baud rate to 9600.bps(), as mentioned above, fixed the issue.

**NOTE**: If you are getting errors like `undefined debug reason 7 - target needs reset` on the OpenOCD GDB server, then you may need to try using `arm-none-eabi-gdb` instead of the `gdb` command, as described above.
**NOTE**: If you are getting errors like `undefined debug reason 7 - target needs reset`, you can try running `monitor reset halt` as described [here](https://stackoverflow.com/questions/38994596/reason-7-target-needs-reset-unreliable-debugging-setup).

**NOTE**: If the debugger is still not connecting to the OpenOCD server, then you may need to try using `arm-none-eabi-gdb` instead of the `gdb` command, as described above.
Copy link
Author

@modulitos modulitos Aug 31, 2019

Choose a reason for hiding this comment

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

This is in response to this comment: ffeabc6#r34883585

My original note incorrectly conflated the undefined debug reason 7 output with my issue where I was using gdb instead of arm-none-eabi-gdb. This update clarifies the issues that may arise, and addresses them separately.

Copy link
Contributor

@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.

Looks good to me.

@therealprof
Copy link
Contributor

bors r+

bors bot added a commit that referenced this pull request Aug 31, 2019
189: Update docs r=therealprof a=modulitos



Co-authored-by: modulitos <you@example.com>
@bors
Copy link
Contributor

bors bot commented Aug 31, 2019

Build succeeded

@bors bors bot merged commit 08877f7 into rust-embedded:master Aug 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-resources
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants