Bare-metal application on SDRAM failing to run on DE10-nano
I'm struggling (huge understatement) to get my bare-metal application running and would appreciate some help.
My set up is:
I'm using a DE10-nano development board and have 4 copies of the preloader plus my bare-metal application (with mkimage header) in the A2 partition of an SD card. The DE10-nano board has 1MB of SDRAM. When I run the code I see this:
Trying to boot from MMC1
Trying to boot from MMC1
Trying to boot from MMC1
Trying to boot from MMC1
I'm pretty sure my preloader is working fine, as I've imported the FPGA handoff files following the instructions and have built the u-boot preloader successfully. I then enabled the debug messages in the preloader plus added a few of my own and have seen that the SDRAM is calibrated successfully and the load of the application from the SD card to SDRAM was successful. I got the preloader to show the address in SDRAM that it will be jumping to, which matched the address my application has been linked to run from (0x00100040). I also got the preloader to read the 32-bit word in SDRAM at the entry address and this matches the value in my built executable (I used the Cygwin ddx utility to convert the binary file into ASCII). The following is an extract of this debugging:
drivers/ddr/altera/sequencer.c: CALIBRATION PASSED
drivers/ddr/altera/sequencer.c: Calibration complete
Trying to boot from MMC1
Image Name: LPS App
Image Load addr: 00100000
Image Entry Point: 00100040
Jumping to U-Boot
loaded - jumping to U-Boot...
image entry point: 0x100040
Value at entry point: 0xe59ff018
drivers/ddr/altera/sequencer.c: CALIBRATION PASSED
drivers/ddr/altera/sequencer.c: Calibration complete
Trying to boot from MMC1
Image Name: LPS App
Image Load addr: 00100000
Image Entry Point: 00100040
Jumping to U-Boot
loaded - jumping to U-Boot...
image entry point: 0x100040
Value at entry point: 0xe59ff018
drivers/ddr/altera/sequencer.c: CALIBRATION PASSED
drivers/ddr/altera/sequencer.c: Calibration complete
Trying to boot from MMC1
Image Name: LPS App
Image Load addr: 00100000
Image Entry Point: 00100040
Jumping to U-Boot
loaded - jumping to U-Boot...
image entry point: 0x100040
Value at entry point: 0xe59ff018
drivers/ddr/altera/sequencer.c: CALIBRATION PASSED
drivers/ddr/altera/sequencer.c: Calibration complete
Trying to boot from MMC1
Image Name: LPS App
Image Load addr: 00100000
Image Entry Point: 00100040
Jumping to U-Boot
loaded - jumping to U-Boot...
image entry point: 0x100040
Value at entry point: 0xe59ff018