Reset on execution of bare-metal app after bootloader - DE10-Nano (Cyclone V)
Hardware: DE10-Nano demo board (Cyclone V)
IDE: Arm DS 2022.0
SoC EDS: 20.1 (Standard)
I'm developing a bare metal application for a Cyclone V. I am able to debug directly with no problems when using an on-chip RAM scatter file but I am having issues debugging from SDRAM. Using an SDRAM scatter file, I can debug without issue after first executing U-Boot from the factory SD card image. However, when I try the same with U-Boot built from the latest U-Boot release (2022.04), U-Boot reports an 'undefined instruction' and the processor resets when I begin debugging. Prior to the reset, U-Boot seems to function normally and I am able to execute commands from the terminal window. For reference, the DE10-Nano factory image uses U-Boot 2017.03-rc2.
I understand that the U-Boot build flow changed quite recently. My hunch is that something "under-the-hood" changed along this time that is causing my build of U-Boot to behave differently. The results are the same whether I use the DE10-Nano specific build config "socfpga_cyclone5_de10_nano" or the Cyclone V default build config "socfpga_cyclone5_defconfig" (the latter with DE10-Nano specific handoff data).
Here is a boot log from when I attempt to debug my bare-metal application after executing my build of the current release of U-Boot:
U-Boot SPL 2022.04-21230-gfcf317324c (Oct 14 2022 - 17:52:23 -0500)
U-Boot 2022.04-21230-gfcf317324c (Oct 14 2022 - 17:52:23 -0500)
CPU: Altera SoCFPGA Platform
FPGA: Altera Cyclone V, SE/A6 or SX/C6 or ST/D6, version 0x0
BOOT: SD/MMC Internal Transceiver (3.0V)
Watchdog enabled
DRAM: 1 GiB
Core: 21 devices, 12 uclasses, devicetree: separate
MMC: dwmmc0@ff704000: 0
Loading Environment from MMC... *** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Model: Terasic DE10-Nano
Net:
Error: ethernet@ff702000 address not set.
No ethernet found.
=> undefined instruction
pc : [<02000bae>] lr : [<0200005f>]
reloc pc : [<c307ebee>] lr : [<c307e09f>]
sp : 03ffffe8 ip : 3ffe5e08 fp : 02000bf8
r10: 02000bf8 r9 : 3bf7fed0 r8 : 00000000
r7 : 02000be7 r6 : 00000000 r5 : 00000000 r4 : 00000000
r3 : 00000000 r2 : 80000000 r1 : 02000d60 r0 : 02000c08
Flags: nZCv IRQs off FIQs off Mode SVC_32 (T)
Code: b2c0 1c53 604b 7010 (4770) eef1
Resetting CPU ...
resetting ...
Debugging my app causes the "undefined instruction" message to be displayed and the resulting reset.
This is what I see when running the DE10-Nano factory image SD card:
U-Boot 2017.03-rc2 (Mar 30 2017 - 19:07:16 -0700)
CPU: Altera SoCFPGA Platform
FPGA: Altera Cyclone V, SE/A6 or SX/C6 or ST/D6, version 0x0
BOOT: SD/MMC Internal Transceiver (3.0V)
Watchdog enabled
I2C: ready
DRAM: 1 GiB
MMC: dwmmc0@ff704000: 0
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Model: Terasic DE10-Nano
Net:
Error: ethernet@ff702000 address not set.
No ethernet found.
Hit any key to stop autoboot: 0
=>
When I start debugging my application no other characters are output and debugging works fine.
Any ideas? I'm stuck.
Thanks!
Brett