Skip to content
Snippets Groups Projects
Commit fa6c1232 authored by Per Lindgren's avatar Per Lindgren
Browse files

bare7 even more polish

parent 7362555c
No related branches found
No related tags found
No related merge requests found
//! bare7.rs
//!
//!
//! Serial echo
//!
//! What it covers:
......@@ -40,6 +40,7 @@ fn main() -> ! {
let tx = gpioa.pa2.into_alternate_af7();
let rx = gpioa.pa3.into_alternate_af7(); // try comment out
// let rx = gpioa.pa3.into_alternate_af6(); // try uncomment
let serial = Serial::usart2(
......@@ -58,7 +59,7 @@ fn main() -> ! {
match block!(rx.read()) {
Ok(byte) => {
iprintln!(stim, "Ok {:?}", byte);
tx.write(byte).unwrap();
tx.write(byte).unwrap();
}
Err(err) => {
iprintln!(stim, "Error {:?}", err);
......@@ -94,20 +95,20 @@ fn main() -> ! {
// > cargo build --example bare7 --features "stm32fxx-hal"
// (or use the vscode build task)
//
//
//
// Cargo.toml:
//
//
// [dependencies.stm32f4]
// version = "0.5.0"
// features = ["stm32f413", "rt"]
// optional = true
//
//
// [dependencies.stm32f4xx-hal]
// version = "0.6.0"
// features = ["stm32f401", "rt"]
// optional = true
//
// Notice, stm32f4xx-hal internally enables the dependency to stm32f4,
// Notice, stm32f4xx-hal internally enables the dependency to stm32f4,
// so we don't need to explicitly enable it.
//
// The HAL provides a generic abstraction over the whole stm32f4 family.
......@@ -178,14 +179,14 @@ fn main() -> ! {
// Data Bits 8
// Stop Bits 1
// Parity None
//
//
// This setting is typically abbreviated as 115200 8N1.
//
// Run the example, make sure your ITM is set to 84MHz.
//
// Send a single character (byte), (set the option No end in moserial).
// Verify that sent bytes are echoed back, and that ITM tracing is working.
//
//
// If not go back check your ITM setting, clocks etc.
//
// Try sending: "abcd" as a single sequence, don't send the quotation marks, just abcd.
......@@ -204,7 +205,7 @@ fn main() -> ! {
// What did you receive, and what was the output of the ITM trace.
//
// ** your answer here **
//
//
// Explain why the buffer overflows.
//
// ** your answer here **
......@@ -220,8 +221,8 @@ fn main() -> ! {
// The `stm32f4xx-hal` gives you an abstraction for programming,
// setting up clocks, assigning pins, etc.
//
// The hal overs basic functionality like serial communication.
// Still, in order to fully understand what is going on under the hood you need to
// The hal overs basic functionality like serial communication.
// Still, in order to fully understand what is going on under the hood you need to
// check the documentation (data sheets, user manuals etc.)
//
// Your crate can be documented by:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment