UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor davidposs
Visitor
267 Views
Registered: ‎12-12-2018

'INTPTR undeclared' when building on Ultrascale

Hi, I have an existing C application that runs on a ZC706 that I am porting over to ultrascale. The ZC706 application was built in SDK 2016.4 and I am trying to build the Ultrascale version in 2018.2.


I created a new workspace, imported the new hardware specification and regenerated the BSP for Ultrascale. I then built the static libraries we used for support our application. However, when I build the application, I get the error:

//application source code
'INTPTR' undeclared (first use in this function); did you mean 'INT'?

So I checked to see that INTPTR was defined, which it is, in xil_types.h. It is defined as

//in xil_types.h
typedef intptr_t INTPTR;

xil_types.h is found in the psu_cortexr5_0/include directory, which my application has in its include paths.

I then noticed in xil_types.h that the SDK was warning of unresolved inclusions for stdint.h and stddef.h. I fixed this by adding
C:\Xilinx\SDK\2018.2\gnu\armr5\nt\gcc-arm-none-eabi\lib\gcc\arm-none-eabi\7.2.1\include
to the include path for the BSP. The BSP built fine before I added this path, so it could still find those files prior to adding that path. This just removed the warning.

I tried adding the same path to my application's compiler include paths, but I still got the same error with INTPTR being undeclared.

I also see warnings of implicit declarations of functions from string.h, like "memset", "memcpy" and "malloc". We don't include string.h in our source code, but we don't see any of these issues when building for ZC706.

 

For my build settings, I'm us the following options. I can provide more if necessary.

Assembler/Compiler/Linker: armr5-none-eabi-gcc
Tool Chain: Xilinx ARM R5 GNU Toolchain
Miscellaneous Compiler Options: -c -fmessage-length=0 -MT"$@" -mcpu=cortex-r5 -mfpu=vfpv3 -mfloat-abi=hard
Makefiles are generated automatically.

I've pretty much copied all of the build settings used for the ZC706 build, except modifying paths and commands for the Ultrascale where appropriate. 

 

Any ideas on how to fix this? I'll provide more information as necessary. Thanks for any help.

 

Tags (2)
0 Kudos
1 Reply
Moderator
Moderator
211 Views
Registered: ‎10-06-2016

Re: 'INTPTR undeclared' when building on Ultrascale

Hi @davidposs 

I would say you are doing something wrong in the flow but I guess we need bit more detailed information about the steps you followed. As an example the test I just peformed on my side.

1. Create a helloworld application project based on ZCU102 board.

image.png

2. Change the main.c code to use INTPTR type

#include <stdio.h>
#include "platform.h"
#include "xil_printf.h"

int main()
{
	int variable = 0;
	INTPTR pointer;

	pointer = &variable;
	*(int*)pointer = 10;

    return variable;
}

3. Build succesfully

 

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.
0 Kudos