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.

Flash Programming using Matlab generated .out file for C2000 - TMS320F28335

Other Parts Discussed in Thread: TMS320F28335, UNIFLASH

Greetings ...!!!!

   I use the following for my embedded system development.

Delfino experimenter kit - TMS320F28335

Code composer studio - CCSV4

Matlab - 2011b

The issue is in programming the flash memory..!!!

I have changed the "target preference setting" in Matlab for flash programming.

Once I generate the code, the Matlab command window says  - "the build is done, but error in downloading".

I could find my .out file and load them in ccsv4.

While the programming is being loaded, i could see at the bottom left - say like a operation progress status -

       " erasing the Flash sector" - "loading the program and all"

Then I run the program and it works.The program is simple led blinking on the control card itself.

But it doesn't work once I power Off and On the controller.  

Kindly, help me out..

 

Kind Regards

Karuna

 

  

 

 

  • Hi Karuna,

    Try loading the .out file using CCS Uniflash. If you still observe that the program is running from RAM then the .cmd file has be modified to running from flash configuration. (I don't know how that's done in matlab)

    I have changed the "target preference setting" in Matlab for flash programming.

    As you say, you've done flash settings in matlab; do check with Uniflash and revert.

    Regards,

    Gautam

  • Hi Gautham,

    I tried using it, first i erased and then programmed.

    But getting the same problem, the code is not able to run once powered ON.

    Here is the content of .cmd file,

    MEMORY

    {
    PAGE 0:
             BEGINRAM:                  origin=0x0, length=0x2
             RAMM0:                        origin=0x2, length=0x3fe
             OTP:                              origin=0x380400, length=0x400
             FLASH:                          origin=0x300000, length=0x3fff6
             BEGINFLASH:                origin=0x33fff6, length=0x2
             CSM_PWL:                    origin=0x3f7ff8, length=0x8
             IQTABLES:                     origin=0x3fe000, length=0xb50
             IQTABLES2:                   origin=0x3feb50, length=0x8c
             FPUTABLES:                 origin=0x3febdc, length=0x6a0
             ROM:                            origin=0x3ff27c, length=0xd44
             RESET:                         origin=0x3fffc0, length=0x2
             VECTORS:                    origin=0x3fffc2, length=0x3e
             RAML4L7:                     origin=0xc000, length=0x4000
             ADC_CAL:                     origin=0x380080, length=0x9
    PAGE 1:
             RAML0L3:                     origin=0x8000, length=0x4000
             RAMM1:                       origin=0x400, length=0x400
    }
    SECTIONS
    {
            .vectors:                         load = 0x000000000
            .text:                              > FLASH, PAGE = 0
            .switch:                          > RAML4L7, PAGE = 0
            .bss:                              > RAML0L3, PAGE = 1
            .ebss:                            > RAML0L3, PAGE = 1
            .far:                               > RAML0L3, PAGE = 1
            .cinit:                             > RAML4L7, PAGE = 0
            .pinit:                             > RAML4L7, PAGE = 0
            .const:                           > RAML0L3, PAGE = 1
            .econst:                         > RAML0L3, PAGE = 1
            .reset:                            > RESET, PAGE = 0, TYPE = DSECT
            .data:                             > RAML0L3, PAGE = 1
            .cio:                               > RAML0L3, PAGE = 1
            .sysmem:                       > RAML0L3, PAGE = 1
            .esysmem:                     > RAML0L3, PAGE = 1
            .stack:                           > RAMM1, PAGE = 1
            .rtdx_text:                      > RAML4L7, PAGE = 0
            .rtdx_data:                     > RAML0L3, PAGE = 1
            IQmath:                         > RAML4L7, PAGE = 0
            codestart:                      > BEGINRAM, PAGE = 0
            csmpasswds:                > CSM_PWL, PAGE = 0
            csm_rsvd:                     > RAMM0, PAGE = 0
            ramfuncs:                      LOAD = FLASH,
                                                RUN = RAMM0,
                                                LOAD_START(_RamfuncsLoadStart),
                                                LOAD_END(_RamfuncsLoadEnd),
                                                RUN_START(_RamfuncsRunStart),
                                                PAGE = 0
            .adc_cal:                      > ADC_CAL, PAGE = 0 , TYPE = NOLOAD
             IQmathTables:             > IQTABLES, PAGE = 0 , TYPE = NOLOAD
             IQmathTables2:           > IQTABLES2, PAGE = 0 , TYPE = NOLOAD
             FPUmathTables:          > FPUTABLES, PAGE = 0 , TYPE = NOLOAD
    }
    -l "C:\Program Files\MATLAB\R2011b\toolbox\idelink\extensions\ticcs\c2000\c2833xPeripherals.cmd"

     

    Kind Regards

    Karuna

     

     

  • Try using this: 7610.F28335.zip

    Regards,

    Gautam

  • Thanks for sharing the .cmd file.

    I have to modify/edit the memory location and allocate the sections. I think this can be done in the target preference by editing the "Memory" and "Sections" tab.

    Will revert you back.

    Kind Regards

    karuna

  • Hi Gautham,

    It works,

    I modified the "section" tab of target interference block in Matab, according to the file you shared.

    so, here is content of new .cmd file,

    MEMORY
    {
    PAGE 0:
        BEGINRAM:	 origin=0x0, length=0x2
        RAMM0:	 origin=0x2, length=0x3fe
        OTP:	 origin=0x380400, length=0x400
        FLASH:	 origin=0x300000, length=0x3fff6
        BEGINFLASH:	 origin=0x33fff6, length=0x2
        CSM_PWL:	 origin=0x3f7ff8, length=0x8
        IQTABLES:	 origin=0x3fe000, length=0xb50
        IQTABLES2:	 origin=0x3feb50, length=0x8c
        FPUTABLES:	 origin=0x3febdc, length=0x6a0
        ROM:	 origin=0x3ff27c, length=0xd44
        RESET:	 origin=0x3fffc0, length=0x2
        VECTORS:	 origin=0x3fffc2, length=0x3e
        RAML4L7:	 origin=0xc000, length=0x4000
        ADC_CAL:	 origin=0x380080, length=0x9
    PAGE 1:
        RAML0L3:	 origin=0x8000, length=0x4000
        RAMM1:	 origin=0x400, length=0x400
    }
    SECTIONS
    {
        .vectors:	 load = 0x000000000
        .text:	 > FLASH, PAGE = 0
        .switch:	 > FLASH, PAGE = 0
        .bss:	 > RAML0L3, PAGE = 1
        .ebss:	 > RAML0L3, PAGE = 1
        .far:	 > RAML0L3, PAGE = 1
        .cinit:	 > FLASH, PAGE = 0
        .pinit:	 > FLASH, PAGE = 0
        .const:	 > RAML0L3, PAGE = 1
        .econst:	 > FLASH, PAGE = 0
        .reset:	 > RESET, PAGE = 0, TYPE = DSECT
        .data:	 > RAML0L3, PAGE = 1
        .cio:	 > RAML0L3, PAGE = 1
        .sysmem:	 > RAML0L3, PAGE = 1
        .esysmem:	 > RAMM1, PAGE = 1
        .stack:	 > RAMM1, PAGE = 1
        .rtdx_text:	 > RAML4L7, PAGE = 0
        .rtdx_data:	 > RAML0L3, PAGE = 1
        IQmath:	 > FLASH, PAGE = 0
        codestart:	 > BEGINFLASH, PAGE = 0
        csmpasswds:	 > CSM_PWL, PAGE = 0
        csm_rsvd:	 > RAMM0, PAGE = 0
        ramfuncs:	 LOAD = FLASH,
    		RUN = RAMM0,
    		LOAD_START(_RamfuncsLoadStart),
    		LOAD_END(_RamfuncsLoadEnd),
    		RUN_START(_RamfuncsRunStart),
    		PAGE = 0
        .adc_cal:	 > ADC_CAL, PAGE = 0 , TYPE = NOLOAD
        IQmathTables:	 > IQTABLES, PAGE = 0 , TYPE = NOLOAD
        IQmathTables2:	 > IQTABLES2, PAGE = 0 , TYPE = NOLOAD
        FPUmathTables:	 > FPUTABLES, PAGE = 0 , TYPE = NOLOAD
    }
    -l "C:\Program Files\MATLAB\R2011b\toolbox\idelink\extensions\ticcs\c2000\c2833xPeripherals.cmd"
    

    thanks for your support Gautham.

    Kind Regards

    Karuna

     

  • That's great, Karuna!

    Good Luck and Regards,

    Gautam