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.

TMS320F28335: Trouble Running F28335 from Flash on eZdsp

Part Number: TMS320F28335
Other Parts Discussed in Thread: C2000WARE

Hello, 

I am using the eZdsp F28335 and have a working application in RAM that I am trying to run from FLASH. I believe I am close to making this happen, however when I power cycle the DSP, it seems that the code does not run. I have some CAN messages being sent to a laptop from the DSP upon booting and they don't send after I power cycle the FLASH loaded project. 

I've done three things in attempt to convert the project from RAM to FLASH.

1. Change the SW1 Boot switches to 0000 = Jump to FLASH

2. Added the following commands in my main function:

memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (Uint32)&RamfuncsLoadSize);
InitFlash();

3. Used the stock F28335.cmd file used in the FLASH examples.

All of the FLASH sectors are erased/reporgrammed and the code runs fine after debugging. But when I power cycle the device, I don't see my CAN messages being sent to the computer from the DSP and it appears the program isn't running. Is there something I am missing?

  • Two things come to mind.  The most common thing in this situation is a variable which your code is expecting to be initialized to zero, but isn't.  The debugger will do this for you in RAM, but when you run stand-alone from flash, variables not explicitly initialized by the code could have any value because RAM isn't initialized at reset (on this device).  Check first for un-initialized variables and how the code uses them.

    The other thing is a watchdog timer time-out. There's more on this in section 7 of this application report:

    http://www.ti.com/lit/an/spra958l/spra958l.pdf

    Could you take a look at these two things and let us know?

    Regards,

    Richard

  • Hi Jeff,

    Adding onto Richard's response, please also check that you have the file 'DSP2833x_CodeStartBranch.asm' in your project. This is needed in order for your application to properly jump to flash and is mentioned in the app report Richard linked.

    File located in c2000ware: C:\ti\c2000\C2000Ware_2_00_00_03\device_support\f2833x\common\source

    For more information on what this assembly routine does, see the below:

    https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/396203

    Best,

    Kevin

  • Hello Kevin, Richard,

    Thank for your your assistance. I want to say I can rule out the issue of a watch dog timeout as well as neglecting the codestart asm file (I have this one included for sure) based on the following experiment. I added the toggle of an LED at about 1 Hz in the main, and when I power cycle the DSP, I see the light still blinking. Therefore I believe FLASH is configured properly. 

    But the issue may be that I have uninitialized variables. I am looking into this now. Just to note, I am aware the 1 second delay I have in the main (I have an infinite loop there blinking the LED; interrupts handle the CAN messages) might affect the CAN so I will take it out when looking for uninitialized values. Let me know if this is the proper approach.

  • I think so, that is what I would do anyway.  Keep in mind while your going through the program that code running from flash will be slower than that running from RAM.  If you have anything which is critically dependent on timing, like software delays etc., it should be loaded into RAM before being run.  Section 4 of the application report mentioned earlier deals with that topic.

    Regards,

    Richard

  • Hi Jeff,

    Any update on this issue on your end? Have you been able to resolve it, or do you need more support from us? If resolved I'm going to go ahead and close this thread.

    Thanks,

    Kevin