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.

CCS/TMS320F28035: TM320F28035 Boot to flash in Standalone mode

Part Number: TMS320F28035

Tool/software: Code Composer Studio

Hello,

I am following the pdf:SPRA958K. to run piccolo as Standalone application.

I have question: Are steps different for Control card then using it on our pcb?

Page 34 Says the following:

"F28035 Experimenter’s Kit or ControlStick: When the emulator is connected, the debugger is used to select the boot mode. Check the Scripts menu in CCS v5 for boot mode selection options. When the emulator is disconnected, the board will boot in jump-to-flash mode provided the OTP_KEY and OTP_BMODE locations in the OTP have not been otherwise programmed, and on the Experimenter’s Kit only: DIP SW2: 1 = ON 2 = ON."

I am not able to successfully flash it and would like to know is there a sample code for standalone application? And will there any changes required if I dont use ISO card and  use it directly on custom board?

Thanks

sagar

  • Hello Sagar,

    The ControlCard is really no different than any other board.  It does have the bootmode pins connected to DIP SW2 however, hence the note about having them set for jump-to-flash bootmode.

    The code that accompanies SPRA958 should run on your own board standalone.  If it does not, then something else is going on.  Check your bootmode pins as a start.

    What do you mean you are "not able to successfully flash it?"

    Regards,

    David

  • I have shared my code. Kindly review.
    I mean I am able to flash the code but when I power it down it does not start again with no emulator on my custom board.

    However I am able to run as a standalone application on ISO card.



    Thanks

    Sagar

  • Sagar,

    It looks like you are using the code from the online TI workshop lab10. There is no problem with this code. It sounds like the code runs standalone on the ControlCard for you, or on your board when you use the emulator. It fails to run on your board without the emulator. This suggests a board level problem. Check the bootmode pins on your schematic, and also the JTAG pin connections, especially TRSTn pin. Do you have TRSTn pulled down (or at least, NOT pulled up)?

    - David
  • I am in Get mode. i.e GPIO 37 and GPIO 34 to high and TRSTN pin I have not pulled it up!

    Yes, the code I have attached is sample code. I think while executing the code I am having trouble to run F11 as per instructions. So I am not sure whats the error. If I try to use F11 it would debug and flash the code once again.
  • I have one more question in the PDF written by you SPRA958L (Which is a great Guide).

    I am getting the error I am getting this error Pie Vector Table Init is undefined. I am getting this error but I have that function defined in const struct PIE_VECT_TABLE PieVectTableInit. So If possible can you guide me on what am I missing in the code.

    Thanks
  • Sagar,

    sagar shah54 said:
    I have one more question in the PDF written by you SPRA958L (Which is a great Guide).

    I am getting the error I am getting this error Pie Vector Table Init is undefined. I am getting this error but I have that function defined in const struct PIE_VECT_TABLE PieVectTableInit. So If possible can you guide me on what am I missing in the code.
     

    Do you have the file PieVect_nonBIOS.c included in the project?

    I cannot tell from here what is going on.  Have you tried the code that comes with SPRA958?

    - David

  • I have not tried code included with SPA958. Is there any link for it?
    And yes I have DSP 2803x_pieVect.c file included in the project.
  • There is a link in the 2nd paragraph of the abstract of the appnote.

    - David
  • Hey David-

    It gives me this error on the file. Is there other resource from where I can access that file ?
    Error -
    Not Found
    The requested URL /sc/techlit/spra958.zip was not found on this server.
  • Hey David,

    I am able to Run in standalone mode now. But I have a problem.
    The Epwm isr runs at slower rate in standalone mode than at flash using JTAG.
    So I have copied EPWM isr to ram but still it is taking long time to trigger in standalone mode.

    Can you explain what could be the cause?
  • Sagar,

    That is very peculiar. How do you know the ISR is running slower?

    Have you tried the code from the appnote?

    - David
  • Hey David-

    I still have this odd problem. The is latency in which epwm isr triggers. In Emulation mode there is no latency for epwm isr to trigger. But in standalone mode there is latency for the Epwm ISR to trigger for same code.

    So what should I do to reduce the latency? Also the epwm ISR exception time is constant but there is latency difference in both modes.
    I hope you understand the problem now.

    Thanks for the help.

  • Sagar,

    How are you measuring the ISR latency?  Using a GPIO?

    The emulator has no mystical control over the processor.  Code should run the same whether the emulator is connected or not.  It is possible that CCS initializes something that doesn't get initialized the same in standalone mode, and I've seen that be the cause of some issues.  But there is nothing controlling interrupt latency in the device.  If the interrupt is enabled and occurs, it gets taken.

    - David

  • Yes I am measuring latency using a GPIO 34. So I can see that there is quite delay when I have used standalone mode. But if I remove Initflash() and other things for standalone mode, Epwm isr triggers without any latency.

    So do you think is there something I might have done in incorrect manner?
    Thanks
  • Sagar,

    sagar shah54 said:
    Yes I am measuring latency using a GPIO 34. So I can see that there is quite delay when I have used standalone mode. But if I remove Initflash() and other things for standalone mode, Epwm isr triggers without any latency.

    InitFlash() is needed to properly setup the flash for execution (e.g., wait-states).

    You've got something funny going on in your code.  I'd suggest boiling the code down to the bare minimum needed to reproduce the problem, and try to debug.  Alternately, try the code from the appnote SPRA958.  Modify the code to enable the ePWM interrupt and see if you see the problem there too.

    Regards,

    David

  • Hey David -

    Init Flash() has all parameters as per SPR958.
    Also I have question- I noticed one wierd thing that when I am reading EQEP registers in EPWM ISR it works fine(without moving epwm ISR to Ramfuncs) but when I remove those EQEP registers from my EPWM isr; The ISR triggers with a latency.

    Can you suggest what should I do?

    Thanks
  • Is there any optimization done by the compiler?
  • Sagar,

    sagar shah54 said:

     
    Init Flash() has all parameters as per SPR958.
    Also I have question- I noticed one wierd thing that when I am reading EQEP registers in EPWM ISR it works fine(without moving epwm ISR to Ramfuncs) but when I remove those EQEP registers from my EPWM isr; The ISR triggers with a latency.

    What are we talking about here when you say "triggers with a latency"?  Is it a couple of clock cycles, or are you talking many many cycles?  Is the behavior the same with and without the emulator download?

    You've had multiple strange behaviors going on here.  I'd strongly suggest starting with the code in appnote SPRA958 and going from there.  Code should behave the same whether you are running standalone or after a CCS download, unless something is not initialized correctly in the code and CCS is masking this.  ISR latency is also a very peculiar symptom.  There is nothing in the device itself really that would cause this.  It would have to come from your code, where another ISR is holding off the ISR of interest.

    sagar shah54 said:
    Is there any optimization done by the compiler?

    The compiler has multiple levels of optimization that it can perform.  These are selected with compiler build options by the user in the project options.

    Regards,

    David

  •   I am Sharing images of Picoscope.

    Image 1: Epwm Pulse with varying TBPRD in Standalone mode

    Image 2: Epwm Pulse with constant TBPRD in Standalone mode

    Image 3:  Epwm Pulse with varying TBPRD in flash (not standalone)

    So can you explain is there any relation that when I vary TBPRD in my stand alone code there is this weird behavior?

  • Sagar,

    As David suggested, most likely your application code isn't configured the same way in both standalone and emulation mode.

    Possible debugging clues:-

    1) Are you configuring certain things differently in your application code if you detect emulation connection?

    2) Did you already check whether SYSCLK frequency is same in the both standalone and emulation mode. I get a feeling that your PLL initialization code is NOT getting executed in standalone mode.

    3) Check whether PWMCLKs are running at the same frequency in both standalone and emulation mode?

    4) Are you using CCS gel scripts for configuring PLL in emulation mode?

    Regards.
    Manoj

  • Sagar,

    Did you manage to resolve this issue? Can I close this thread?

    Regards,

    Manoj

  • Yes you can close the thread! Thanks.