Skip to content
Snippets Groups Projects
Commit 692c71db authored by Per's avatar Per
Browse files

clocking 4Mhz, itm in zero-tasks

parent 454e26fa
No related branches found
No related tags found
No related merge requests found
......@@ -26,15 +26,16 @@
"request": "attach",
"name": "Debug nested",
"gdbpath": "/usr/bin/arm-none-eabi-gdb",
"executable": "./target/thumbv7em-none-eabihf/debug/examples/nested",
"executable": "./target/thumbv7m-none-eabi/debug/examples/nested",
"target": ":3333",
"remote": true,
"autorun": [
"monitor reset init",
"monitor adapter_khz 5000",
"monitor arm semihosting enable",
"monitor tpiu config internal /tmp/itm.log uart off 16000000",
"monitor itm port 0 on",
"load"
"monitor reset init",
"load",
"monitor reset init"
],
"cwd": "${workspaceRoot}"
},
......@@ -117,6 +118,8 @@
"autorun": [
"monitor reset init",
"monitor adapter_khz 5000",
"monitor tpiu config internal /tmp/itm.log uart off 4000000",
"monitor itm port 0 on",
"monitor arm semihosting enable",
"monitor reset init",
"load",
......
......@@ -30,6 +30,16 @@ git = "https://gitlab.henriktjader.com/pln/STM32F40x"
features = ["rt"]
version = "0.1.0"
[dev-dependencies.lpc176x5x]
path = "../lpc176x5x"
features = ["rt"]
version = "0.1.0"
[dependencies.cortex-m-semihosting]
version = "0.2.0"
[features]
wcet_bkpt = []
wcet_nop = []
......
......@@ -24,15 +24,16 @@ Jumper j4, (desoldered)
nucleo lpc
1 VDD_TARGET - White - 2 VIO_3V3X (not used)
1 VDD_TARGET - - 2 VIO_3V3X (not used)
2 SWCLK - Pink - 6 TCLK_SWCLKX
3 GND - Black - 16 GNDX
4 SWDIO - Grey - 4 TMS_SWDIOX
5 NRST - Blue - 12 RESETX
5 NRST - - 12 RESETX (not used)
6 SWO - Blue - 8 TDO_SWOX
on the lpc, j4, power is provided from the usb, pin 1-2 bridged
NRST, should it be connected?
openocd -f interface/stlink-v2-1.cfg -f target/lpc17xx.cfg -c "init; reset halt"
* UM10360
......@@ -4,9 +4,12 @@
#![feature(proc_macro)]
#![no_std]
#[macro_use]
extern crate cortex_m;
extern crate cortex_m_rtfm as rtfm;
// IMPORTANT always do this rename
extern crate stm32f40x; // the device crate
extern crate lpc176x5x; // the device crate
// import the procedural macro
use rtfm::app;
......@@ -17,7 +20,7 @@ use rtfm::app;
// `main` yourself.
app! {
// this is the path to the device crate
device: stm32f40x,
device: lpc176x5x,
}
// The initialization phase.
......@@ -25,9 +28,18 @@ app! {
// This runs first and within a *global* critical section. Nothing can preempt
// this function.
fn init(p: init::Peripherals) {
use lpc176x5x::syscon::clksrcsel::*;
// This function has access to all the peripherals of the device
p.GPIOA;
p.RCC;
let itm = p.ITM;
iprintln!(&itm.stim[0], "Hello, world!");
let r = p.SYSCON.clksrcsel.read().clksrc();
match r {
CLKSRCR::SELECTS_THE_INTERNAL => rtfm::bkpt(),
_ => rtfm::bkpt(),
}
//iprintln!(&itm.stim[0], "{:?}", p.SYSCON.clksrcsel.read());
// ..
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment