Intel® SoC FPGA Embedded Development Suite
Support for SoC FPGA Software Development, SoC FPGA HPS Architecture, HPS SoC Boot and Configuration, Operating Systems
445 Discussions

Declarations for UART_MAX_LEN and log_buf (Cyclone V) missing while compiling

AJama4
Beginner
1,616 Views

Hello Folks,

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.

0 Kudos
11 Replies
EBERLAZARE_I_Intel
1,302 Views

Hi,

 

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:

https://www.intel.com/content/www/us/en/programmable/documentation/lro1424280108409.html

 

0 Kudos
AJama4
Beginner
1,302 Views

Hi,

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??

0 Kudos
EBERLAZARE_I_Intel
1,302 Views

Hi,

 

You may find the alt_retarget_gnu.c file here in your Quartus Installation file:

"\intelFPGA\18.1\embedded\ip\altera\hps\altera_hps\hwlib\src\utils"

 

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?

 

Regards.

0 Kudos
AJama4
Beginner
1,302 Views

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

 

0 Kudos
MscMechatronics
1,270 Views

Dear Sir/Madam, where you able to solve it? I'm facing the same very problem with UART_MAX_LEN not being declared.

0 Kudos
AJama4
Beginner
1,302 Views

Is there anyone from Intel to answer my query? I am stuck in it since a month.

0 Kudos
EBERLAZARE_I_Intel
1,302 Views

Hi,

 

May I know where did you get the De1-soc bare metal application from? And which HWlib are you using?

 

I have checked your hps folder, it seems that it is missing some header files, e.g hwlib.h which is included in alt_retarget_gnu.c.

 

0 Kudos
AJama4
Beginner
1,302 Views

You can take a look at my header files folder, it contains hwlib.h as well;

 

0 Kudos
AJama4
Beginner
1,302 Views

Hello,

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?

0 Kudos
EBERLAZARE_I_Intel
1,302 Views

Hi,

 

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:

https://www.intel.com/content/www/us/en/programmable/support/support-resources/design-guidance/bare-metal-developer.html

 

Examples at number 4.

0 Kudos
EBERLAZARE_I_Intel
1,302 Views

Hi,

 

If you have encounter any issue in our examples, let me know.

 

Regards.

0 Kudos
Reply