This could be a good use of GDB to debug, if you are comfortable with it. There are lots of tools installed with the SiFive BSP which you can use outside of the Arduino IDE. On Linux, these tools are installed at a location like
~/.arduino15/packages/sifive/. Let’s call that path
In one terminal window, connect to your board with OpenOCD:
$SIFIVE/tools/openocd/<hash>/bin/openocd -f $SIFIVE/hardware/riscv/1.0.2/freedom-e-sdk/bsp/env/freedom-e300-hifive1/openocd.cfg -d
Just leave that running. In a second terminal window, start up GDB. You will need to know where the Arduino IDE puts the actual ELF file that it loaded to your board. Generally this is at
/tmp/arduino/build_#####/<your_sketch_name.ino.elf>. You can find it in the Arduino IDE output when it uploads the file.
Once GDB is running, you can debug your code:
(gdb) target extended-remote localhost:3333
(gdb) display/i $pc
(gdb) p/x $mstatus
(gdb) p/x $mie
and so on.
This will show you where your code is currently running. Perhaps it is stuck in ISR or elsewhere. When you get GDB running, let us know what kind of results you are seeing and we can debug further.