Skip to content

Commit 1b68506

Browse files
committed
Added unused function pruning to RISCV build. Updated debugging commands.
1 parent 317bca1 commit 1b68506

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

arch.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ ifeq ($(ARCH),RISCV)
4747
CROSS_COMPILE:=riscv32-unknown-elf-
4848
CFLAGS+=-fno-builtin-printf -DUSE_PLIC -DUSE_M_TIME -g -march=rv32imac -mabi=ilp32 -mcmodel=medany -nostartfiles -DARCH_RISCV
4949
LDFLAGS+=-march=rv32imac -mabi=ilp32 -mcmodel=medany
50+
51+
# Prune unused functions and data
52+
CFLAGS +=-ffunction-sections -fdata-sections
53+
LDFLAGS+=-Wl,--gc-sections
54+
5055
OBJS+=src/boot_riscv.o src/vector_riscv.o
5156
ARCH_FLASH_OFFSET=0x20000000
5257
endif

docs/Targets.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ Loading with JLink:
6969

7070
```
7171
JLinkExe -device FE310 -if JTAG -speed 4000 -jtagconf -1,-1 -autoconnect 1
72-
loadfile wolfboot.hex
73-
reset
72+
loadbin factory.bin 0x20010000
73+
rnh
7474
```
7575

7676
### Debugging
@@ -81,9 +81,12 @@ In one terminal:
8181
`JLinkGDBServer -device FE310 -port 3333`
8282

8383
In another terminal:
84+
`riscv64-unknown-elf-gdb test-app/image.elf -ex "set remotetimeout 240" -ex "target extended-remote localhost:3333"`
85+
or
8486
`riscv64-unknown-elf-gdb wolfboot.elf -ex "set remotetimeout 240" -ex "target extended-remote localhost:3333"`
8587

8688

89+
8790
## STM32-F407
8891

8992
Example 512KB partitioning on STM32-F407

0 commit comments

Comments
 (0)