I'm using:
- bladerf-micro-A9-hosted
- Ubuntu 22.04.3 LTS
- Quartus 22.1 lite
- Terasic USB blaster
I'm trying to debug the NIOS C code using gdb. As reported in the ...hdl/fpga/platform/common/README.md file:
So, I changed the compiler optimization from -OS to -O0, as recommended. When I try to compile, the compiler complains about a couple of C lines but they can be temporarily commented out. After that, it states that the available memory is not enough (as from the README). Again. according to the readme:Another common occurence when debugging is finding out that a variable has been optimized out and its value is not printable. The best way to get around this is to reduce the level of compiler optimization.
Therefore, I changed the RAM size (platform.conf, line 42) from:Open $BLADERF_DIR/hdl/fpga/platforms/<platform>/build/platform.conf
Find the get_qsys_ram function, and change the return value to be the nearest power of 2 larger than the required memory size from the above. Sometimes simply doubling the existing return value is good enough.
Rebuild the FPGA in its entirety. This is required because the FPGA needs to instantiate more block RAMs to fit the larger Nios, and it will need to re-fit the surrounding logic.
Code: Select all
rams=131072
Code: Select all
rams=262144
Code: Select all
2023.12.19.17:45:22 Error: nios_system.nios2.data_master: <b>ram.s1</b> cannot be at 0x20000 (0x0 or 0x40000 are acceptable)
2023.12.19.17:45:22 Error: nios_system.nios2.instruction_master: <b>ram.s1</b> cannot be at 0x20000 (0x0 or 0x40000 are acceptable)
I can download the new image on the FPGA, but unfortunately, I cannot manage to run the JTAG for any task related to the NIOS with the new image. In particular, I cannot download the .elf file:
Code: Select all
Info: Downloading ../../../../../quartus/work/bladerf-micro-A9-hosted/bladeRF_nios/bladeRF_nios.elf
nios2-download: Searching for JTAG Node Instance for nios2 in ../../../../../quartus/work/bladerf-micro-A9-hosted/output_files/hosted.jdi
Using cable "USB-Blaster [1-10.1]", device 1, instance 0x00
Pausing target processor: not responding.
Resetting and trying again: FAILED
Leaving target processor paused
make: *** [../../../common/bladerf/software/bladeRF_nios/Makefile:1002: download-elf] Error 4
Code: Select all
Using cable "USB-Blaster [1-10.1]", device 1, instance 0x00
Pausing target processor: not responding.
Resetting and trying again: FAILED
Leaving target processor paused
The JTAG and all the rest work smoothly when I switch back to the original settings and I run again the same procedure.
Any idea about the cause of this issue?
Thanks!