Skip to content

Commit 1626854

Browse files
committed
doc(examples): explain how to run basic_gr_peach
1 parent 8c13384 commit 1626854

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ cd examples/basic_nucleo_f401re
129129
cargo embed --release
130130
```
131131

132+
See [this document](examples/basic_gr_peach/README.md) for how to run the example application on [the GR-PEACH development board].
133+
134+
[the GR-PEACH development board]: https://www.renesas.com/us/en/products/gadget-renesas/boards/gr-peach.html#overview
135+
132136
## Prerequisites
133137

134138
You need a Nightly Rust compiler. This project is heavily reliant on unstable features, so it might or might not work with a newer compiler version. See the file `rust-toolchain` to find out which compiler version this project is currently tested with.

examples/basic_gr_peach/.gdbinit

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
target remote :3333
2+
mon reset halt
3+
4+
# Enable the on-chip RAM
5+
mon mwb 0xFCFE0400 0xff
6+
mon mwb 0xFCFE0404 0xff
7+
mon mwb 0xFCFE0408 0xff
8+
9+
load

examples/basic_gr_peach/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
This directory contains an example Constance application for [GR-PEACH].
2+
3+
[GR-PEACH]: https://www.renesas.com/us/en/products/gadget-renesas/boards/gr-peach.html#overview
4+
5+
You need the following software to run this application:
6+
7+
- [OpenOCD]
8+
- `arm-none-eabi-gdb`
9+
- [rustup] or the correct version of the Rust toolchain
10+
- The Armv7-A build of the Rust standard library (can be [installed] by `rustup target add armv7a-none-eabi`)
11+
12+
[OpenOCD]: http://openocd.org
13+
[rustup]: https://rustup.rs
14+
[installed]: https://rust-lang.github.io/rustup/cross-compilation.html
15+
16+
This application can be loaded onto the target using OpenOCD and GDB. In one terminal window, start an instance of OpenOCD using the supplied configuration file:
17+
18+
```shell
19+
openocd -f opencd.cfg
20+
```
21+
22+
In another terminal window, compile and load the application by doing the following:
23+
24+
```shell
25+
cargo build --release
26+
arm-none-eabi-gdb -iex 'target remote localhost:3333' ../../target/armv7a-none-eabi/release/basic_gr_peach
27+
```
28+
29+
GDB automatically executes the commands in the `.gdbinit` file to download the image to the target's on-chip memory and direct PC to the entry point. Now, open a serial terminal application, configure the baud rate to 115200, and enter `c` in GDB. You should see the following output in the serial terminal:
30+
31+
```text
32+
UART is ready
33+
COTTAGE = Objects { task1: Task(1), task2: Task(2) }
34+
time = 5.178ms
35+
time = 1.006644s
36+
time = 2.007444s
37+
...
38+
```

examples/basic_gr_peach/openocd.cfg

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
source [find interface/cmsis-dap.cfg]
2+
source [find target/swj-dp.tcl]
3+
4+
set _CHIPNAME rza1
5+
swj_newdap $_CHIPNAME cpu -expected-id 0x3ba02477
6+
7+
set _TARGETNAME $_CHIPNAME.cpu
8+
target create $_TARGETNAME cortex_a -chain-position $_TARGETNAME
9+
10+
adapter_khz 1000
11+
reset_config trst_and_srst
12+
debug_level 0
13+
gdb_target_description enable
14+
gdb_breakpoint_override hard
15+
init
16+
halt
17+
cortex_a dbginit

0 commit comments

Comments
 (0)