Skip to content

Commit 0f36144

Browse files
committed
something is still wrong
1 parent 52f5d42 commit 0f36144

File tree

8 files changed

+255
-279
lines changed

8 files changed

+255
-279
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ codegen-units = 1
2222
debug = 2
2323
debug-assertions = true # <-
2424
incremental = false
25-
# This is problematic for stepping..
26-
# opt-level = 'z' # <-
25+
# 1 instead of 0, the flashloader is too larger otherwise..
26+
# opt-level = 1 # <-
2727
overflow-checks = true # <-
2828

2929
# cargo build/run --release

bootloader/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ edition = "2021"
77
cortex-m = "0.7"
88
cortex-m-rt = "0.7"
99
embedded-hal = "1"
10-
embedded-hal-bus = "0.2"
11-
dummy-pin = "1"
1210
panic-rtt-target = { version = "0.1.3" }
1311
panic-halt = { version = "0.2" }
1412
rtt-target = { version = "0.5" }

flashloader/image-loader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
BOOTLOADER_START_ADDR = 0x0
2828
BOOTLOADER_END_ADDR = 0x3000
29-
BOOTLOADER_CRC_ADDR = BOOTLOADER_END_ADDR - 4
30-
BOOTLOADER_MAX_SIZE = BOOTLOADER_END_ADDR - BOOTLOADER_START_ADDR - 4
29+
BOOTLOADER_CRC_ADDR = BOOTLOADER_END_ADDR - 2
30+
BOOTLOADER_MAX_SIZE = BOOTLOADER_END_ADDR - BOOTLOADER_START_ADDR - 2
3131

3232
APP_A_START_ADDR = 0x3000
3333
APP_A_END_ADDR = 0x11800
@@ -209,7 +209,7 @@ def _crc_and_app_size_postprocessing(
209209
# Blank the checksum. For the bootloader, the bootloader will calculate the
210210
# checksum itself on the initial run.
211211
checksum_write_packet = pack_memory_write_command(
212-
BOOTLOADER_CRC_ADDR, bytes([0x00, 0x00, 0x00, 0x00])
212+
BOOTLOADER_CRC_ADDR, bytes([0x00, 0x00])
213213
)
214214
self.send_tc(checksum_write_packet)
215215
else:

flashloader/slot-a-blinky/memory.x

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* Special linker script for application slot A with an offset at address 0x3000 */
22
MEMORY
33
{
4-
FLASH : ORIGIN = 0x00000000, LENGTH = 0x3000 /* 128K */
4+
FLASH : ORIGIN = 0x00003000, LENGTH = 0x20000 /* 128K */
55
RAM : ORIGIN = 0x10000000, LENGTH = 0x08000 /* 32K */
66
}
77

flashloader/slot-b-blinky/memory.x

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* Special linker script for application slot B with an offset at address 0x11800 */
22
MEMORY
33
{
4-
FLASH : ORIGIN = 0x00000000, LENGTH = 0x11800 /* 128K */
4+
FLASH : ORIGIN = 0x00011800, LENGTH = 0x20000 /* 128K */
55
RAM : ORIGIN = 0x10000000, LENGTH = 0x08000 /* 32K */
66
}
77

flashloader/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ mod app {
110110
tm_prod: DataProducer<BUF_RB_SIZE_TM, SIZES_RB_SIZE_TM>,
111111
}
112112

113-
rtic_monotonics::systick_monotonic!(Mono, 10_000);
113+
rtic_monotonics::systick_monotonic!(Mono, 1000);
114114

115115
#[init]
116116
fn init(cx: init::Context) -> (Shared, Local) {
@@ -134,7 +134,7 @@ mod app {
134134
UART_BAUDRATE.Hz(),
135135
);
136136
let (tx, rx) = irq_uart.split();
137-
let mut rx = rx.into_rx_with_irq(&mut dp.sysconfig, &mut dp.irqsel, pac::interrupt::OC3);
137+
let mut rx = rx.into_rx_with_irq(&mut dp.sysconfig, &mut dp.irqsel, pac::interrupt::OC0);
138138

139139
let verif_reporter = VerificationReportCreator::new(0).unwrap();
140140

vscode/launch.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,5 +451,53 @@
451451
]
452452
}
453453
},
454+
{
455+
"type": "cortex-debug",
456+
"request": "launch",
457+
"name": "Bootloader",
458+
"servertype": "jlink",
459+
"cwd": "${workspaceRoot}",
460+
"device": "Cortex-M0",
461+
"svdFile": "./va108xx/svd/va108xx.svd.patched",
462+
"preLaunchTask": "bootloader",
463+
"executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/bootloader",
464+
"interface": "jtag",
465+
"runToEntryPoint": "main",
466+
"rttConfig": {
467+
"enabled": true,
468+
"address": "auto",
469+
"decoders": [
470+
{
471+
"port": 0,
472+
"timestamp": true,
473+
"type": "console"
474+
}
475+
]
476+
}
477+
},
478+
{
479+
"type": "cortex-debug",
480+
"request": "launch",
481+
"name": "Flashloader",
482+
"servertype": "jlink",
483+
"cwd": "${workspaceRoot}",
484+
"device": "Cortex-M0",
485+
"svdFile": "./va108xx/svd/va108xx.svd.patched",
486+
"preLaunchTask": "flashloader",
487+
"executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/flashloader",
488+
"interface": "jtag",
489+
"runToEntryPoint": "main",
490+
"rttConfig": {
491+
"enabled": true,
492+
"address": "auto",
493+
"decoders": [
494+
{
495+
"port": 0,
496+
"timestamp": true,
497+
"type": "console"
498+
}
499+
]
500+
}
501+
},
454502
]
455503
}

0 commit comments

Comments
 (0)