This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

compiler problem....somebody plz solve

i'm working on ARM7TDMI-S cored LPC2138 for which i'm using keil compiler. while programming i came to a strange situation which is as follows. i wrote many programes in keil cross-compiler they worked well and thanx to keil for giving nice software. but for few cases i got SWI inturrupt automatically even programme can't get out of startup instructions while i debug the programme and my programme couldn't go further. Later by changing the programme i solved the problem but i couldn't point out the reason for that problem.... Now again i'm facing the same problem can anyone explain me why the problem comes??

Parents
  • Yes, i have had similar problems when i switched from CARM to Realview. Could'nt solve them, so i use CARM again. I don't have time spending days and days and week's on this. Maybe you will find a solution, i really hope you will post it, so everybody can share it :-)

    Seems a library problem that some basic functions like printf or scanf use librarys which are not especially for your target-CPU. There is a RETARGET.C file, maybe it must be adapted for your target-CPU

    I wish you succes!

Reply
  • Yes, i have had similar problems when i switched from CARM to Realview. Could'nt solve them, so i use CARM again. I don't have time spending days and days and week's on this. Maybe you will find a solution, i really hope you will post it, so everybody can share it :-)

    Seems a library problem that some basic functions like printf or scanf use librarys which are not especially for your target-CPU. There is a RETARGET.C file, maybe it must be adapted for your target-CPU

    I wish you succes!

Children
  • This looks like a problem with retargeting. Are you using some file I/O functions or printf/scanf? Are you using a file with the name retraget.c in the RealView project?

  • i hope this code will help u for u'standing my problem.

    #include<stdio.h>
    #include<stdlib.h>
    main()
    { float *a;
    int i;
    float j=1.2;
    a=(float *)malloc(10*sizeof(*a));
    for(i=0;i<10;i++)
    { *(a+i)=j;
    j+=0.2;
    } }

  • Do you have a swi disable pragma in your retarget.c?
    #pragma import(__use_no_semihosting_swi)

    Have you setup the heap in the startup file? Default heap size is 0, so memory allocation functions would fail. Try with 4 K bytes for a start.

  • Thanks for your concerned reply.
    It is now some months ago that i stopped to try to get started with REALVIEW.
    To answer your question i think i've used printf, it's ideal for debugging, but i'm not so sure this time.

    I've just opened a new E-Mail-adress my_test_test_123@web.de especially for this purpose, as i hope someone will send me some helpful Files to help me getting Realview started.

    My CPU is a ADuC7026.
    I'm not sure which startup.s, which retaget.c i should have used.

    To tell the truth i have no idea what this files do, or what a heap is...

    Cincerly yours