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.

Code Works During Debug, But Outside Debug After Reset Code Does Not Work

Other Parts Discussed in Thread: TMS320F28032, CONTROLSUITE

I am using TMS320F28032.

While during debugging (XDS100v2 is plugged to my custom design board), code works perfect.  

But outside of the debug, after removing XDS100v2 and reset my custom design board (power off then power on ) code does not work ?

What can i do ? I need your help.

  • Hi Mehmet,

    Please check the BOOTMODE pin setting on the board. BOOTMODE pins should be driven to select "FlashBoot" at power up to have code in Flash work as expected.

    Regards,

    Vivek Singh

  • What flash sector is being used by the app? Did you include de codestartbrach.asm?

    Gastón

  • Thanks for repyl,
    I dont know how to check bootmode exactly. But i tried.

    in F28032.cmd file, i observed this :

    MEMORY
    {
    PAGE 0:
    .
    BEGIN : origin = 0x3F7FF6, length = 0x000002 /* Part of FLASHA. Used for "boot to Flash" bootloader mode. */
    .
    }
    SECTIONS
    {
    .
    codestart : > BEGIN PAGE = 0
    .
    }

    I think at power up FlashBoot is used.
  • Thanks for reply Gaston.

    I am using "F28032.cmd" linker command file and i did not change anything with this file.
    my linker file is shown below :

    *****************************************************************************************
    .cinit : > FLASHA PAGE = 0
    .pinit : > FLASHA, PAGE = 0
    .text : > FLASHA PAGE = 0
    codestart : > BEGIN PAGE = 0
    ramfuncs : LOAD = FLASHD,
    RUN = RAML0,
    LOAD_START(_RamfuncsLoadStart),
    LOAD_SIZE(_RamfuncsLoadSize),
    RUN_START(_RamfuncsRunStart),
    PAGE = 0

    /* Allocate uninitalized data sections: */
    .stack : > RAMM0 PAGE = 1
    .ebss : > RAML2 PAGE = 1
    .esysmem : > RAML2 PAGE = 1

    /* Initalized sections go in Flash */
    /* For SDFlash to program these, they must be allocated to page 0 */
    .econst : > FLASHA PAGE = 0
    .switch : > FLASHA PAGE = 0

    .reset : > RESET, PAGE = 0, TYPE = DSECT
    vectors : > VECTORS PAGE = 0, TYPE = DSECT
    *****************************************************************************************


    And also "codestartbrach.asm" is included. My project has this "codestartbrach.asm" file.
  • if this is a custom board, check the reset pin of the microcontroller for proper function (soldering issue). You could also check if an example program like led toogle works on your board.
    Gastón
  • Hi Mr.Vivek
    I believe you can help me.

    My code (which is really basic code that only do SCI echo back) is working properly during debug. I send character via hyperterminal and i can see receiving character in "expressions" tab.. Also if you look hyperterminal,you can see what i send and what i get. (figure below )

    After terminate debug and removing xds100v2 code still working properly. I am sending character and i am getting that character..  


    BUT AFTER I RESTART MY CUSTOM DESIGN BOARD, MY BOARD IS NOT WORKING.. ECHO BACK IS NOT WORKING.
    I send character but i cannot get anything...

    I cannot give any meaning of this issue.  

    What is the problem ?

    Is this problem about hardware or software ?

    Please help me, sorry for my bad English. 
    Thanks..

     Best Regards



  • I tried to check BOOTMODE pins :
    In our custom board,
    GPIO37/TDO and TRST are connected to the jtag (xds100v2 use this jtag).
    GPIO34 (EMU Pin) is used for general purpose output for relay control.
  • Did you follow these steps:

    You need to add these two statements

    MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);
    InitFlash(); after InitPieVectTable();

    Add DSP2803x_MemCopy.c file to the project.

    Define extern variables above main() function.

    extern Uint16 RamfuncsLoadStart;
    extern Uint16 RamfuncsLoadEnd;
    extern Uint16 RamfuncsRunStart;

    Replace 28032_RAM_lnk.cmd with F28032.cmd
    Compile the code.

    -> Configure your GPIO's to boot to flash.

    Also, you can refer a direct example code present here:
    C:\ti\controlSUITE\device_support\f2803x\v130\F2803x_examples_ccsv5\flash_f28035
    (Replace the cmd file)

    Regards,
    Gautam
  • Finaly i solved problem.

    Like Vivek Singh said,  the problem is "BOOT MODE" pins..

    I tried to explain how to solve this problem:

    There are 3 important pins about BOOT MODE :  GPIO37/TDO, GPIO34 and TRST ( see: SPRS584J - TMS320F28032 Datasheet  Page : 31 - 3.2.9 )

    My problem is about GPIO34..

    I use this pin as a GPIO for controlling  a relay. But, as far as i understand, this pin also have a mission to set BOOT MODE.

    For "GetMode" ( GetMode option is to boot to flash ) GPIO34 must be pull up when power on.  ( see: SPRS584J - TMS320F28032 Datasheet  Page : 31 - Table 3-6 )

    I added pull-up circuit for GPIO34. And eventually problem is solved.

    Thank you  Mr.Gaston_Melo_Arg and Mr. Vivek Singh. 

    Best Regards from Türkiye!  C*

  • Great!

    Goodluck & Regards,
    Gautam