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.

Discrepancy 28335 : Debugger vs Chip

Hello,

A tripzone module was implemented on 28335 and debugged with BLACKHAWK USB2000 CONTROLLER Debugger and using CCS V4.

It all runs well but does tripzone does not operate once running from chips memory without a debugger.

Obviously this is problematic to debug as it all works fine once the debugger is connected.

Any idea?

  • Hi Isaac,

    Is the program loaded to the device Flash or RAM?

    Regards,

    Gautam

  • Gautam,

    The code is running form Flash.

    I'm currently concentrating on this sentence from the documentation:

    " The EALLOW bit is overridden via the JTAG port, allowing full access of protected registers during debug from the Code Composer Studio interface.  "

    as some of the used registers are EALLOW protected.

    Any other idea is welcome.

    Isaac

  • There are some tips for debugging  this on our wiki that may help.

    http://processors.wiki.ti.com/index.php/C2000_Flash_Common_Issues/FAQs#Running_Code_Standalone

    Isaac Pilli1 said:
    " The EALLOW bit is overridden via the JTAG port, allowing full access of protected registers during debug from the Code Composer Studio interface.  "

    The above means if you write to a register using the Code Composer memory or watch window then EALLOW won't block it.  From the CPU standpoint - the CPU writing to that same register, even with the debugger attached - EALLOW will come into play.  So this behavior is not different when executing code with the emulator connected vs not.

  • Just sharing the solution with the community:

     

      //  During initialization:

      EALLOW;

      // GPIO12 after reset is configured as input here

      // Initializing signal qualifications

      GpioCtrlRegs.GPACTRL.bit.QUALPRD1 = 75;   // Time between samples is: 6.66nSec * 2 * 75 = 1 uSec

      GpioCtrlRegs.GPAQSEL1.bit.GPIO12 = 0x2;   // 6 samples in TZ1

      EDIS;

     

      // DELAY MUST BE ADDED HERE

     

    // Read TZ input while still configured as GPIO input

      if ( GpioDataRegs.GPADAT.bit.GPIO12 == 0) { // check Trip zone at power up

         Report_Error (TripZone);

    // Before adding the above delay this was sometimes read as '1' although the hardware signal was '0'

    // This had never occur once running from the debugger, just from the chip Flash itself.

    // The added delay had solved it

    }

     

     

      EALLOW;

      GpioCtrlRegs.GPAMUX1.bit.GPIO12 = 0x1;    // Configure GPIO12 as TZ1

      // + configurations of the reset of the Trip Zone registers: TZSEL, TZCTL, ...

      // .....

      // ...

    // ...

      EDIS;

     ==================

      It wouldn't be expected that GpioDataRegs.GPADAT.bit.GPIO12 would change its value 

      once a signal qualification is programmed, assuming a stable hardware signal there,

      but the fact is that it need some time to 'relax' after signal qualification programming and before before it is read.

     

     

  • Isaac,

    Thank you for providing the solution back to the community!  That is a tricky one to find. 

    -Lori