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
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
`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"`
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]
use core::cell::Cell;
use cortex_m::asm;
use cortex_m_rt::entry;
use critical_section::Mutex;
use embedded_hal::delay::DelayNs;
use panic_rtt_target as _;
use rtt_target::{rprintln, rtt_init_print};
use simple_examples::peb1;
@ -36,10 +36,11 @@ fn main() -> ! {
.xtal_n_clk_with_src_freq(peb1::EXTCLK_FREQ)
.freeze(&mut dp.sysconfig)
.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);
second_timer.start(1.Hz());
second_timer.listen();
// let delay_provider = dp.sy
loop {
let current_ms = critical_section::with(|cs| MS_COUNTER.borrow(cs).get());
if current_ms - last_ms >= 1000 {
@ -48,7 +49,11 @@ fn main() -> ! {
let second = critical_section::with(|cs| SEC_COUNTER.borrow(cs).get());
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>) {
self.tim.reg().ctrl().modify(|_, w| w.enable().clear_bit());
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);
// Decrementing counter, to set the reset value.
self.set_count(0);

View File

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

View File

@ -55,6 +55,19 @@
"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",
"type": "shell",
@ -160,5 +173,18 @@
"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",
}
},
]
}