Dear SiFive community,
I am trying to run a program that requires a significant amount of RAM on a HiFive1 Rev B board. More precisely, the code makes use of an array of ~400 unsigned integers.
By making some simple tests, I noticed that a simple code doesn’t run on the HiFive1 Rev B when it manipulates large arrays.
For instance, the following program:
int main(void) {
unsigned int test[150];
for(int i = 0; i < 150; i++) {
test[i] = i;
printf("%d ,", test[i]);
}
}
runs normally when compiled and loaded on the board.
However, by slightly increasing the array’s size (e.g. from 150 to 200), the code doesn’t run anymore as expected since nothing is printed out.
I don’t understand why increasing the size of the array by 50 results in such an issue. Since the board comes with 16Kb of RAM, I think it has nothing to do with memory limitation.
Am I missing something?
I am compiling/loading the program with a simple make BSP=metal PROGRAM=test_memory TARGET=sifive-hifive1-revb clean software upload
using the Freedom E SDK (so the linker file used is metal.default.lds
).