Altera_Forum
Honored Contributor
8 years agoNeed help with debugging HPS
I need help with debugging SoC because I've been stuck on this point for nearly a week.
In the past I worked extensively with FPGAs and microprocessors, so I have experience both in hw and sw. So far I always used FPGAs with soft processors like Nios, but now I want to move to SoC. Then I bought a Terasic DE0-Nano SoC board and I could successfully use it, following the main tutorials and examples. I can configure FPGA with my design and I could run a Linux or baremetal application in the HPS. The problem came when I tried to add hwlib to HPS in order to access the FPGA part. In the FPGA I use the ghrd reference design, with minor changes: I actually added only a bit of hdl code to blink a LED. In the HPS I'm trying to load the standard baremetal Hello-world ARMCC application. Following the procedures I found in Altera wiki, forum and on rocketboards.com I built the preloader from Qsys handoff files and tried to connect to hps for debugging. But I always get an error and the arm core seems to get stuck somewhere before reaching the breakpoint on spl_boot_device function, as defined in preloader.ds. I cannot get any output log from the jtag uart as well. I followed the advice in the sticky thread (https://alteraforum.com/forum/showthread.php?t=47099) and I found that when I can set the rstmgr registers to zero via JTAG I actually can access the Qsys peripherals (i.e. manually turn LEDs on and off). Anyway there are still two problems: - I say 'when I can set' because in most cases the rstmgr (and many other registers) show up as 'unavailable' in the debugger, so I can't modify them - even when I set the registers in the correct state and when hps can apparently access FPGA side, neither the preloader nor the application work. What concerns me is the fact the hps behaviour seems very unstable: starting with the board powered off and performing exactly the same steps, leads each time to a different result. For example one time all the hps registers are unavailable; the next try I can access them, set rstmgr and access the bridges and peripherals; sometimes I have situations where only SOME REGISTERS are available. I also point out another strange fact I can't explain: if I create a simple hello world application on the same ghrd FPGA configuration it works: I can see the 'Hello world' printout in the debugger console and afaik the hps always boots and run fine. If I add the hwlib includes to the project, even if I don't use any of them, I can get no more output from the console and the hps seems to hang like I described above. Thank you in advance for any advice