This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Sample Application - LED program to boot from C5535 EEProm

Hi  everyone, Am facing similar problem.

Actually am trying sample LED code to boot from c5535 EEPROM. I now the procedure to convert the .out file to .bin.

Here i need is to include initialization part to sample lcd code. Can you please provide the total sample led program which having initialization to boot from EEPROM.

Thanks,

Kranthi.

  • Kranthi,

    The other post is not entirely related to your issue. I have split the thread to help others follow your post better.

    In addition, to get a little bit more information. Are you using the EZDSP C5535?

     

    Regards,

    _Nic

    Reference: Split thread from following post: POST

  • /**********************************************************************
    **+-----------------------------------------------------------------+**
    **|                            ****                                 |**
    **|                            ****                                 |**
    **|                            ******o***                           |**
    **|                      ********_///_****                          |**
    **|                      ***** /_//_/ ****                          |**
    **|                       ** ** (__/ ****                           |**
    **|                           *********                             |**
    **|                            ****                                 |**
    **|                            ***                                  |**
    **|                                                                 |**
    **|   Copyright (c) 2006 - 2010    Texas Instruments Incorporated   |**
    **|                        ALL RIGHTS RESERVED                      |**
    **|                                                                 |**
    **| Permission is hereby granted to licensees of Texas Instruments  |**
    **| Incorporated (TI) products to use this computer program for     |**
    **| the sole purpose of implementing a licensee product based       |**
    **| on TI products.No other rights to reproduce, use, or            |**
    **| disseminate this computer program, whether in part or in whole, |**
    **| are granted.TI makes no representation or warranties with       |**
    **| respect to the performance of this computer program, and        |**
    **| specifically disclaims any responsibility for any damages,      |**
    **| special or consequential,connected with the use of this program.|**
    **|                                                                 |**
    **+-----------------------------------------------------------------+**
    **********************************************************************/
    
    
    #include <stdio.h>
    #include <std.h>
    
    Uint16 dmem[20];
    
    void main(void)
    {
    	Uint16 i,j;
    
    	asm(" bit(ST1,#13) = #0 "); // Turn OFF XF
    
    	// Enable clock to all peripherals
    	asm("	*port(#0x1C02) = #0x0 ");
    	asm("	*port(#0x1C03) = #0x0 ");
    
    	// Bypass the PLL as the system clock source
    	asm("	*port(#0x1C1F) = #0x0 "); //Clock Configuration MSW reg
    
        //  program PLL to 50MHz 
    	asm("	*port(#0x1c20) = #0x8BE8 "); //PLL Control 1 reg
    	asm("	*port(#0x1c21) = #0x8000 "); //PLL Control 2 reg	
    	asm("	*port(#0x1c22) = #0x8006 "); //PLL Control 3 reg
        asm("	*port(#0x1C23) = #0x0000 "); //PLL Output Control4 reg	
    	
    	// wait 1 milli sec for PLL to lock
    	asm("	repeat(0xC350)	"); 
    	asm("		nop		");	// wait 1ms @ 50Mhz: 0x001s * 50 Mhz = 50000
    	
    	asm("	*port(#0x1c1F) = #0x0001 "); // Clock configuration MSW reg
    
    	// Program DSP_LDO to 1.05V
    	asm("	*port(#0x7004) = #0x0002 ");
    
    	// wait 1 milli sec
    //	asm("	repeat(0xC350)	"); 
    //	asm("		nop		");	// wait 1ms @ 50Mhz: 0x001s * 50 Mhz = 50000
    			
    	while (1) {
    // 1
    		asm(" bit(ST1,#13) = #1 "); // toggle XF
    		for (i=0; i<200; i++) {
    			for (j=0; j<10; j++) {}
    		}
    	
    		asm(" bit(ST1,#13) = #0 "); // toggle XF
    		for (i=0; i<100; i++) {
    			for (j=0; j<10; j++) {}
    		}
    // 2
    		asm(" bit(ST1,#13) = #1 "); // toggle XF
    		for (i=0; i<200; i++) {
    			for (j=0; j<10; j++) {}
    		}
    	
    		asm(" bit(ST1,#13) = #0 "); // toggle XF
    		for (i=0; i<100; i++) {
    			for (j=0; j<10; j++) {}
    		}
    // 3
    		asm(" bit(ST1,#13) = #1 "); // toggle XF
    		for (i=0; i<200; i++) {
    			for (j=0; j<10; j++) {}
    		}
    	
    		asm(" bit(ST1,#13) = #0 "); // toggle XF
    		for (i=0; i<100; i++) {
    			for (j=0; j<10; j++) {}
    		}
    // 4
    		asm(" bit(ST1,#13) = #1 "); // toggle XF
    		for (i=0; i<200; i++) {
    			for (j=0; j<10; j++) {}
    		}
    	
    		asm(" bit(ST1,#13) = #0 "); // toggle XF
    		for (i=0; i<100; i++) {
    			for (j=0; j<10; j++) {}
    		}
    // 5
    		asm(" bit(ST1,#13) = #1 "); // toggle XF
    		for (i=0; i<200; i++) {
    			for (j=0; j<10; j++) {}
    		}
    	
    		asm(" bit(ST1,#13) = #0 "); // toggle XF
    		for (i=0; i<100; i++) {
    			for (j=0; j<10; j++) {}
    		}
    // 6
    		asm(" bit(ST1,#13) = #1 "); // toggle XF
    		for (i=0; i<200; i++) {
    			for (j=0; j<10; j++) {}
    		}
    	
    		asm(" bit(ST1,#13) = #0 "); // toggle XF
    		for (i=0; i<500; i++) {
    			for (j=0; j<10; j++) {}
    		}
    
    
    	}
    
    }
    
    

    Attached is a file I used to program the PLL to toggle the XF output. You can use it as an example. The key is the top portion to program the PLL. You can refer to GEL for more PLL frequnecy settings. Also, since you have a working program already, your must have peripheral clock enabled.

    Hope this help.

    Regards.

  • Hi Steve Tsang,

    Thanks.

    I have build sample led test as followed

    #include "stdio.h"
    #include "ezdsp5535.h"

    #define PCGCR1 0x1c02

    #define PCGCR2 0x1c03

    #define CCR2 0x1c1f

    #define CGCR1 0x1c20

    #define CGCR2 0x1c21

    #define CGCR3 0x1c22

    #define CGCR4 0x1c23

    void ProgramPLL_100MHz(void)

    {

    int i;

    printf("Configuring PLL (100.00 MHz).\n");

    /* Enable clocks to all peripherals */

    *(short *)PCGCR1 = 0x0;

    *(short *)PCGCR2 = 0x0;

    /* Bypass PLL */

    *(short *)CCR2 = 0x0;

    /* Set CLR_CNTL = 0 */

    *(short *)CGCR1 = *(short *)CGCR1 & 0x7FFF;

    *(short *)CGCR2 = 0x8000;

    *(short *)CGCR4 = 0x0000;

    *(short *)CGCR3 = 0x0806;

    *(short *)CGCR1 = 0x82fa;

    /* Wait for PLL lock */

    for(i=0;i<0x7fff;i++);

    /* Switch to PLL clk */

    *(short *)CCR2 = 0x1;

    printf("PLL Init Done.");

    }

    void TEST_execute( Int16 ( *funchandle )( ), char *testname, Int16 testid )

    {

    Int16 status;

    /* Display test ID */

    printf( "\n%02d Testing %s...\n", testid, testname );

    /* Call test function */

    status = funchandle( );

    /* Check for test fail */

    if ( status != 0 )

    {

    /* Print error message */

    printf( " FAIL... error code %d... quitting\n", status );

    /* Software Breakpoint to Code Composer */

    SW_BREAKPOINT;

    }

    else

    {

    /* Print error message */

    printf( " PASS\n" );

    }

    }

    extern Int16 led_test( );

    void main(void)
    {
    ProgramPLL_100MHz();

    /* Initialize BSL */
    EZDSP5535_init( );



    TEST_execute(led_test,"LEDs",1);


    printf( "\n***ALL Tests Passed***\n" );

    SW_BREAKPOINT;
    }

    Able to run the .out file but unable to boot from EEPROM, Is the above code need any changes please tell me.

    Thanks and regards,

    Kranthi.

     

  • Can you boot from EEPROM with my code?

    Regards.

  • I can't compile your code without the ezdsp5535.h. You should start with the code I provided. I tried on c5535ezdsp to blink XF LED via SPI EEPROM. Once you get it to work, you should be able to debug your code. Make sure SW3 bit 4 is set to "ON" position to use on board SPI EEPROM. Bit 4 is the far right from the white dot pin 1 indicator and "ON" is the opposite side of white dot.

    Hope this help.

    Regards.

  • Am working with your program 7167.main.c, here am unable to compile as it was saying 

    could not open source file "std.h" ledblink led.c 

    I don't have std.h file. 

    Regards,

    Kranthi.

  • Replace it with tistdtypes.h for CCS4 and up. Let me know.

    Regards.

  • I wrote std.h library as given below.

    /*****************************************************************************/
    //#ifndef _STD_H_
    #define _STD_H_

    /* 7.18.1.1 Exact-width integer types */

    #if defined(__MSP430__) || defined(__TMS320C55X_PLUS_BYTE__)
    typedef signed char int8;
    typedef unsigned char uint8;
    typedef int int16;
    typedef unsigned int uint16;
    typedef long int32;
    typedef unsigned long uint32;
    #else
    typedef int int16;
    typedef unsigned int uint16;
    typedef long int32;
    typedef unsigned long uint32;
    #endif

    typedef long long int40;
    typedef unsigned long long uint40;

    /*****************************************************************************/

    Now i cleared the source file issue, and there is n error but still am unable to built the .out file.

    Here in my consoul its showing as given below

    **** Build of configuration Debug for project ledblink ****

    C:\ccsv4\utils\gmake\gmake -k all
    'Building file: ../led.c'
    'Invoking: Compiler'
    "C:/ccsv4/tools/compiler/c5500/bin/cl55" -v5515 -g --include_path="C:/ccsv4/tools/compiler/c5500/include" --diag_warning=225 --ptrdiff_size=16 --memory_model=large --preproc_with_compile --preproc_dependency="led.pp" "../led.c"
    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 112:
    [E9999]
    Syntax Error
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 112:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 112:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 112:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 114:
    [E9999]
    Illegal directive or mnemonic
    *port(#0x1C02) = #0x0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 116:
    [E9999]
    Illegal directive or mnemonic
    *port(#0x1C03) = #0x0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 118:
    [E9999]
    Illegal directive or mnemonic
    *port(#0x1C1F) = #0x0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 120:
    [E9999]
    Illegal directive or mnemonic
    *port(#0x1c20) = #0x8BE8

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 122:
    [E9999]
    Illegal directive or mnemonic
    *port(#0x1c21) = #0x8000

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 124:
    [E9999]
    Illegal directive or mnemonic
    *port(#0x1c22) = #0x8006

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 126:
    [E9999]
    Illegal directive or mnemonic
    *port(#0x1C23) = #0x0000

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 128:
    [E9999]
    Syntax Error
    repeat(0xC350)

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 128:
    [E9999]
    Invalid mnemonic specified
    repeat(0xC350)

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 132:
    [E9999]
    Illegal directive or mnemonic
    *port(#0x1c1F) = #0x0001

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 134:
    [E9999]
    Illegal directive or mnemonic
    *port(#0x7004) = #0x0002

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 139:
    [E9999]
    Syntax Error
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 139:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 139:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 139:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 186:
    [E9999]
    Syntax Error
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 186:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 186:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 186:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 233:
    [E9999]
    Syntax Error
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 233:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 233:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 233:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 279:
    [E9999]
    Syntax Error
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 279:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 279:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 279:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 325:
    [E9999]
    Syntax Error
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 325:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 325:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 325:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 371:
    [E9999]
    Syntax Error
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 371:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 371:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 371:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 417:
    [E9999]
    Syntax Error
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 417:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 417:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 417:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 463:
    [E9999]
    Syntax Error
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 463:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 463:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 463:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 509:
    [E9999]
    Syntax Error
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 509:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 509:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 509:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 555:
    [E9999]
    Syntax Error
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 555:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 555:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 555:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 601:
    [E9999]
    Syntax Error
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 601:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 601:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 601:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #1

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 647:
    [E9999]
    Syntax Error
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 647:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 647:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    "C:\Users\ARGUS\AppData\Local\Temp\0304410", ERROR! at line 647:
    [E9999]
    Invalid mnemonic specified
    bit(ST1,#13) = #0

    63 Assembly Errors, No Assembly Warnings

    Errors in Source - Assembler Aborted

    >> Compilation failure

    >> Compilation failure
    gmake: *** [led.obj] Error 1
    gmake: Target `all' not remade because of errors.
    Build complete for project ledblink

    Please solve this.

    Thanks,

    Kranthi.


  • while (1) {
    // 1
    asm(" bit(ST1,#13) = #1 "); // toggle XF
    for (i=0; i<200; i++) {
    for (j=0; j<10; j++) {}   <-----what does this parenthesis for
    }

    asm(" bit(ST1,#13) = #0 "); // toggle XF
    for (i=0; i<100; i++) {
    for (j=0; j<10; j++) {}  <-----what does this parenthesis for

    }

    Am facing error there as "expecting a statement" 

  • That's is for the for loop. Actually, both for statements are to have some time in between the XF on/off so human eyes can see the led on/off.