I'm currently trying to deploy an application (simple c program) to the Zynq ZedBoard. I followed the Rocket Chip on Zynq FPGAs github page to generate all the necessary files, put them on a SD card and boot PetaLinux.
In the tutorial, a pre-packed hello application can be executed after booting
root@zynq:~# ./fesvr-zynq pk hello
hello!
I successfully managed to get to this point. However, i'm wondering how i can deploy my own c code to an executable that will appear in the internal filesystem like the hello one above.
Thanks @user3528438 for giving me the right hint. I'm writing this for future reference.
I was able to deploy and execute my own C application by doing the following:
Write my own C code i want to execute on the Rocket Chip.
Compile the code for the riscv architecture and generate executable. This requires the riscv toolchain to be installed of course!
Copy the generated myhello executable on your sd card that you insert in the ZedBoard.
Turn on the ZedBoard and login.
Mount the sd card to be able to access your myhello executable.
Change to the /sdcard directory and copy your executable to the /home/root directory. (This is where you find the standard hello executable)
Switch back to the /home/root directory and execute your myhello file on the Rocket Chip via the frontend-server!
This prints the expected output to the console.