I am stuck in a problem since last week
Does anybody have a hint where can I find the header file that contains these declarations: UART_MAX_LEN, log_buf
Compiler is giving error about about UART_MAX_LEN undeclared, similarly log_buf, they both happen to appear in a function int_write in src/utils/alt_retarget_gnu.c.
I have used the linker script :"host_tools\mentor\gnu\arm\baremetal\arm-altera-eabi\lib\cycloneV-dk-ram-hosted.ld" to access some of the host's functionality to print.
My compiler output:
../src/utils/alt_retarget_gnu.c:88:20: error: 'UART_MAX_LEN' undeclared (first use in this function)
../src/utils/alt_retarget_gnu.c:88:20: note: each undeclared identifier is reported only once for each function it appears in
../src/utils/alt_retarget_gnu.c:93:14: error: 'log_buf' undeclared (first use in this function)
P.S. Project is attached with preloader for reproduction of error.
May I know which version of Quartus and SoC EDS software are you using?
Btw have you tried running a simple bare metal application on your board?
Here is the link to get you started:
I am using 16.0 Version (Quartus, NIOS II SBT, SoC EDS) on Windows. I have tried with latest version 18.1 on Ubuntu 18.04 and Windows as well. All of the them produces the same errors. I have again attached the compiler output screenshot.
I have tried running simple applications, and they are working but I have no clue what's is getting wrong in this project. I just want to setup an HPS and FPGA on Cyclone V DE1-SoC Board with following functions:
-->The HPS must be able to use the LED and button that are directly connected to the HPS PORTION of the device [DE1-SoC Board]. Pressing the button should toggle the LED.
-->The HPS must be able to access the LEDs connected to the FPGA PORTION of the device and will be responsible for creating a strobing light effect on the upper 5 LEDs.
The program is not so long but it uses the printf function. The linker Image file is set to use the "cycloneV-dk-ram-hosted.ld" to access some of the host's functionality to print on the console.
I will be thankful if you can elaborate the function of alt_retarget_gnu.c file. I am not able to find it in the documentation. What is really going wrong in the compilation process??
You may find the alt_retarget_gnu.c file here in your Quartus Installation file:
The C file contains minimal re target support to make printf function over UART for the GNU compiler.
Can you check your C file contains the UART_MAX_LEN, log_buf declarations?
I know where the UART_MAX_LEN and log_buf are used in the source file but my question is: HOW SHOULD I DECLARE THEM? I dont know the functionality of both of these. There is nothing written in the documentation about them. Could you elaborate a little bit or point me to the documentation where it is written. Thanks
I got the bare-metal application from here: https://github.com/sahandKashani/SoC-FPGA-Design-Guide/tree/master/DE1_SoC/DE1_SoC_demo.
I did following to include the HWlib in my project;
1- I used INCLUDE option of compiler to add the HPS HWlib HEADER FILES in my code.
2- I copied the HPS HWlib SOURCE FILES in my DS-5 project directory from altera/16.0/embedded/ip/altera/hps/altera_hps/hwlib/src.
Can you please describe how to add the HWlib to my project correctly?
Based on my knowledge, there should be some errors that mentioned some libraries are not included in the eclipse (DS-5)?
I think it displays at the bottom of the screen of the eclipse. Did you notice any errors there?
Even in our HWlibs examples that is in our installation folders (\embedded\examples\software) does sometimes report these missing libraries/headers, but they can be ignored. Because the files are added after running the application.
I suggest you could try our examples first to run a simple application and let me know if these examples results in the same error:
Examples at number 4.