Skip to content

Commit

Permalink
xilinx: rework error message for zynqXX in SPI_MODE
Browse files Browse the repository at this point in the history
  • Loading branch information
trabucayre committed Jun 1, 2023
1 parent 81e0e5c commit 1f5d6cb
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/xilinx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,21 @@ Xilinx::Xilinx(Jtag *jtag, const std::string &filename,
_fpga_family = SPARTAN7_FAMILY;
} else if (family == "zynq") {
_fpga_family = ZYNQ_FAMILY;
if (_mode != Device::MEM_MODE)
throw std::runtime_error("Error: can't flash Zynq7000");
if (_mode != Device::MEM_MODE) {
char mess[256];
snprintf(mess, 256, "Error: can't flash non-volatile memory for "
"Zynq7000 devices\n"
"\tSPI Flash access is only available from PS side\n");
throw std::runtime_error(mess);
}
} else if (family.substr(0, 6) == "zynqmp") {
if (_mode != Device::MEM_MODE)
throw std::runtime_error("Error: can't flash ZynqMP");
if (_mode != Device::MEM_MODE) {
char mess[256];
snprintf(mess, 256, "Error: can't flash non-volatile memory for "
"ZynqMP devices\n"
"\tSPI Flash access is only available from PSU side\n");
throw std::runtime_error(mess);
}
if (!zynqmp_init(family))
throw std::runtime_error("Error with ZynqMP init");
_fpga_family = ZYNQMP_FAMILY;
Expand Down

0 comments on commit 1f5d6cb

Please sign in to comment.