Forum Discussion
I apologize, I was not able to use Ashling RiscFree to succesfully debug either U-Boot or the bare-metal application on the A10 board. I have not used this combination before, so not sure if it is a problem with what I am doing, or something else.
Note the 25.3 release of Ashling RiscFree installer contains an older version of the tool. You can get the latest available version from the 25.1.1 release at this link: https://www.altera.com/download-center/license-agreement/78291/289e6b3d2979a43f6ddfb46c3eeabfca0b49b3c4?filename=RiscFreeSetup-25.1.1.125-windows.exe.
Will continue after the holidays, in early January. Hopefully someone else can also help in the meantime.
I was, however, able to load and run the application from U-Boot, without a debugger. Here is how you can do that, in case it helps:
1. Compile the HWLIBs design in MSYS2:
# top folder
mkdir a10-baremetal
cd a10-baremetal
export TOP_FOLDER=$PWD# get hwlibs
cd $TOP_FOLDER
git clone https://github.com/altera-opensource/intel-socfpga-hwlib# install toolchain
cd $TOP_FOLDER/intel-socfpga-hwlib/tools
./install_linaro.sh
export PATH=$PATH:$PWD/gcc/bin
export CROSS_COMPILE=arm-eabi-# build the example
cd $TOP_FOLDER/intel-socfpga-hwlib/examples/A10/Altera-SoCFPGA-HardwareLib-Timer-A10-GNU
# fix newlib location
sed -i 's|/local||g' Makefile
# use rm for deleting files
sed -i s'|cs-rm|rm|' Makefile.inc
make clean && make SEMIHOSTED=0 MEMORY=ddr
2. Get the GSRD SD card from https://releases.rocketboards.org/2025.10/gsrd/a10_gsrd/sdimage.tar.gz, extract it and write it to an SD card, for example with https://etcher.balena.io/.
3. Write the application.axf to the FAT partition of the SD card. You can use Windows for that. Eject card after that.
4. Insert SD card, power up board.
5. Press any key when instructed during countdown, to drop to U-Boot console.
6. Run the following U-Boot commands to load and execute the bare-metal application:
load mmc 0:1 0x10000000 application.axf
bootelf 0x10000000
go 0x00100040
For reference, here is all console output:
U-Boot SPL 2025.07 (Sep 25 2025 - 01:10:31 +0000)
FPGA: Checking FPGA configuration setting ...
FPGA: Start to program peripheral/full bitstream ...
FPGA: Early Release Succeeded.
FPGA: Checking FPGA configuration setting ...
FPGA: Start to program peripheral/full bitstream ...
FPGA: Early Release Succeeded.U-Boot SPL 2025.07 (Sep 25 2025 - 01:10:31 +0000)
DDRCAL: Success
DDRCAL: Scrubbing ECC RAM (1024 MiB).
DDRCAL: SDRAM-ECC initialized success with 334 ms
FPGA: Checking FPGA configuration setting ...
FPGA: Skipping configuration ...
Trying to boot from MMC1
U-Boot 2025.07 (Sep 25 2025 - 01:10:31 +0000)socfpga_arria10CPU: Altera SoCFPGA Arria 10
BOOT: SD/MMC External Transceiver (1.8V)
Model: Altera SOCFPGA Arria 10
DRAM: 1 GiB
Core: 78 devices, 20 uclasses, devicetree: separate
WDT: Started watchdog@ffd00300 with servicing every 1000ms (10s timeout)
MMC: dwmmc0@ff808000: 0
Loading Environment from MMC... Reading from MMC(0)... *** Warning - bad CRC, using default environmentIn: serial
Out: serial
Err: serial
Model: Altera SOCFPGA Arria 10
Net:
Warning: ethernet@ff800000 (eth0) using random MAC address - 22:6f:9a:64:64:fe
eth0: ethernet@ff800000
Hit any key to stop autoboot: 0
=>
=> load mmc 0:1 0x10000000 application.axf
258864 bytes read in 15 ms (16.5 MiB/s)
=> bootelf 0x10000000
=> go 0x00100040
## Starting application at 0x00100040 ...
INFO: Frequency = 300000000.
INFO: Period = 1500 millisecond(s).
INFO: Counter = 450000000.
RESULT: Example completed successfully.
Thank you for your reply Radu, I will wait for your reply after the vacation.
Followed your steps but still getting an error when launched from uboot and using ddr:
#########################################################
U-Boot 2021.04 (Sep 02 2021 - 08:43:37 +0000)socfpga_arria10
CPU: Altera SoCFPGA Arria 10
BOOT: SD/MMC External Transceiver (1.8V)
Model: Altera SOCFPGA Arria 10
DRAM: 1 GiB
WDT: Started with servicing (10s timeout)
MMC: dwmmc0@ff808000: 0
Loading Environment from MMC... *** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Model: Altera SOCFPGA Arria 10
Net:
Warning: ethernet@ff800000 (eth0) using random MAC address - aa:83:8f:08:35:6f
eth0: ethernet@ff800000
Hit any key to stop autoboot: 0
=> load mmc 0:1 0x10000000 application.axf
188384 bytes read in 11 ms (16.3 MiB/s)
=> bootelf 0x10000000
data abort
pc : [<3ffc82fc>] lr : [<3ffc832d>]
reloc pc : [<0103d33c>] lr : [<0103d36d>]
sp : 3bf82f48 ip : 00000010 fp : 00000002
r10: 00000002 r9 : 3bf88ed0 r8 : 00000000
r7 : 00000028 r6 : 00000002 r5 : 10000000 r4 : fc000046
r3 : 00000018 r2 : 00000000 r1 : 10000040 r0 : 10000040
Flags: Nzcv IRQs off FIQs off Mode SVC_32 (T)
Code: 6a2c 442c fb07 4406 (68a3) 079b
Resetting CPU ...
resetting ...
U-Boot SPL 2021.04 (Sep 02 2021 - 08:43:37 +0000)
#########################################################
But for me the real question is why the assembly looks like this when trying to program using DDR while in theory it has been already initialized by uboot:
#########################################################
lowlevel_init:
00100040: andeq r0, r0, r0
00100044: andeq r0, r0, r0
00100048: andeq r0, r0, r0
0010004c: andeq r0, r0, r0
00100050: andeq r0, r0, r0
00100054: andeq r0, r0, r0
00100058: andeq r0, r0, r0
0010005c: andeq r0, r0, r0
_socfpga_main:
00100060: andeq r0, r0, r0
00100064: andeq r0, r0, r0
___mainCRTStartup_from_arm:
00100068: andeq r0, r0, r0
0010006c: andeq r0, r0, r0
_start:
00100070: movs r0, r0
00100072: movs r0, r0
00100074: movs r0, r0
#########################################################
Do I need a different uboot img to launch baremetal applications without any linux inside?