I am trying to program the Nexys A7-100T. I am brand new to this. I am a computer engineering student, trying to get a head start for next Falls class in SoC Design. This is the same FPGA we are using. I am following the RVfpga tutorial from Imagination University. I am running the Blinky.s example. I followed all of the steps in the tutorial. When I build, I get these errors. I am unclear because I call defsym correctly. Below is my CMakeLists.txt file and the terminal output for the error.
I am on Windows 11 64bit. I am using VSCode with Catapult Studio SDK 2024, Ninja, CMake, Catapult Studio Extension. I am using the riscv64-img-elf-as ASM Compiler and Visual Studio C Compiler. Going into Catapult Studio Configure Platform, I can program the FPGA and make the 7-segment LEDs blink and the auto-on states turn off, so something is happening. I just cant get this example to build. This is the same errors I get on all of the examples. I am sure its some stupid little thing I am missing because this is new to me. I tried running this through chatGPT and it said to try -D instead of –defsym … I get the same error.
The Imagination University recommended reverting to an older verison of Catapult Studio SDK, but when I do that, it disables the VSCode extensions and there is no 1.9.1 or non-2024 version of Catapult Studio in VSCode.
Thanks!
TERMINAL OUTPUT
[main] Building folder: Blinky
[build] Starting build
[proc] Executing command: “C:Program Filesimgteccatapult-sdk_2024.1.0buildbincmake.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.042] Building ASM object CMakeFiles/Blinky.elf.dir/src/Blinky.S.obj
[build] FAILED: CMakeFiles/Blinky.elf.dir/src/Blinky.S.obj
[build] C:PROGRA~1imgtecCATAPU~1.0binRISCV6~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 -g -O0 -march=rv32im -mabi=ilp32 -O0 -g -march=rv32im_zicsr_zifencei -mabi=ilp32 –MD CMakeFilesBlinky.elf.dirsrcBlinky.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 Filesimgteccatapult-sdk_2024.1.0buildbincmake.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.079
[build] Build finished with exit code 1
CMakeLists.txt
cmake_minimum_required(VERSION 3.17)
project(Blinky LANGUAGES C ASM)
enable_language(ASM)
# Define sources here
set(SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/Blinky.S
)
# Define Program TARGET_NAME
set(TARGET_NAME Blinky.elf)
# Define the target executable
add_executable(${TARGET_NAME} ${SOURCES})
# Include common configurations
include(${CMAKE_CURRENT_SOURCE_DIR}/../../common/Common.cmake)
# Optionally, specify the assembler to use (if cross-compiling or not using the default assembler)
set(CMAKE_ASM_COMPILER "C:/Program Files/imgtec/catapult-sdk_2024.1.0/bin/riscv64-img-elf-as.exe")
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} --defsym CPU_FREQ=13000000 --defsym CUSTOM_UART=1 --defsym HAS_PRINTF=0 --defsym NO_SEMIHOSTING=1")
# Additional flags if needed
set_target_properties(${TARGET_NAME} PROPERTIES
COMPILE_FLAGS "-g -O0 -march=rv32im -mabi=ilp32"
)
I am new to this so I am looking for help. I used ChatGPT and tried basically everything it recommended, and it didn’t help.