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: 
Visitor 08690717
Visitor
5,792 Views
Registered: ‎05-20-2011

Problem with compilation of my C project ( leds.c) in SDK

HI,

I have created my custom IP pwm_lights with CIP wizard. I have used the tests drives of the guide EDK Concepts, Tools, and Techniques in the edk_ctt.pdf. In SDK i have created a new Xilinx C project and i have used the leds.c file from the Zip ( edk_ctt.zip ) file that accompanies this guide in the stage of Exporting the Design and Generating a New Bitstream.

 

When i compile the project leds.c, the compile fails and i have this in the console:

 

**** Build of configuration Debug for project hello_world_0 ****

 

make all

Building file: ../src/leds.c

Invoking: MicroBlaze gcc compiler

mb-gcc -Wall -O0 -g3 -c -fmessage-length=0 -I../../hello_world_bsp_0/microblaze_0/include -mxl-barrel-shift -mxl-pattern-compare -mcpu=v8.00.a -mno-xl-soft-mul -MMD -MP -MF"src/leds.d" -MT"src/leds.d" -o"src/leds.o" "../src/leds.c"

cygwin warning:

MS-DOS style path detected: C:\Users\ridha\Desktop\test_ISE_10_05\SDK_New_Workspace\hello_world_0\Debug

Preferred POSIX equivalent is: /cygdrive/c/Users/ridha/Desktop/test_ISE_10_05/SDK_New_Workspace/hello_world_0/Debug

CYGWIN environment variable option "nodosfilewarning" turns off this warning.

Consult the user's guide for more details about POSIX paths:

http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

../src/leds.c: In function ‘main’:

../src/leds.c:47: warning: implicit declaration of function ‘XUartLite_RecvByte’

../src/leds.c:54: warning: assignment makes pointer from integer without a cast

../src/leds.c:68: warning: assignment makes pointer from integer without a cast

../src/leds.c:73: warning: assignment makes pointer from integer without a cast

../src/leds.c:78: warning: assignment makes pointer from integer without a cast

../src/leds.c:83: warning: assignment makes pointer from integer without a cast

../src/leds.c:88: warning: assignment makes pointer from integer without a cast

../src/leds.c:101: warning: assignment makes pointer from integer without a cast

Finished building: ../src/leds.c

 

Building target: hello_world_0.elf

Invoking: MicroBlaze gcc linker

mb-gcc -Wl,-T -Wl,../src/lscript.ld -L../../hello_world_bsp_0/microblaze_0/lib -mxl-barrel-shift -mxl-pattern-compare -mcpu=v8.00.a -mno-xl-soft-mul -o"hello_world_0.elf" ./src/leds.o

/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/../../../../microblaze-xilinx-elf/bin/ld: region dlmb_cntlr_ilmb_cntlr is full (hello_world_0.elf section .text)

/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/../../../../microblaze-xilinx-elf/bin/ld: section .init [00000050 -> 00000077] overlaps section .text [00000050 -> 00010cd3]

/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/../../../../microblaze-xilinx-elf/bin/ld: section .fini [00000078 -> 00000097] overlaps section .text [00000050 -> 00010cd3]

/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/../../../../microblaze-xilinx-elf/bin/ld: section .rodata [00000098 -> 0000121b] overlaps section .text [00000050 -> 00010cd3]

/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/../../../../microblaze-xilinx-elf/bin/ld: section .sdata2 [0000121c -> 0000121f] overlaps section .text [00000050 -> 00010cd3]

/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/../../../../microblaze-xilinx-elf/bin/ld: section .data [00001220 -> 0000176b] overlaps section .text [00000050 -> 00010cd3]

/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/../../../../microblaze-xilinx-elf/bin/ld: section .ctors [0000176c -> 00001773] overlaps section .text [00000050 -> 00010cd3]

/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/../../../../microblaze-xilinx-elf/bin/ld: section .dtors [00001774 -> 0000177b] overlaps section .text [00000050 -> 00010cd3]

/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/../../../../microblaze-xilinx-elf/bin/ld: section .eh_frame [0000177c -> 0000177f] overlaps section .text [00000050 -> 00010cd3]

/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/../../../../microblaze-xilinx-elf/bin/ld: section .jcr [00001780 -> 00001783] overlaps section .text [00000050 -> 00010cd3]

/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/../../../../microblaze-xilinx-elf/bin/ld: section .bss [00001788 -> 000017f3] overlaps section .text [00000050 -> 00010cd3]

/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/../../../../microblaze-xilinx-elf/bin/ld: section .heap [000017f4 -> 00001bf7] overlaps section .text [00000050 -> 00010cd3]

/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/../../../../microblaze-xilinx-elf/bin/ld: section .stack [00001bf8 -> 00001ff7] overlaps section .text [00000050 -> 00010cd3]

/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/../../../../microblaze-xilinx-elf/bin/ld: region dlmb_cntlr_ilmb_cntlr is full (hello_world_0.elf section .text)

/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/../../../../microblaze-xilinx-elf/bin/ld: hello_world_0.elf: section .text lma 0x50 overlaps previous sections

/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/../../../../microblaze-xilinx-elf/bin/ld: hello_world_0.elf: section .fini lma 0x78 overlaps previous sections

/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/../../../../microblaze-xilinx-elf/bin/ld: hello_world_0.elf: section .rodata lma 0x98 overlaps previous sections

/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/bs/m/crtend.o:smileysad:.init+0x0): relocation truncated to fit: R_MICROBLAZE_32_PCREL_LO against `.text'

collect2: ld returned 1 exit status

make: *** [hello_world_0.elf] Error 1

 

I don't find where are the error .

 

Can anyone help please?

Tags (1)
0 Kudos
3 Replies
Teacher rcingham
Teacher
5,784 Views
Registered: ‎09-09-2010

Re: Problem with compilation of my C project ( leds.c) in SDK

My guess it that the first linker message is key:
"/cygdrive/c/Xilinx/12.3/ISE_DS/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.2/../../../../microblaze-xilinx-elf/bin/ld: region dlmb_cntlr_ilmb_cntlr is full (hello_world_0.elf section .text)"

Your .text section is too small for your code. Increase it (it gets defined in the linker script, which can be written by the GUI). Or else write a smaller program!

------------------------------------------
"If it don't work in simulation, it won't work on the board."
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
5,721 Views
Registered: ‎08-01-2007

Re: Problem with compilation of my C project ( leds.c) in SDK

You can regenerate your linker script and pick a larger memory region to accommodate your code.

0 Kudos
Visitor 08690717
Visitor
5,706 Views
Registered: ‎05-20-2011

Re: Problem with compilation of my C project ( leds.c) in SDK

Hi,
thank you for all that replay for my message and it worked well but now i have other problem, i have connected my custom IP to the MicroBlaze using the Fast Simplex Link (FSL) channel and in SDK i have created a new Xilinx C project test_fsl.c :
/*
 * test_fsl.c
 *
 *  Created on: 1 juil. 2011
 *      Author: ridha
 */

/*****************************************************************************
* Filename:          C:\Users\ridha\Desktop\test_fsl_0107\test_fsl\test_fsl_ridha\drivers/ridha0107_v1_00_a/examples/ridha0107_v2_1_0_app.c
* Version:           1.00.a
* Description:       ridha0107 (new FSL core) Driver Example File
* Date:              Fri Jul 01 11:59:33 2011 (by Create and Import Peripheral Wizard)
*****************************************************************************/


#include "xutil.h"
#include "stdlib.h"


#include "ridha0107.h"

#include "xparameters.h"
#include "stdio.h"

/*
* Follwing is an example driver function
* that is called in the main function.
*
* This example driver writes all the data in the input arguments
* into the input FSL bus through blocking writes. FSL peripheral will
* automatically read from the FSL bus. Once all the inputs
* have been written, the output from the FSL peripheral is read
* into output arguments through blocking reads.
*
* CAUTION:
*
* The sequence of writes and reads in this function should be consistent
* with the sequence of reads or writes in the HDL implementation of this
* coprocessor.
*
*/
// Instance name specific MACROs. Defined for each instance of the peripheral.
#define WRITE_RIDHA0107_0(val)  write_into_fsl(val, XPAR_FSL_RIDHA0107_0_INPUT_SLOT_ID)
#define READ_RIDHA0107_0(val)  read_from_fsl(val, XPAR_FSL_RIDHA0107_0_OUTPUT_SLOT_ID)

void ridha0107_app(
       unsigned int* input_0,      /* Array size = 1 */
       unsigned int* output_0       /* Array size = 1 */
       )
{
   int i;

   //Start writing into the FSL bus
   for (i=0; i<1; i++)
   {
      WRITE_RIDHA0107_0(input_0[i]);
   }

   //Start reading from the FSL bus
   for (i=0; i<1; i++)
   {
      READ_RIDHA0107_0(output_0[i]);
   }
}

main()
{
     unsigned int input_0[1];
     unsigned int output_0[1];


#ifdef __PPC__
     // Enable APU for PowerPC.
     unsigned int msr_i;
     msr_i = mfmsr();
     msr_i = (msr_i | XREG_MSR_APU_AVAILABLE | XREG_MSR_APU_ENABLE) & ~XREG_MSR_USER_MODE;
     mtmsr(msr_i);
#endif

     //Initialize your input data over here:
     input_0[0] = 12345;

     //Call the macro with instance specific slot IDs
     ridha0107(
         XPAR_FSL_RIDHA0107_0_INPUT_SLOT_ID,
         XPAR_FSL_RIDHA0107_0_OUTPUT_SLOT_ID,
         input_0,
         output_0
         );

     // You can also define your own function to access the peripheral
     // Here you are calling the example function defined above
     // Note the slot ID can not be passed over as function parameters
     ridha0107_app(
         input_0,
         output_0
         );

}

When i compile the project test_fsl.c, the compile fails and i have this in the console:

 


**** Build of configuration Debug for project hello_world_0 ****

make all
Building file: ../test_fsl.c
Invoking: MicroBlaze gcc compiler
mb-gcc -Wall -O0 -g3 -c -fmessage-length=0 -I../../hello_world_bsp_0/microblaze_0/include -mxl-barrel-shift -mxl-pattern-compare -mcpu=v8.00.a -mno-xl-soft-mul -MMD -MP -MF"test_fsl.d" -MT"test_fsl.d" -o"test_fsl.o" "../test_fsl.c"
../test_fsl.c:67: warning: return type defaults to ‘int’
../test_fsl.c: In function ‘main’:
../test_fsl.c:99: warning: control reaches end of non-void function
/cygdrive/c/Users/ridha/AppData/Local/Temp/ccnwczxB.s: Assembler messages:
/cygdrive/c/Users/ridha/AppData/Local/Temp/ccnwczxB.s:3427: Error: register expected, but saw 'rfslXP'
/cygdrive/c/Users/ridha/AppData/Local/Temp/ccnwczxB.s:3427: Warning: ignoring operands: rfslXPAR_FSL_RIDHA0107_0_INPUT_SLOT_ID
/cygdrive/c/Users/ridha/AppData/Local/Temp/ccnwczxB.s:3447: Error: register expected, but saw 'rfslXP'
/cygdrive/c/Users/ridha/AppData/Local/Temp/ccnwczxB.s:3447: Warning: ignoring operands: rfslXPAR_FSL_RIDHA0107_0_OUTPUT_SLOT_ID
/cygdrive/c/Users/ridha/AppData/Local/Temp/ccnwczxB.s:3500: Error: register expected, but saw 'rfslXP'
/cygdrive/c/Users/ridha/AppData/Local/Temp/ccnwczxB.s:3500: Warning: ignoring operands: rfslXPAR_FSL_RIDHA0107_0_INPUT_SLOT_ID
/cygdrive/c/Users/ridha/AppData/Local/Temp/ccnwczxB.s:3513: Error: register expected, but saw 'rfslXP'
/cygdrive/c/Users/ridha/AppData/Local/Temp/ccnwczxB.s:3513: Warning: ignoring operands: rfslXPAR_FSL_RIDHA0107_0_OUTPUT_SLOT_ID
make: *** [test_fsl.o] Error 1



I don't find where are the error .

 

Can anyone help please?


 


0 Kudos