update VS Code config
Some checks failed
Rust/va416xx-rs/pipeline/pr-main There was a failure building this commit

This commit is contained in:
Robin Müller 2024-09-17 10:52:43 +02:00
parent a9185ffb48
commit b67b9d32f7
Signed by: muellerr
GPG Key ID: A649FB78196E3849
5 changed files with 54 additions and 32 deletions

View File

@ -96,7 +96,8 @@ example.
### Using VS Code ### Using VS Code
Assuming a working debug connection to your VA108xx board, you can debug using VS Code with Assuming a working debug connection to your VA108xx board, you can debug using VS Code with
the [`Cortex-Debug` plugin](https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug). the [`Cortex-Debug` plugin](https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug). Please make aure that [`objdump-multiarch` and `nm-multiarch`](https://forums.raspberrypi.com/viewtopic.php?t=333146)
are installed as well.
Some sample configuration files for VS code were provided and can be used by running Some sample configuration files for VS code were provided and can be used by running
`cp -rT vscode .vscode` like specified above. After that, you can use `Run and Debug` `cp -rT vscode .vscode` like specified above. After that, you can use `Run and Debug`
@ -111,4 +112,5 @@ configuration variables in your `settings.json`:
- `"cortex-debug.gdbPath.osx"` - `"cortex-debug.gdbPath.osx"`
The provided VS Code configurations also provide an integrated RTT logger, which you can access The provided VS Code configurations also provide an integrated RTT logger, which you can access
via the terminal at `RTT Ch:0 console`. via the terminal at `RTT Ch:0 console`. In order for the RTT block address detection to
work properly, `objdump-multiarch` and `nm-multiarch` need to be installed.

View File

@ -3,9 +3,9 @@
#![no_std] #![no_std]
use core::cell::Cell; use core::cell::Cell;
use cortex_m::asm;
use cortex_m_rt::entry; use cortex_m_rt::entry;
use critical_section::Mutex; use critical_section::Mutex;
use embedded_hal::delay::DelayNs;
use panic_rtt_target as _; use panic_rtt_target as _;
use rtt_target::{rprintln, rtt_init_print}; use rtt_target::{rprintln, rtt_init_print};
use simple_examples::peb1; use simple_examples::peb1;
@ -36,10 +36,11 @@ fn main() -> ! {
.xtal_n_clk_with_src_freq(peb1::EXTCLK_FREQ) .xtal_n_clk_with_src_freq(peb1::EXTCLK_FREQ)
.freeze(&mut dp.sysconfig) .freeze(&mut dp.sysconfig)
.unwrap(); .unwrap();
let mut delay_provider = set_up_ms_tick(&mut dp.sysconfig, dp.tim0, &clocks); let _ = set_up_ms_tick(&mut dp.sysconfig, dp.tim0, &clocks);
let mut second_timer = CountdownTimer::new(&mut dp.sysconfig, dp.tim1, &clocks); let mut second_timer = CountdownTimer::new(&mut dp.sysconfig, dp.tim1, &clocks);
second_timer.start(1.Hz()); second_timer.start(1.Hz());
second_timer.listen(); second_timer.listen();
// let delay_provider = dp.sy
loop { loop {
let current_ms = critical_section::with(|cs| MS_COUNTER.borrow(cs).get()); let current_ms = critical_section::with(|cs| MS_COUNTER.borrow(cs).get());
if current_ms - last_ms >= 1000 { if current_ms - last_ms >= 1000 {
@ -48,7 +49,11 @@ fn main() -> ! {
let second = critical_section::with(|cs| SEC_COUNTER.borrow(cs).get()); let second = critical_section::with(|cs| SEC_COUNTER.borrow(cs).get());
rprintln!("Second counter: {}", second); rprintln!("Second counter: {}", second);
} }
delay_provider.delay_ms(1000); for _ in 0..30000 {
asm::nop();
}
//delay_provider.delay_ms(1000);
} }
} }

View File

@ -587,7 +587,7 @@ impl<Tim: ValidTim> CountdownTimer<Tim> {
pub fn load(&mut self, timeout: impl Into<Hertz>) { pub fn load(&mut self, timeout: impl Into<Hertz>) {
self.tim.reg().ctrl().modify(|_, w| w.enable().clear_bit()); self.tim.reg().ctrl().modify(|_, w| w.enable().clear_bit());
self.curr_freq = timeout.into(); self.curr_freq = timeout.into();
self.rst_val = self.clock.raw() / self.curr_freq.raw() - 1; self.rst_val = (self.clock.raw() / self.curr_freq.raw()) - 1;
self.set_reload(self.rst_val); self.set_reload(self.rst_val);
// Decrementing counter, to set the reset value. // Decrementing counter, to set the reset value.
self.set_count(0); self.set_count(0);

View File

@ -74,8 +74,7 @@
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": { "rttConfig": {
"enabled": true, "enabled": true,
// Have to use exact address unfortunately. "auto" does not work for some reason.. "address": "auto",
"address": "0x1fff8000",
"decoders": [ "decoders": [
{ {
"port": 0, "port": 0,
@ -104,8 +103,7 @@
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": { "rttConfig": {
"enabled": true, "enabled": true,
// Have to use exact address unfortunately. "auto" does not work for some reason.. "address": "auto",
"address": "0x1fff8000",
"decoders": [ "decoders": [
{ {
"port": 0, "port": 0,
@ -134,8 +132,7 @@
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": { "rttConfig": {
"enabled": true, "enabled": true,
// Have to use exact address unfortunately. "auto" does not work for some reason.. "address": "auto",
"address": "0x1fff8000",
"decoders": [ "decoders": [
{ {
"port": 0, "port": 0,
@ -164,11 +161,11 @@
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": { "rttConfig": {
"enabled": true, "enabled": true,
// Have to use exact address unfortunately. "auto" does not work for some reason.. "address": "auto",
"address": "0x1fff8000",
"decoders": [ "decoders": [
{ {
"port": 0, "port": 0,
"timestamp": true,
"type": "console" "type": "console"
} }
] ]
@ -194,8 +191,7 @@
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": { "rttConfig": {
"enabled": true, "enabled": true,
// Have to use exact address unfortunately. "auto" does not work for some reason.. "address": "auto",
"address": "0x1fff8000",
"decoders": [ "decoders": [
{ {
"port": 0, "port": 0,
@ -224,8 +220,7 @@
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": { "rttConfig": {
"enabled": true, "enabled": true,
// Have to use exact address unfortunately. "auto" does not work for some reason.. "address": "auto",
"address": "0x1fff8000",
"decoders": [ "decoders": [
{ {
"port": 0, "port": 0,
@ -255,8 +250,7 @@
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": { "rttConfig": {
"enabled": true, "enabled": true,
// Have to use exact address unfortunately. "auto" does not work for some reason.. "address": "auto",
"address": "0x1fff8000",
"decoders": [ "decoders": [
{ {
"port": 0, "port": 0,
@ -286,8 +280,7 @@
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": { "rttConfig": {
"enabled": true, "enabled": true,
// Have to use exact address unfortunately. "auto" does not work for some reason.. "address": "auto",
"address": "0x1fff8000",
"decoders": [ "decoders": [
{ {
"port": 0, "port": 0,
@ -317,8 +310,7 @@
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": { "rttConfig": {
"enabled": true, "enabled": true,
// Have to use exact address unfortunately. "auto" does not work for some reason.. "address": "auto",
"address": "0x1fff8000",
"decoders": [ "decoders": [
{ {
"port": 0, "port": 0,
@ -348,8 +340,7 @@
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": { "rttConfig": {
"enabled": true, "enabled": true,
// Have to use exact address unfortunately. "auto" does not work for some reason.. "address": "auto",
"address": "0x1fff8004",
"decoders": [ "decoders": [
{ {
"port": 0, "port": 0,
@ -379,8 +370,7 @@
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": { "rttConfig": {
"enabled": true, "enabled": true,
// Have to use exact address unfortunately. "auto" does not work for some reason.. "address": "auto",
"address": "0x1fff8000",
"decoders": [ "decoders": [
{ {
"port": 0, "port": 0,
@ -409,9 +399,8 @@
"interface": "swd", "interface": "swd",
"runToEntryPoint": "main", "runToEntryPoint": "main",
"rttConfig": { "rttConfig": {
"enabled": false, "enabled": true,
// Have to use exact address unfortunately. "auto" does not work for some reason.. "address": "auto",
"address": "0x1fff806c",
"decoders": [ "decoders": [
{ {
"port": 0, "port": 0,
@ -422,4 +411,4 @@
} }
}, },
] ]
} }

View File

@ -55,6 +55,19 @@
"kind": "build", "kind": "build",
} }
}, },
{
"label": "timer-ticks-example",
"type": "shell",
"command": "~/.cargo/bin/cargo", // note: full path to the cargo
"args": [
"build",
"--example",
"timer-ticks"
],
"group": {
"kind": "build",
}
},
{ {
"label": "blinky-example", "label": "blinky-example",
"type": "shell", "type": "shell",
@ -160,5 +173,18 @@
"kind": "build", "kind": "build",
} }
}, },
{
"label": "embassy-example",
"type": "shell",
"command": "~/.cargo/bin/cargo", // note: full path to the cargo
"args": [
"build",
"--bin",
"embassy-example"
],
"group": {
"kind": "build",
}
},
] ]
} }