Hello,
I am a new user. I am doing independent learning outside of college for my computer engineering degree. I got a Nexys A7 100T because I am very interested in SoC design and working with FPGAs. I got the RVfpga tutorial from here. I've only used Codeblocks, so I had to get VSCode, install all of the required compilers for C, ASM, do the environmental variable designations, etc, all of that. I can build the program and get no errors. then I get to the point of uploading an example to the FPGA. I am getting an error in the RVfpgaNexysEL2_DDR_debug.cfg file. Here is the terminal output after I "Program FPGA" through Catapult platform configuration.
* Executing task: openocd -f 'C:\Program Files\imgtec\catapult-sdk_2024.1.0\build\platform\RVfpga\RVfpgaNexysEL2_DDR_debug.cfg'
Open On-Chip Debugger 0.12.0 (2023-10-02) [ https://github.com/sysprogs/openocd ]
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
C:\Program Files\imgtec\catapult-sdk_2024.1.0\build\platform\RVfpga\RVfpgaNexysEL2_DDR_debug.cfg:23: Error: invalid command name "ram"
in procedure 'script'
at file "embedded:startup.tcl", line 28
at file "C:\Program Files\imgtec\catapult-sdk_2024.1.0\build\platform\RVfpga\RVfpgaNexysEL2_DDR_debug.cfg", line 23
* The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command openocd -f 'C:\Program Files\imgtec\catapult-sdk_2024.1.0\build\platform\RVfpga\RVfpgaNexysEL2_DDR_debug.cfg'" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
Looking at that .cfg file, its the first line with "ram", so its not recognizing that. From what I could gather, its a mismatch in OpenOCD versions. What version should I be using? I have the most recent, pretty sure. Or can someone help me out here? This .cfg file is from the tutorial.
Thank you
Hello,
I've just tried in my Windows machine (which from your message I understand that it's the OS you are using). I've had to reinstall the drivers using Zadig, as explained in Appendix A of the GSG. Can you try this? After reinstalling the drivers, I've been able to run the LedsSwitches program on my Nexys A7 board, using the EL2-DDR SoC.
Also, find attached the output I get in Catapult. The one called "Program" is the one I get when I program the FPGA, which you can see that uses the "RVfpga_program.cfg" script. The other one is called "Debug", which is the one I get when I debug the program on the board. Note that I'm using the same OpenOCD version as you. Can you review if you're following the exact steps described in Section 5.A of the GSG?
Let me know if you need more help.
Best regards
Dani
@dchaver I followed 5.A exactly, for Blinky as my initial code. I've been following the GSG exactly, but I started with Blinky example instead of AL_Operation. I get to Page 46, where you press "Program FPGA" and that is the error I get in the terminal.
Here is a screen shot of my Catapult Configure Platform tab.
I am on windows, using vscode, with all the required plugins and compilers. if that is important...
Ok. Later today I'll compare your Configure Platform tab with mine. I'll also test the version of Catapult which from your posts I see that you're using (v2024.1.0, right?). And I'll look carefully at the error that you're obtaining.
Meanwhile, could you please take a look at the videos showing the process to run a program in RVfpga and confirm if you're doing everything? Find the videos at: https://www.youtube.com/playlist?list=PLnOXj03cuJjn7ecksWZEwCe8LVR-PDgud
Thanks
Best regards
Hi again,
I've been testing Catapult v2024.1.2 in my Windows machine. I see that some things have changed with respect to v1.9.1 (the one referenced in the RVfpga v3.0 package). I've been able to make it work, but I've had to follow the instructions (such as definition of environment variables...) from the "CatapultSDK_2024.1.0_Documentation" provided with the Catapult package. Have you followed these steps?
I'm attaching some screenshots of my computer programming and debugging the FPGA.
Also, you could test v1.9.1 (install it from https://github.com/imgtec-riscv/catapult-sdk/releases/tag/v1.9.1) and see if this one works for you following the GSG instructions.
Let us know if you can resolve the problem and if you need more help.
Best regards
Dani
Thank you, this helped. I had an error in the environmental variables. I was able to have Program FPGA go through. The 7-segment displays blinked and then went solid 0s. I think the issue I have having is with how VSCode is setup. I am getting stuck here now. This is the output when I build the Blinky project:
[main] Building folder: Blinky[build] Starting build[proc] Executing command: chcp[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build c:/Users/pnevi/OneDrive/Desktop/COLLEGE/ECE540/RVfpga/RVfpgaEL2/RVfpga_NexysA7-DDR/examples/Blinky/build --config Debug --target Blinky.elf --[build] [1/2 50% :: 0.013] Building ASM object CMakeFiles\Blinky.elf.dir\src\Blinky.S.obj[build] FAILED: CMakeFiles/Blinky.elf.dir/src/Blinky.S.obj[build] C:\PROGRA~1\NASM\nasm.exe -DCPU_FREQ=13000000 -DCUSTOM_UART -DHAS_PRINTF=0 -DNO_SEMIHOSTING=1 -DPERIPH_H=\"RVfpgaNexys_periph.h\" -DPLATFORM_H=\"swerv_csr.h\" -DUART -IC:\Users\pnevi\OneDrive\Desktop\COLLEGE\ECE540\RVfpga\RVfpgaEL2\RVfpga_NexysA7-DDR\common -IC:\Users\pnevi\OneDrive\Desktop\COLLEGE\ECE540\RVfpga\RVfpgaEL2\RVfpga_NexysA7-DDR\common\ee_printf -IC:\Users\pnevi\OneDrive\Desktop\COLLEGE\ECE540\RVfpga\RVfpgaEL2\RVfpga_NexysA7-DDR\common\drivers\uart\RVfpga -I"C:\Program Files\imgtec\catapult-sdk_2024.1.0\build\platform\RVfpga" -IC:\Users\pnevi\OneDrive\Desktop\COLLEGE\ECE540\RVfpga\RVfpgaEL2\RVfpga_NexysA7-DDR\common\drivers\uart -IC:\Users\pnevi\OneDrive\Desktop\COLLEGE\ECE540\RVfpga\RVfpgaEL2\RVfpga_NexysA7-DDR\common\drivers\psp\api_inc -IC:\Users\pnevi\OneDrive\Desktop\COLLEGE\ECE540\RVfpga\RVfpgaEL2\RVfpga_NexysA7-DDR\common\drivers\bsp -O0 -g -march=rv32im_zicsr_zifencei -mabi=ilp32 -o CMakeFiles\Blinky.elf.dir\src\Blinky.S.obj -c C:\Users\pnevi\OneDrive\Desktop\COLLEGE\ECE540\RVfpga\RVfpgaEL2\RVfpga_NexysA7-DDR\examples\Blinky\src\Blinky.S[build] nasm: error: unrecognised option `-m'[build] nasm: error: unrecognised option `-m'[build] nasm: error: unrecognised option `-c'[build] ninja: build stopped: subcommand failed.[proc] The command: "C:\Program Files\CMake\bin\cmake.EXE" --build c:/Users/pnevi/OneDrive/Desktop/COLLEGE/ECE540/RVfpga/RVfpgaEL2/RVfpga_NexysA7-DDR/examples/Blinky/build --config Debug --target Blinky.elf -- exited with code: 1[driver] Build completed: 00:00:00.075[build] Build finished with exit code 1
I tried editing it a 2nd time but it seems it didnt save it and now it wont let me edit it again: Here is the addition:
This is the output from doing Program FPGA, to verify:
* Executing task: openocd -c 'set BITFILE c:/Users/pnevi/OneDrive/Desktop/COLLEGE/ECE540/RVfpga/RVfpgaEL2/RVfpga_NexysA7-DDR/src/rvfpganexys.bit' -f 'C:\Program Files\imgtec\catapult-sdk_2024.1.0\build\platform\RVfpga\RVfpga_program.cfg'
Open On-Chip Debugger 0.12.0+dev-00003-ge3e4427e8 (2024-02-25-10:05)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
c:/Users/pnevi/OneDrive/Desktop/COLLEGE/ECE540/RVfpga/RVfpgaEL2/RVfpga_NexysA7-DDR/src/rvfpganexys.bit
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi tdo_sample_edge falling"
Info : clock speed 10000 kHz
Info : JTAG tap: xc7.tap tap/device found: 0x13631093 (mfg: 0x049 (Xilinx), part: 0x3631, ver: 0x1)
Warn : gdb services need one or more targets defined
shutdown command invoked
* Terminal will be reused by tasks, press any key to close it.
This is the terminal output when I launch VSCode - and why I think its a NASM-ASM compiler issue. Like i said, the online searches and chatgpt, says i need the risc-v asm compiler.
[proc] Executing command: cmake --version[proc] Executing command: cmake -E capabilities[variant] Loaded new set of variants[kit] Successfully loaded 9 kits from C:\Users\pnevi\AppData\Local\CMakeTools\cmake-tools-kits.json[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --version[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" -E capabilities[main] Configuring project: Blinky[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE "-DCMAKE_TOOLCHAIN_FILE:FILEPATH=C:\Program Files\imgtec\catapult-sdk_2024.1.0\build\riscv-toolchain-gcc-elf.cmake" -SC:/Users/pnevi/OneDrive/Desktop/COLLEGE/ECE540/RVfpga/RVfpgaEL2/RVfpga_NexysA7-DDR/examples/Blinky -Bc:/Users/pnevi/OneDrive/Desktop/COLLEGE/ECE540/RVfpga/RVfpgaEL2/RVfpga_NexysA7-DDR/examples/Blinky/build -G Ninja[cmake] Not searching for unused variables given on the command line.[cmake] -- Warning: Did not find file Compiler/NASM-ASM[cmake] Print through UART[cmake] -- Configuring done (0.1s)[cmake] -- Generating done (0.0s)[cmake] -- Build files have been written to: C:/Users/pnevi/OneDrive/Desktop/COLLEGE/ECE540/RVfpga/RVfpgaEL2/RVfpga_NexysA7-DDR/examples/Blinky/build
Hi @dawgburt,
I'm also having problems with the new Catapult versions (v2024.X.X) in Windows. My suspicion is that they are related with missing environment variables, but I have to look at them in more detail.
Meanwhile, my suggestion would be that you install a previous Catapult version (v1.X.X, such as v1.10.0), available at: https://github.com/imgtec-riscv/catapult-sdk/releases . Any of these versions should work correctly.
Let us know about your progress.
Best regards
Dani
I re-installed the v2024 SDK and I got the RISC-V compiler to be triggered instead of NASM. Now I am getting a build fatal error saying bad defsym format from the assembler. here is the terminal output
[main] Building folder: Blinky[build] Starting build[proc] Executing command: chcp[proc] Executing command: "C:\Program Files\imgtec\catapult-sdk_2024.1.0\build\bin\cmake.EXE" --build c:/Users/pnevi/OneDrive/Desktop/COLLEGE/ECE540/RVfpga/RVfpgaEL2/RVfpga_NexysA7-DDR/examples/Blinky/build --config Debug --target Blinky.elf --[build] [1/2 50% :: 0.045] Building ASM object CMakeFiles/Blinky.elf.dir/src/Blinky.S.obj[build] FAILED: CMakeFiles/Blinky.elf.dir/src/Blinky.S.obj[build] C:\PROGRA~1\imgtec\CATAPU~1.0\build\..\bin\RISCV6~3.EXE --defsym CPU_FREQ=13000000 --defsym CUSTOM_UART --defsym HAS_PRINTF=0 --defsym NO_SEMIHOSTING=1 --defsym PERIPH_H=\"RVfpgaNexys_periph.h\" --defsym PLATFORM_H=\"swerv_csr.h\" --defsym UART -IC:/Users/pnevi/OneDrive/Desktop/COLLEGE/ECE540/RVfpga/RVfpgaEL2/RVfpga_NexysA7-DDR/common -IC:/Users/pnevi/OneDrive/Desktop/COLLEGE/ECE540/RVfpga/RVfpgaEL2/RVfpga_NexysA7-DDR/common/ee_printf -IC:/Users/pnevi/OneDrive/Desktop/COLLEGE/ECE540/RVfpga/RVfpgaEL2/RVfpga_NexysA7-DDR/common/drivers/uart/RVfpga -I"C:/Program Files/imgtec/catapult-sdk_2024.1.0/build/platform/RVfpga" -IC:/Users/pnevi/OneDrive/Desktop/COLLEGE/ECE540/RVfpga/RVfpgaEL2/RVfpga_NexysA7-DDR/common/drivers/uart -IC:/Users/pnevi/OneDrive/Desktop/COLLEGE/ECE540/RVfpga/RVfpgaEL2/RVfpga_NexysA7-DDR/common/drivers/psp/api_inc -IC:/Users/pnevi/OneDrive/Desktop/COLLEGE/ECE540/RVfpga/RVfpgaEL2/RVfpga_NexysA7-DDR/common/drivers/bsp --defsym CPU_FREQ=13000000 --defsym CUSTOM_UART=1 --defsym HAS_PRINTF=0 --defsym NO_SEMIHOSTING=1 -g -O0 -g -march=rv32im_zicsr_zifencei -mabi=ilp32 --MD CMakeFiles\Blinky.elf.dir\src\Blinky.S.obj.d -o CMakeFiles/Blinky.elf.dir/src/Blinky.S.obj -c C:/Users/pnevi/OneDrive/Desktop/COLLEGE/ECE540/RVfpga/RVfpgaEL2/RVfpga_NexysA7-DDR/examples/Blinky/src/Blinky.S[build] Assembler messages:[build] Fatal error: bad defsym; format is --defsym name=value[build] ninja: build stopped: subcommand failed.[proc] The command: "C:\Program Files\imgtec\catapult-sdk_2024.1.0\build\bin\cmake.EXE" --build c:/Users/pnevi/OneDrive/Desktop/COLLEGE/ECE540/RVfpga/RVfpgaEL2/RVfpga_NexysA7-DDR/examples/Blinky/build --config Debug --target Blinky.elf -- exited with code: 1[driver] Build completed: 00:00:00.168[build] Build finished with exit code 1
Hi,
Thanks, I'll take this new information into account when reviewing the latest Catapult versions. Besides, let me insist that I think that using an older Catapult version (such as v1.10.0 from https://github.com/imgtec-riscv/catapult-sdk/releases ) would resolve your problems, so I think that would be the most recommendable option at this moment.
Best regards
@dchaver also, switching to an older version causes VSCode to turn off Catapult Studio Extension and breaks everything. I am getting the same defsym build error
@dawgburt that's strange. I've just tried my Catapult v1.9.1 in my Windows computer and it's worked.
Note that versions v1.X.X do not install Catapult as an extension inside VSCode but like an independent application:
Can you find that in your system?
Can you try it again by following the exact GSG steps, after removing the new environment variables created for Catapult v2024 and even the whole v2024 extension?
Can you give me more details and screenshots about the new problems?
Best regards
Dani
@dchaver I did this and it fixed the problem! I re-downloaded the RVFPGA folder to reset all the example files encase i messed something up, removed environmental variables, uninstalled v2024 (Which does NOT have a .exe like 1.9.1 does. If you switch to 1.9.1 and try to use VSCode, it says its out of date. Only v2024s are available on VSCode), installed 1.9.1 and actually got a .exe for catapult studio this time.
Thank you so much!