-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
65 lines (51 loc) · 2.32 KB
/
Copy pathjustfile
File metadata and controls
65 lines (51 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
set dotenv-load := true
set shell := ["sh", "-eu", "-c"]
device := env_var_or_default("JLINK_DEVICE", "R9A07G075M0")
interface := env_var_or_default("JLINK_IF", "SWD")
speed := env_var_or_default("JLINK_SPEED", "12000")
serial := env_var_or_default("JLINK_SERIAL", "000839006698")
elf := "target/armv8r-none-eabihf/release/cu-rz-blinky"
hex := "target/armv8r-none-eabihf/release/cu-rz-blinky.hex"
# List documented entry points.
default:
@just --list
# Verify local tools needed for build, load, and defmt decode.
check-tools:
command -v cargo
command -v arm-none-eabi-objcopy
command -v JLinkExe
command -v JLinkGDBServerCLExe
command -v defmt-print
# Build the optimized Cortex-R52 firmware ELF.
build:
cargo build-r52
# Build the firmware and regenerate the Intel HEX image used by J-Link Commander.
hex: build
arm-none-eabi-objcopy -O ihex {{elf}} {{hex}}
# RAM-load the HEX image through J-Link and start the firmware.
load: hex
JLinkExe -device {{device}} -if {{interface}} -speed {{speed}} -USB {{serial}} -CommanderScript scripts/load-ram-r52.jlink
# Start a J-Link GDB server for manual debugging.
gdb-server:
JLinkGDBServerCLExe -device {{device}} -if {{interface}} -speed {{speed}} -USB {{serial}}
# Halt and print registers plus key SRAM/code windows.
inspect:
JLinkExe -device {{device}} -if {{interface}} -speed {{speed}} -USB {{serial}} -CommanderScript scripts/inspect-r52.jlink
# Single-step the first startup instructions from the firmware entry point.
step-start:
JLinkExe -device {{device}} -if {{interface}} -speed {{speed}} -USB {{serial}} -CommanderScript scripts/step-start-r52.jlink
# Resume the target if it is halted.
resume:
JLinkExe -device {{device}} -if {{interface}} -speed {{speed}} -USB {{serial}} -CommanderScript scripts/resume-r52.jlink
# Halt and dump the RTT control block plus up-buffer to logs/.
rtt-dump:
mkdir -p logs
JLinkExe -device {{device}} -if {{interface}} -speed {{speed}} -USB {{serial}} -CommanderScript scripts/dump-rtt-r52.jlink
# Decode the last dumped RTT snapshot with defmt-print.
rtt-decode:
sh scripts/decode-rtt-snapshot.sh
# Dump and decode a defmt RTT snapshot.
rtt: rtt-dump rtt-decode
# Remove generated RTT snapshot files.
clean-logs:
rm -f logs/rtt-control.bin logs/rtt-up0.bin logs/rtt-defmt.raw logs/rtt-defmt-snapshot.raw