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.

An Error encountered. F28027, Motorware12, CCS5

Other Parts Discussed in Thread: MOTORWARE, DRV8312, TMS320F28027

This is Will in Korea.

I have encountered an error during writing to flash memory.

In Motorware_12, I edit lap3a for use external crystal so I added some code. It worked fine in motorware_9 but not Moterware_12.

And the worst thing is this code kill my board I designed based on DRV8312&F28027 DK. After I write flash for the first time totally shutdowned, not be able to rewrite even erase.

The code is below.

// enable internal oscillator 1

    CLK_disableOsc1(obj->clkHandle);                  

    // disable the external clock in

    CLK_disableClkIn(obj->clkHandle);

    // disable the crystal oscillator

    CLK_enableCrystalOsc(obj->clkHandle);                          

 

    // disable oscillator 2

    CLK_disableOsc2(obj->clkHandle);                           

    // set the oscillator source

    CLK_setOsc2Src(obj->clkHandle,CLK_Osc2Src_Internal);                                                 

    CLK_setOscSrc(obj->clkHandle,CLK_OscSrc_External);                                                     

    CLK_setTimer2Src(obj->clkHandle,CLK_Timer2Src_ExtOsc);                                                             

    CLK_setTimer2PreScale(obj->clkHandle,CLK_Timer2PreScaler_by_4);       

 

    // set the low speed clock prescaler

    CLK_setLowSpdPreScaler(obj->clkHandle,CLK_LowSpdPreScaler_SysClkOut_by_4); 

 

    // set the clock out prescaler

    CLK_setClkOutPreScaler(obj->clkHandle,CLK_ClkOutPreScaler_SysClkOut_by_2);

.........

PLL_setDivideSelect(obj->pllHandle,PLL_DivideSelect_ClkIn_by_4);

C28xx: Flash Programmer: Error encountered when writing to flash memory ...

ERROR >> C28xx: Flash Programmer: Error erasing flash memory. Error erasing Sector A

  • Hello Will,

    Seems that you miss something between F28069 and F28027 (the error in your picture said it).

    It seems by default refers to F28069 target configuration file.

    Did you check your target configuration file (it should be for F28027)?

    You can make the new one for F28027 and xDS100v2, or you can get it from here (TMS320F28027_xds100v2.ccxml):

    C:\ti\motorware\motorware_1_01_00_12\sw\ide\ccs\ccs5\targetConfigs

    And link it to your project then make it as Default or Active (by right click on this ccxml file after you link it to your project).

    Best regards,

    Maria

  • Before error occur it works properly and of course I checked test connection of target config file.

  • Hello Will,

    Jungsik Kim said:
    Before error occur it works properly

    What do you mean by "before" ?

    You said you can run Motorware 9, but not Motorware 12. Did Motorware 12 project also work properly before?

    Best regards,

    Maria

  • Yes. Without that code the project in Moterware12 works properly on my board but when I add it error occur. So I think connection with debugger is not the problem.

  • Hello,

    I am not sure this is related to your problem or not, but I found that there was bug in Motorware 9:

    //! \brief Enumeration to define the clock oscillator 2 source
    //!
    typedef enum
    {
        CLK_Osc2Src_Internal=(0 << 1),  //!< Denotes an internal oscillator 2 source
        CLK_Osc2Src_External=(1 << 1)   //!< Denotes an external oscillator 2 source
    } CLK_Osc2Src_e;

    that has been fixed in Motorware 12:

    //! \brief Enumeration to define the clock oscillator 2 source
    //!
    typedef enum
    {
        CLK_Osc2Src_Internal=(1 << 1),  //!< Denotes an internal oscillator 2 source
        CLK_Osc2Src_External=(0 << 1)   //!< Denotes an external oscillator 2 source
    } CLK_Osc2Src_e;

    Also please make sure you are using the compiler of CCS5.5 Code Generation Tools 6.2.3 or above (the default from the installer is 6.2.0, and it has bug to use with Motorware).

    Anyway, hope you can find your solution soon.

    Best regards,

    Maria

  • Thank you Maria.

    I knew that bug but I didn't know it is fixed after Motorware9.

    My board works fine. But I still wonder why the wrong bit setting causes block the memory access. Dose it use clock source form JTAG when we program or erase flash memory?

    Whatever, Problem solved. Thank you.

  • Hello Will,

    That's glad to hear that you have made it.

    About the clock, I think the JTAG uses clock from MCU, and since the setting is wrong, maybe it gets random clock/pulse that is totally wrong or even maybe not get any pulse at all (just my opinion :) )

    Anyway, you made your board working, and this is good.

    Have nice days!

    Best regards,

    Maria