+ Post New Thread
Results 1 to 3 of 3
  1. #1
    Member level 2
    Points: 1,312, Level: 8

    Join Date
    Apr 2013
    Posts
    49
    Helped
    0 / 0
    Points
    1,312
    Level
    8

    Not able to run Proteus Simulation after building project in CooCox

    Hello,

    I have made a project using Coocox for Single LED blink for lpc1343. I am new to ARM microcontroller programming.
    Code:
    #include 
    
    void delay(void);
    
    int main(void)
    {
    	LPC_GPIO0->DIR = (1<<7); //Config PIO0_7 as Output
    
    	while(1)
    	{
    		LPC_GPIO0->DATA = (1<<7); //Drive output HIGH to turn LED ON
    		// Better way would be LPC_GPIO0->DATA |= (1<<7);
    
    		delay();
    		LPC_GPIO0->DATA = 0x0; //Drive output LOW to turn LED OFF
    		// Better way would be LPC_GPIO0->DATA &= ~(1<<7);
    
    		delay();
    	}
    	//return 0; //normally this wont execute
    }
    
    void delay(void) //Hard-coded delay function
    {
    	int count,i=0;
    	for(count=0; count < 4500000; count++) //You can edit this as per your needs
    	{
    		i++; //something needs to be here else compiler will remove the for loop!
    	}
    }
    My Project files in Coocox

    Click image for larger version. 

Name:	project files.jpg 
Views:	3 
Size:	33.2 KB 
ID:	150514

    The circuit I have built in Proteus is

    Click image for larger version. 

Name:	proteus.jpg 
Views:	3 
Size:	233.2 KB 
ID:	150515

    I am using the latest gnu toolchain. The ELF file is created but the hex file is 0 KB. I have tried with both files. With the ELF file the error in proteus is [ELF] Unrecognized attribute form code 17 [U1_CM3CORE] [ELF] ELF file corrupt or loader error at location 131101 [U1_CM3CORE] and with hex file the error is error reading the file and that there is no colon at the first of line.

    Can anyone please help me? What am I doing wrong? Thanks and Regards, Shomik Chakraborty.

    •   AltAdvertisment

        
       

  2. #2
    Super Moderator
    Points: 252,835, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    44,050
    Helped
    13403 / 13403
    Points
    252,835
    Level
    100

    Re: Not able to run Proteus Simulation after building project in CooCox

    Getting empty hex file (and probably meaningless elf file as well) makes pretty clear that there's something wrong with your project settings, unlikely a Proteus problem.

    As a first step, I'd inspect the compiler and linker reports.

    - - - Updated - - -

    By the way, I presume it's much more fun to run your exercises on a cheap prototype board with hardware debug features.


    1 members found this post helpful.

    •   AltAdvertisment

        
       

  3. #3
    Member level 2
    Points: 1,312, Level: 8

    Join Date
    Apr 2013
    Posts
    49
    Helped
    0 / 0
    Points
    1,312
    Level
    8

    Re: Not able to run Proteus Simulation after building project in CooCox

    Thankyou Mr. FvM,

    I think you are absolutely right. There seems to be some problem with my project settings. I made the same project in Keil uvision and I got a hex file and ran it on Proteus.

    Now I am getting an error Internal exception: out of memory. I agree with your advice and I will try to get a board as soon as possible. Thanks and Regards, Shomik Chakraborty.

    - - - Updated - - -

    Hello, Can anyone please tell me how to solve the problem of error Internal exception: out of memory. What settings will I have to change in uvision to get the simulation in Proteus to work? Thanks and Regards, Shomik Chakraborty.



--[[ ]]--