Bare Metal App fails after some time
Hi,
So first some basic info:
DE0-Nano-SoC
Quartus 18.0
ARM DS-5 5.28.1 Ultimate Edition
I am trying to create a baremetal application, but I seem to be running into some issues. I had been using a rather complex baremetal app involving lwip, and I was not attempting to integrate the FPGA section of my code. However, upon doing that the app would seem to crash eventually regardless of what I was doing. So I decided to take a step back and try just the FPGA portion instead. I was starting with the AlteraSoCFPGA-HardwareLib-FPGA-CV-ARMCC example found included with the Altera EDS, however I ran into an issue with that where the debug script would not get past the uboot. It would get stuck in the spl.c file after the spl_boot_device() call it would go into the hang() call, but I can't find the actual spl_boot_device() function to see what the error is... So I thought I'd try swapping their uboot and .sof file with the one I'd eventually be using anyway. I changed the base address for the sysID call and it appears to work! then before letting the function return after completing and cleaning everything I had a simple
while(1) {
i++
}
And that would run for a little while, however it eventually breaks. It always seem to goes to addresses around 0x00000930-60 and just sit in an assembly loop. When pausing execution it only shows it in disassembly, not c code, and the stack just shows "no function name". Which was the same issue I had with the other project. Clearly I am missing some setup part with my FPGA side in my Quartus project. My BSP is set to boot from SDMCC, I don't have anything on my SD Card its un-formatted, but I didn't think I needed to do anything with it unless I was booting from it. Removing it altogether makes no difference. In the commands window upon pausing the app after crashing it states:
"Target Message: memory access caused precise abort.
Debug Precise Abort Registers : DFSR = 0x00000008, DFAR = 0xCee50000"
Its always pretty much the same, though sometimes its 0xCEED0000 instead of 0xCEE50000. I know 0xC0000000 onwards is HPS->FPGA memory space but I'm at a loss to what I am doing wrong. I'd appreciate any assistance thanks!