Forum Discussion
Altera_Forum
Honored Contributor
12 years ago --- Quote Start --- You should be able to loan the HPS pins to the FPGA. Go to the Hard Processor Configuration page in your Qsys module. In the 'Peripheral Pin Multiplexing' tab, there is a Peripherals Mux Table at the bottom. There you can select HPS pins to act either as a GPIO or be loaned to the FPGA. Click on the LoanIO buttons of the UART pins. Don't forget to disable the corresponding UART controller, or else it will complain about conflicts. Click 'Finish'. Back in the Qsys project, the HPS entry should now have a new 'h2f_loan_io' conduit. Double-click to export the signals. Re-generate the system. If you look at the HDL example, you'll notice a few new signals. For example, if I loaned IO20: .hps_io_hps_io_gpio_inst_LOANIO20 <-- Connect to top level inout pin .loan_io_in <-- Connect to FPGA logic .loan_io_out <-- Connect to FPGA logic .loan_io_oe <-- Connect to FPGA logic All of the "loan_io_x" signals are the size of the maximum IO pins. For example, the Cyclone V these are [66:0]. The loan_io_oe controls whether the pin is an output. If '1' at the specified location (in this case loan_io_oe[20] = 1'b1), then it is an output, and you can control the pin writing to loan_io_out[20]. To read an input to the FPGA, just read loan_io_in[20], and set loan_io_oe[20] to 0. Hope this helps. --- Quote End --- Thanks for your reply. This is very helpful, but I still have a couple of questions if you don't mind. I've made the Qsys system which only has the HPS module and I've exported all HPS ports. This way I can instantiate the HPS in my VHDL code and connect all I/O's, clock and reset myself. I've then succesfully built the whole design, but my question is now, how do I program the HPS such that it gets configured with the Qsys configuration that I made? I can see that there is a "handoff" folder which should contain the files needed to make a new BSP. I made the BSP and got a preloader bin file, but I'm not sure what to do from here?! Can I program the HPS directly or do I need to program either the QSPI or put the BIN on a SD card and use bootsel to select either one? If I need to e.g. program the QSPI and use bootsel to select that the HPS needs to boot from QSPI, do I then need to have enabled QSPI inside the HPS in Qsys and mapped the I/O pins ?? And how do I actually program the QSPI? Is there a tool like the Quartus Programmer or some CLI command? Thanks :-)
VROGE2
Occasional Contributor
6 years agoHi,
I know this post is several years old but I am trying to follow it to use LoanIO to communicate with the UART on my DE10-nano SoC.
I have been trying to use the handoff folder to make a new BSP but I am having trouble doing so. Could you go into more detail on how you did that and if NIOS II Eclipse will work for this.
Van