Exception in thread "main"

When you generate the SoC with a custom user application, you may receive messages similar to the following when you compile your software application:

Exception in thread "main"
java.lang.ArrayIndexOutOfBoundsException: Index 29361152 out of bounds for length 1024
at spinal.lib.misc.HexTools$$anonfun$initRam$1.apply$mcVII$sp(HexTools.scala:53)

This can happen when you have an SoC with external memory interface. The default linker script targets the external memory region during application compilation. You should compile your application to target on-chip RAM instead by following these steps:

  1. Open the file <project>/embedded_sw/<module>/software/standalone/common/bsp.mk.
  2. Change line 7 from
    LDSCRIPT ?= ${BSP_PATH}/linker/default.ld
    to
    LDSCRIPT ?= ${BSP_PATH}/linker/default_i.ld
  3. Recompile the application.

If these steps do not solve the issue, contact the Efinix support team via our forum in the Support Center.