Altera_Forum
Honored Contributor
10 years agoFPGA to HPS simple communication
Hello,
In advance, sorry for my english (it's not my mother tongue). I'm a beginner into qsys and linux (1 month). I have experience on microcontrollers without OS. I work on a DE1-Soc board (and also a SocKit). The OS used is the linux provided by terasic on their website. I am trying to make the HPS react to a communication initiated by the FPGA. The piece of information to send from the FPGA to the HPS should be around 200 bits ? I thougth about two ways to resolve this problem. 1. Use one of the two IRQ in the HPS IP. When arrived in the interrupt routine, read a reserved part of the FPGA sdram through the h2f_axi bridge (the FPGA put there the right data before sending the interrupt signal). 2. Use the f2h_axi bus to directly transfert the data. I began the first solution. I succeed in the h2_f_axi reading but I have big difficulties to understand how the interrupt works. I read a lot on this forum and on rocketboards.org but I think that I miss serious basis in embedded linux development. I saw that I have to modify the device tree file. I ran sopc2dts.exe (gui mode) on mysystem.sopcinfo. I understood that this device tree makes the correspondence between the hard and the soft. But I couldn't find any trace of "IRQ" or "interrupts = <0 40 1>;" in the dts generated file. There is my Qsys design in the attached file. (It's a test design, the components I developed have very simple behaviour) My interrupt sender simply makes the link between a Key of the board and the interrupt signal. But in the end it will be triggered from a finite state machine. Is there a tutorial with all the steps requiered to implement interrupt (from Qsys to C program) ? Is the interrupt way the simpliest way to achieve my goals (just having a FPGA to HPS communication that trigger a routine) ? I work on a Windows7 computer. As shown in the terasic tutorials, for the moment, I write my C programs in a text editor and compile with a makefile thanks to the "Embedded_command_shell" provided. (Is that a good way ? I saw a lot of people working on DS5) Can someone help me ? Thanks