Skip to content
Snippets Groups Projects
Commit 9ae311c4 authored by Per's avatar Per
Browse files

debugging sort of works

parent 506c946e
No related branches found
No related tags found
No related merge requests found
[target.thumbv7m-none-eabi]
[target.thumbv7em-none-eabihf]
runner = 'arm-none-eabi-gdb'
rustflags = [
"-C", "link-arg=-Tlink.x",
......@@ -7,4 +7,4 @@ rustflags = [
]
[build]
target = "thumbv7m-none-eabi"
target = "thumbv7em-none-eabihf"
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
// {
// "type": "gdb",
// "request": "attach",
// "name": "Release",
// "gdbpath": "/usr/bin/arm-none-eabi-gdb",
// "executable": "./target/thumbv7em-none-eabihf/release/nucleo-64",
// "target": ":3333",
// "remote": true,
// "autorun": [
// "monitor arm semihosting enable",
// "monitor reset init",
// //"set target-async off",
// "load ./target/thumbv7em-none-eabihf/release/nucleo-64"
// //"set remotetimeout 30",
// //"monitor reset halt",
// //"step"
// ],
// "cwd": "${workspaceRoot}"
// },
{
"type": "gdb",
"request": "attach",
"name": "Debug hello",
"gdbpath": "/usr/bin/arm-none-eabi-gdb",
//"executable": ".target/thumbv7em-none-eabihf/debug/examples/hello",
"target": ":3333",
"remote": true,
//"debugger_args": [],
"autorun": [
"monitor reset halt",
"monitor arm semihosting enable",
"file ./target/thumbv7em-none-eabihf/debug/examples/hello",
"load"
],
"cwd": "${workspaceRoot}"
}
]
}
\ No newline at end of file
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"taskName": "xargo build --example hello --release",
"type": "shell",
"command": "xargo build --example hello --release",
// "group": {
// "kind": "build",
// "isDefault": true
// },
"problemMatcher": [
"$rustc"
]
},
{
"taskName": "xargo build --example hello",
"type": "shell",
"command": "xargo build --example hello",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$rustc"
]
}
]
}
\ No newline at end of file
[package]
authors = ["Jorge Aparicio <jorge@japaric.io>"]
authors = ["Per Lindgren <per.lindgren@ltu.se>"]
categories = ["asynchronous", "embedded", "hardware-support", "no-std"]
description = "Board Support Crate for the Blue Pill"
description = "Board Support Crate for the Nucleo-64 stm32f401x"
keywords = ["arm", "cortex-m", "stm32"]
license = "MIT OR Apache-2.0"
name = "blue-pill"
repository = "https://github.com/japaric/blue-pill"
name = "nucleo-64"
repository = "https://gitlab.henriktjader.com/pln/nucleo-64"
version = "0.1.0"
[dependencies]
......@@ -23,12 +23,13 @@ rev = "7d904f515d15fd5fe7ea34e18820ea83e2651fa2"
[dependencies.nb]
git = "https://github.com/japaric/nb"
[dependencies.stm32f103xx]
[dependencies.stm32f40x]
git = "https://gitlab.henriktjader.com/pln/STM32F40x"
features = ["rt"]
version = "0.7.2"
#version = "0.7.2"
[dev-dependencies]
cortex-m = "0.3.0"
cortex-m = "0.3.1"
cortex-m-rtfm = "0.2.0"
cortex-m-semihosting = "0.2.0"
......
# `blue-pill`
> Board Support Crate for [Blue Pill]
> Board Support Crate for [Nucleo-64-stm32f401re]
[Blue Pill]: http://wiki.stm32duino.com/index.php?title=Blue_Pill
[nucleo-64] board: http://www.st.com/content/ccc/resource/technical/document/user_manual/98/2e/fa/4b/e0/82/43/b7/DM00105823.pdf/files/DM00105823.pdf/jcr:content/translations/en.DM00105823.pdf
## [Documentation](https://japaric.github.io/blue-pill/blue_pill)
## [Documentation](todo)
## License
......
......@@ -4,9 +4,9 @@
#![feature(proc_macro)]
#![no_std]
extern crate blue_pill;
extern crate cortex_m_rtfm as rtfm;
extern crate cortex_m_semihosting as semihosting;
extern crate nucleo_64;
use core::fmt::Write;
......@@ -14,7 +14,7 @@ use rtfm::{app, Threshold};
use semihosting::hio::{self, HStdout};
app! {
device: blue_pill::stm32f103xx,
device: nucleo_64::stm32f401xx,
resources: {
static HSTDOUT: Option<HStdout> = None;
......
......@@ -4,9 +4,9 @@
#![feature(proc_macro)]
#![no_std]
extern crate blue_pill;
extern crate cortex_m_rtfm as rtfm;
extern crate cortex_m_semihosting as semihosting;
extern crate nucleo_64;
use core::fmt::Write;
......@@ -14,13 +14,13 @@ use rtfm::app;
use semihosting::hio;
app! {
device: blue_pill::stm32f103xx,
device: nucleo_64::stm32f40x,
}
fn init(_p: init::Peripherals) {}
fn idle() -> ! {
writeln!(hio::hstdout().unwrap(), "Hello, world!").unwrap();
writeln!(hio::hstdout().unwrap(), "Hello, Rust 3 world!").unwrap();
loop {
rtfm::wfi();
......
......@@ -7,7 +7,7 @@ use hal::prelude::*;
use static_ref::Static;
use dma::{self, CircBuffer, Dma1Channel1};
use stm32f103xx::{ADC1, DMA1, TIM2, GPIOA, RCC};
use stm32f40x::{ADC1, DMA1, TIM2, GPIOA, RCC};
use {Channel, Pwm};
/// ADC Channel 1 (PA1)
......
......@@ -11,7 +11,8 @@
//! [i]: https://docs.rs/cortex-m-quickstart/0.1.8/cortex_m_quickstart/
#![deny(missing_docs)]
#![deny(warnings)]
//#![deny(warnings)]
#![allow(warnings)]
#![feature(const_cell_new)]
#![feature(const_fn)]
#![feature(const_unsafe_cell_new)]
......@@ -25,29 +26,29 @@ extern crate embedded_hal as hal;
extern crate nb;
extern crate static_ref;
pub extern crate stm32f103xx;
pub mod adc;
pub mod capture;
pub mod dma;
pub mod gpio;
pub mod led;
pub mod pwm;
pub mod qei;
pub mod rtc;
pub mod serial;
pub mod spi;
pub mod time;
pub mod timer;
pub extern crate stm32f40x;
// pub mod adc;
// pub mod capture;
// pub mod dma;
// pub mod gpio;
// pub mod led;
// pub mod pwm;
// pub mod qei;
// pub mod rtc;
// pub mod serial;
// pub mod spi;
// pub mod time;
// pub mod timer;
pub use hal::prelude;
pub use capture::Capture;
pub use pwm::Pwm;
pub use qei::Qei;
pub use rtc::Rtc;
pub use serial::Serial;
pub use spi::Spi;
pub use timer::{Channel, Timer};
// pub use capture::Capture;
// pub use pwm::Pwm;
// pub use qei::Qei;
// pub use rtc::Rtc;
// pub use serial::Serial;
// pub use spi::Spi;
// pub use timer::{Channel, Timer};
macro_rules! frequency {
($FREQUENCY:expr) => {
......@@ -119,17 +120,17 @@ macro_rules! frequency {
}
}
/// Advance High-performance Bus (AHB)
pub mod ahb {
frequency!(8_000_000);
}
// /// Advance High-performance Bus (AHB)
// pub mod ahb {
// frequency!(8_000_000);
// }
/// Advance Peripheral Bus 1 (APB1)
pub mod apb1 {
frequency!(8_000_000);
}
// /// Advance Peripheral Bus 1 (APB1)
// pub mod apb1 {
// frequency!(8_000_000);
// }
/// Advance Peripheral Bus 2 (APB2)
pub mod apb2 {
frequency!(8_000_000);
}
// /// Advance Peripheral Bus 2 (APB2)
// pub mod apb2 {
// frequency!(8_000_000);
// }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment