Skip to content

Commit 37bccf2

Browse files
committed
Add troubleshooting section
1 parent e1c0f89 commit 37bccf2

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

docs/embedded/flexpret.mdx

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,73 @@ TODO: Describe and create example program
9595
2. interrupt temporal isolation
9696

9797

98+
99+
# Troubleshooting
100+
101+
## Environment not set up
102+
103+
```
104+
lfc: warning: No FP_PATH environment variable found
105+
lfc: warning: No FP_SDK_PATH environment variable found
106+
```
107+
108+
You probably forgot to `source env.bash` or `source env.fish`.
109+
110+
## FlexPRET not installed to SDK
111+
112+
This message means that the SDK did not find a FlexPRET installation.
113+
114+
```
115+
Could not find
116+
<path to workspace>/lf-flexpret-workspace/flexpret/sdk/flexpret/fp-emu.
117+
Please build FlexPRET and install it here with `cmake --install` to
118+
continue.
119+
```
120+
121+
In this case, you need to step into the FlexPRET directory, build FlexPRET (if
122+
not built already) and install it to the SDK.
123+
124+
```
125+
cd $FP_PATH
126+
cmake -B build && cd build && make all install
127+
```
128+
129+
## Instruction memory full
130+
131+
An error that looks like this means your program (i.e., your instructions) are
132+
too large to fit inside the instruction memory.
133+
134+
```
135+
/opt/riscv/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/bin/ld: HelloWorld.riscv section `.text' will not fit in region `ROM'
136+
/opt/riscv/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/bin/ld: region `ROM' overflowed by 70664 bytes
137+
```
138+
139+
There are two possible solutions to this issue:
140+
1. Reduce the size of your program. `printf` is notorious for taking up a lot of
141+
space, so consider replacing it with a lower footprint version. Tip: To inspect
142+
what takes up space in your final executible, use `nm`, like so:
143+
`nm HelloWorld.riscv --size-sort`.
144+
2. Increase the size of the instruction memory. This is done in FlexPRET's
145+
configs (see TODO: LINK: ./flexpret/README.md#Configuration). This is easily
146+
done when emulating FlexPRET, but might not be so simple on an FPGA.
147+
148+
## Bootloader not found
149+
150+
This error should only occur if you have specified `fpga` in the board target
151+
property. It means that you do not have a bootloader installed to the FlexPRET
152+
SDK.
153+
154+
```
155+
Could not find
156+
/home/magnus/ntnu/mttk/var2024/master/lf-flexpret/flexpret/sdk/flexpret/bootloader.cmake,
157+
which is required to build software for FlexPRET on FPGA using the
158+
bootloader.
159+
```
160+
161+
The solution is to build the SDK; it will build the bootloder and automatically
162+
install it.
163+
164+
```
165+
cd $FP_SDK_PATH
166+
cmake -B build && cd build && make
167+
```

0 commit comments

Comments
 (0)