Forum Discussion
Failed to load "<project.axf>" - Can't run bare-metal application from SDRAM
- 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.
Hi,
I see that you are doing "loadfile a ..dont_panic.axf", what is the content of that .axf? In the tutorial, you are loading the "bare-metal-hello-world-01.axf".
For an updated version of the tutorial, I recommend that you refer below which has a debug script for full preloader boot, or you may use the step to boot step by step:
- ESaiv5 years ago
New Contributor
Hi. Thanks for the response. The "don't panic" is a playful replacement of the words "hello world" in my file based on a book I like, but for all purposes, it's just a simple C program which prints text like a normal Hello World would. I have ran my dont_panic.axf perfectly fine out of OCRAM.
I have tried that tutorial that you linked, but encounter a different error when I run the debug-spl.ds script shown in that tutorial. I have included that error below.
Do you know why I would get that error after the "wait" command?
- ESaiv5 years ago
New Contributor
Do you know if I need a Quartus project (which includes an HPS component instantiation) already configured on the FPGA on the board before I try to run the preloader script? Or is that just required if I actually wanted to talk to the FPGA with a program?
- EBERLAZARE_I_Intel5 years ago
Regular Contributor
Hi,
I see that in the image attached you "quit" after you have bring up the preloader, which would mean that you did not have the preloader brought up when brining the hello world, which is as describe the error that you are seeing, you need to bring up the preloader to configure the SDRAM, in your case the preloader was disconnected before you bringing up your hello world test.