Forum Discussion

ESaiv's avatar
ESaiv
Icon for New Contributor rankNew Contributor
5 years ago
Solved

Failed to load "<project.axf>" - Can't run bare-metal application from SDRAM

Hi there. PREMABLE: I have been following this Bare-Metal User Guide in ARM Development Studio (even though it is written for DS-5) in an attempt to get a bare-metal "Hello World" running from SD...
  • ESaiv's avatar
    5 years ago

    I have resolved this error. Or at least, the version of the error I was having.

    Intel ubiquitously suggests this example for building a preloader which brings up SDRAM, and it is a good example, but it does not make it explicitly clear (at least for a beginner) that it only works for the Cyclone V SoC FPGA Development Kit, which is a specific board with a specific SoC FPGA model. If you are using some other board (DE10-Nano, DE1-SoC, anything) it will not work without modifications. Once I ran the debug-spl.ds script from that example with modifications, the SDRAM HelloWorld (with scatter file, etc) from the Bare Metal User Guide in my original post worked well.

    If you want it to work for your particular board, you must ensure three things when going through the example:

    1. Make sure your hand-off folder, e.g.

    preloader-settings-dir "hps_isw_handoff/soc_system_hps_0" 

    is built for your board (in my case, it was the DE10-Nano). You can't use the cv_soc_devkit_ghrd because it's not generic - it only works for the that development kit. In my case, I just started the whole example in a new folder with a Quartus-generated hand-off folder for the DE10-Nano, and not inside /intelFPGA/20.1/embedded/examples... etc.

    2. Replace the qts_filter step with a path specific to your board. For the DE10-Nano, I had to do the below. Note the difference at the end.

    ./arch/arm/mach-socfpga/qts-filter.sh cyclone5 ../../../ ../ ./board/terasic/de10-nano/qts/ 

    3. Same with the make command - it's board specific. I had to go:

    make socfpga_de10_nano_defconfig

    which is not obvious because we're replacing "Cyclone V" with "DE10-Nano" even though DE10-Nanos have a Cyclone V. All in all, the term "Cyclone V" often actually means "the Cyclone V development kit," so be cognizant of that.

    I hope this helps. If you have any questions about my resolution, reply in this thread. If I see the email, I'll answer, because I know what it's like to be stuck on these things.