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: 
Contributor
Contributor
8,084 Views
Registered: ‎10-07-2014

Not able to do thread programming on microblaze

Hi,

 

I'm trying to write a pthread creation and termination test program on microblaze (Petalinux OS) in SDK 2013.3.

I have attached my test program.

 

While building this program, I'm getting error:

 

"make all
Building file: ../src/main.c
Invoking: MicroBlaze gcc compiler
mb-gcc -Wall -O0 -g3 -c -fmessage-length=0 -I../../petalinux_bsp_0/microblaze_0/include -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mcpu=v8.50.c -mno-xl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"src/main.d" -MT"src/main.d" -o "src/main.o" "../src/main.c"
In file included from g:\xilinxise14_7\14.7\ise_ds\edk\gnu\microblaze\nt\bin\../lib/gcc/microblaze-xilinx-elf/4.6.4/../../../../microblaze-xilinx-elf/include/unistd.h:4:0,
                 from g:\xilinxise14_7\14.7\ise_ds\edk\gnu\microblaze\nt\bin\../lib/gcc/microblaze-xilinx-elf/4.6.4/../../../../microblaze-xilinx-elf/include/pthread.h:28,
                 from ../src/main.c:20:
g:\xilinxise14_7\14.7\ise_ds\edk\gnu\microblaze\nt\bin\../lib/gcc/microblaze-xilinx-elf/4.6.4/../../../../microblaze-xilinx-elf/include/sys/unistd.h:17:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
make: *** [src/main.o] Error 1"

 

[pthread.h ->(pointing to) unistd.h (unistd.txt) -> sys/unistd.h (sys_unistd.txt)]

 

Please find the attached files.

 

Kindly help.

 

Regards,

 

mayankara

 

 

0 Kudos
4 Replies
Contributor
Contributor
8,078 Views
Registered: ‎10-07-2014

Re: Not able to do thread programming on microblaze

Hi,

 

Little modification in the last line of above error:

 

error: expected '=', ',', ';', 'asm' or '__attribute__' before 'extern'
make: *** [src/main.o] Error 1"

 

Regards,

 

mayankara

0 Kudos
Scholar sampatd
Scholar
8,059 Views
Registered: ‎09-05-2011

Re: Not able to do thread programming on microblaze

Can you attach your SDK workspace here? I would like to take a look at it.
0 Kudos
Highlighted
Contributor
Contributor
8,049 Views
Registered: ‎10-07-2014

Re: Not able to do thread programming on microblaze

Hi sampatd,

 

PFA workspace.

 

Regards,

 

mayankara

0 Kudos
Scholar sampatd
Scholar
8,037 Views
Registered: ‎09-05-2011

Re: Not able to do thread programming on microblaze

I could not get this working since the .mss file was missing. Therefore, I could not determine the OS you were targetting.

If you want to execute your application on PetaLinux (assuming you use 2013.10 version since that is compatible with 2013.3 version of tool), you can simply target Linux as the OS platform in SDK and make the application.

If you want to embed the application into your rootfs, you can follow the guide below:
http://www.xilinx.com/support/documentation/sw_manuals/petalinux2013_10/ug981-petalinux-application-development-debug.pdf
0 Kudos