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.

TMS320F28035: Application is not running from internal Flash memory

Part Number: TMS320F28035
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Hello,

I am using TI 28035 experiment kit. I changed my program to run from Flash instead of RAM. It worked once but when I power cycled it stopped working 

Referred SPRA958L and its example program but couldn't fix my issue. I am able to run example program "F28035_example_nonBIOS_flash"

 Steps followed:

  • Replaced 28035_RAM_lnk.cmd with F28035.cmd
  • I already had DSP2803x_CodeStartBranch.asm and DSP2803x_Headers_nonBIOS.cmd
  • Declared below variables

 

          // Exeternal defines d by the linker

           extern Uint16 RamfuncsLoadStart;

           extern Uint16 RamfuncsLoadSize;

           extern Uint16 RamfuncsRunStart;

 

  • Added below code after function InitPieVectTable();

 

           // Copy Flash-resident functions to RAM

           memcpy((Uint16*)&RamfuncsRunStart,(Uint16 *)&RamfuncsLoadStart,

                    (unsigned long)&RamfuncsLoadSize); 

              // Enable Flash wait states

              InitFlash();

 

  • In function InitPieCtrl, added this code

            asm(" EALLOW");                     // Enable EALLOW protected register access 

            // Step around the first three 32-bit locations (six 16-bit locations).

           // These locations are used by the ROM bootloader during debug.

           memcpy((Uint16 *)&PieVectTable+6, (Uint16 *)&PieVectTableInit+6, 256-6); 

           asm(" EDIS");                       // Disable EALLOW protected register access

Do I have to configure GPIO 37 and GPIO 34 for boot mode?

  • For standalone flash operation, yes you will need to make both boot pins logic high = 3.3V(VDDIO).  Default action of Get Mode is boot to flash, unless OTP values have been modified.

    Best,

    Matthew

  • My application is not running in debugger mode too. At least it should work in debugger mode even if  I don't make boot pins high, correct?.

    Example program "F28035_example_nonBIOS_flash" doesn't set boot pins. It is working as standalone application in my EVM.

    Can you review my changes and help me to fix the issue

  • Update:

    I am able to run the program in debug mode after replacing "F28035.cmd" file with linker file given in example. Also program runs when I load the program normally.

    Now problem is, it doesn't work after I power cycle

    I ruled out making boot pins high as I am able to run example program after power cycle

  • I would look at this example in C2000Ware C:\ti\c2000\C2000Ware_5_04_00_00\device_support\f2803x\examples\c28\flash_f28035; this will show the needed steps to take to boot to flash for code conversion from RAM.

    One thing to note,in this example there are re-assigned PIE Vectors, I think you want to have the flash to RAM happen after the PIE Vector mem copy and make sure that the new Vectors are assigned correctly.  If you don't have any interrupts this won't matter, but just a thought if these need to run from RAM and there is some assumption of code getting copied.

    Best,

    Matthew

  • Hi Matthew,

    Thank You for your reply. My issue is resolved now. To be frank, I am not sure what was the issue before. Creating fresh project by selecting Flash command file worked.

    I apologize for not updating the thread