Can't execute an ARM Compiler 5/6 built image from Arria V SoC devkit SDRAM without debugger
Hi,
I try to build a bare metal app for the Arria V SoC devkit using Arm Compiler 6/5 (DS-5 built
in) and load it from the QSPI into the SDRAM (on the devkit without debugger).
The app is never executed. I followed several guides, All resulted with working preloader
that doesn't load the app:
1. Link:
2. asdf soc hands baremetal (attached)
3. guide found in this forum (attached)
1 | My Environment
- Windows 10
- SoC EDS 18.1.0.625
- DS-5 Ultimate Edition, Version: 5.29.1 (installed with SoC EDS)
- Quartus Prime 18.1 (including Quartus Prime Programmer)
2 | Example Projects
For comparison I used two example projects:
1. Altera-SoCFPGA-HardwareLib-Unhosted-AV-GNU
- Link: (attached to this post)
- Result: The built app is loaded successfully with debugger and without it (SoC only)
2. Altera-SoCFPGA-HardwareLib-Timer-AV-ARMCC
- Link: (attached to this post)
- Result: The app is loaded only when using debugger. I wish to load it without debugger.
3 |
1. I used the Arria V SoC GHRD handoff folder to build the preloader:
- Checked SDRAM scrub
- Unchecked watchdog interrupt and any boot device other than the QSPI
- Next image address is 0x60000)
I see the preloader UART prints.
I use the same preloader with both images (only the GCC built image is executed without debugger)
2. In both cases I flash the bare metal app into the QSPI starting from address 0x60000:
quartus_hps -c 1 -o PV -a 0x60000 [image_name].bin
3. I don’t know if its matters, but in project (2.1) the resulted ELF is converted to .bin
using objcopy. In project (2.2) its converted using fromelf.
In both cases I use the same mkimage command:
mkimage -A arm -T standalone -C none -a [SDRAM_START_ADDR] -e 0 -n "baremetal_image" -d [name].bin [image_name].bin
4. The [SDRAM_START_ADDR] is different in both projects. In (2.2) its provided in the
scatter file, in (2.1) its provided in the linker script.
I did noticed a comment in the GCC project (2.1) linker script:
MEMORY
{
boot_rom (rx) : ORIGIN = 0xfffd0000, LENGTH = 64K
oc_ram (rwx) : ORIGIN = 0xffff0000, LENGTH = 64K
/* Need to have 64bytes available before start of program, to store the mkimage header */
ram (rwx) : ORIGIN = 0x100000 + 0x40, LENGTH = 1023M - 0x40
}
"Need to have 64bytes available before start of program, to store the mkimage header"
I'm not sure this space exists in project (2.2) as well. Could this be the reason for my problem?
5. I looked at each project built ELF "Image entry point". In both cases it points to a
valid place (proj 2.1 – cs3_reset , proj 2.2 – alt_interrupt_vector). Both lead to main
So I don't know what is the specific difference causing the GCC project (2.1) built image to be loaded and work properly as opposed to the ARM project (2.2) built image.