• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Microcontrollers » C2000™ Microcontrollers » C2000 32-bit Microcontrollers Forum » SM320F2801 Won't boot from flash
Share
C2000™ Microcontrollers
  • Forums
  • Announcements
  • E2E Wiki
Options
  • Subscribe via RSS
C2000 Resources
  • Product Folder
  • C2000 Training Portal
  • C2000 Technical Training Catalog
  • C2000 Datasheets, App Notes, User Guides
  • C2000 Hardware Design Kits
  • controlSUITE for C2000 Software Library


  • InstaSPIN Resources
  • What is InstaSPIN?
  • Videos and Support


  • InstaSPIN-FOC and InstaSPIN-MOTION Resources
  • What is InstaSPIN-FOC?
  • What is InstaSPIN-MOTION?
  • InstaSPIN Simulation Tool
  • Product Folder: F28069F, F28068F, F28062F, F28068M, F28069M
  • User’s Guide
  • Technical User’s Manual
  • Tools
  • Forums

    SM320F2801 Won't boot from flash

    This question is answered
    Richard Shank
    Posted by Richard Shank
    on Apr 28 2011 12:42 PM
    Expert1455 points

    Hi,

    I've got all my code running and I run from flash just fine if I boot from JTAG through Code Composer v4.  When I turn off power and try to boot the 2801 doesn't boot. 

    I read through SPRA958 and noticed in section 4.1 that I need to copy the PIE Vector Table to RAM.  I'm not doing this yet that I know (unless it's buried in the TI supplied headers/.c files) so I tried inserting the code shown into my main.c.  The compiler came back and stated it couldn't find &PieVectTableInit.  I know it's in the PieVect.c file but my main doesn't see it.

    Should this code go into the PieVect.c file?

    Is this code really needed since I'm already running out of flash when booting from JTAG?

    Please help.  This is my last problem to solve before I deliver to my customer.

    Update:

    I just noticed  I'm not doing all of section 4.4 (of SPRA958) either unless this also is taken care of by the TI supplied headers/.c files.  I have InitFlash in my main.c and InitFlash function in my SysCtrl.c but I don't have the "User's linker command file" stuff in F2801.cmd or Headers_nonBIOS.cmd. 

    Also, SPRA958 shows:

    asm ("RPT #6 || NOP")

    My SysCtrl.c has:

    asm ("RPT # || NOP")

    Is this an issue?

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Richard Shank
      Posted by Richard Shank
      on Apr 28 2011 16:06 PM
      Expert1455 points

      Update:

      My product appears to boot up and go through an initialization test where it runs my motor for 200 ms and then turns on the brake.  I'm pretty sure it is doing this because before I put in the brake it would run the motor and the motor would just spin down instead of stopping.  After I put in the brake command, the motor spins and then comes to an abrupt halt indicative of what I have in my startup test.  After that, I don't get my CAN communication. 

      I'm assuming the problem is associated with moving the PieVectTable to RAM.

      Can someone help with this?  Please refer to the above post with regards to the moving the Pie table issue.

      Thanks,

      Rick

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Lori Heustess
      Posted by Lori Heustess
      on May 03 2011 13:59 PM
      Guru52135 points

      Richard Shank

      Hi,

      I've got all my code running and I run from flash just fine if I boot from JTAG through Code Composer v4.  When I turn off power and try to boot the 2801 doesn't boot. 

      I read through SPRA958 and noticed in section 4.1 that I need to copy the PIE Vector Table to RAM.  I'm not doing this yet that I know (unless it's buried in the TI supplied headers/.c files) so I tried inserting the code shown into my main.c.  The compiler came back and stated it couldn't find &PieVectTableInit.  I know it's in the PieVect.c file but my main doesn't see it.

      Should this code go into the PieVect.c file?

      Is this code really needed since I'm already running out of flash when booting from JTAG?

      Please help.  This is my last problem to solve before I deliver to my customer.

      Richard,

      For debugging stand-alone boot I would like to suggest the debug tips on this wiki page.  Hopefully it can help narrow down the problem:

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

      You may want to take a look at the simple example called "flash"  included in the 280x header files and peripheral examples:

      http://focus.ti.com/mcu/docs/mcuprodcodeexamples.tsp?sectionId=96&tabId=1470

      The example is in: C:\tidcs\c28\DSP280x\v160\DSP280x_examples\flash

      In this code, the "InitPieVectTable();" initalizes the PIE vector table to default ISR routines (they don't do anything - just place holders.)

      To assign your own vector, the code is the same in RAM or in Flash - here is an example.  This changes the EPWM1_INT interrupt vector to point to the epwm1_timer_isr, and soforth.  The cut from the example is shown below:

      // Interrupts that are used in this example are re-mapped to
      // ISR functions found within this file. 
         EALLOW;  // This is needed to write to EALLOW protected registers
         PieVectTable.EPWM1_INT = &epwm1_timer_isr;
         PieVectTable.EPWM2_INT = &epwm2_timer_isr;
         PieVectTable.EPWM3_INT = &epwm3_timer_isr;
         EDIS;    // This is needed to disable write to EALLOW protected registers

      Richard Shank
      I just noticed  I'm not doing all of section 4.4 (of SPRA958) either unless this also is taken care of by the TI supplied headers/.c files.  I have InitFlash in my main.c and InitFlash function in my SysCtrl.c but I don't have the "User's linker command file" stuff in F2801.cmd or Headers_nonBIOS.cmd. 

      If I understand, you are not specifying a run and load address for functions that are in the ramfuncs section.  This can be a issue in particular with the InitFlash.  The flash configuration can not be changed while running from the flash itself.   Doing so can cause the code to ITRAP.  The InitFlash function needs to be loaded into flash and then copied to RAM for runtime. 

      In the C28x header files and peripheral examples, the InitFlash is assigned to the ramfuncs (different than shown in that application note).

      Richard Shank

      Also, SPRA958 shows:

      asm ("RPT #6 || NOP")

      My SysCtrl.c has:

      asm ("RPT # || NOP")

      Is this an issue?

      Yes, the repeat needs to be at least #6 in order to flush the pipeline.  The DSP280x_SysCtrl.c on my machine has #7.

      Regards,

      Lori

       

       

       

       

      Did a reply answer your question? If yes, please click the "yes" button located at the bottom of that post.
      Visit these helpful C2000 Links!
      C2000 TI Wiki Pages
      TI Forum Sitemap
      ControlSUITE
      C2000 Getting Started
      CLA FAQs
      Workshop Material!
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Lori Heustess
      Posted by Lori Heustess
      on May 03 2011 14:02 PM
      Guru52135 points

      Richard Shank

      Update:

      My product appears to boot up and go through an initialization test where it runs my motor for 200 ms and then turns on the brake.  I'm pretty sure it is doing this because before I put in the brake it would run the motor and the motor would just spin down instead of stopping.  After I put in the brake command, the motor spins and then comes to an abrupt halt indicative of what I have in my startup test.  After that, I don't get my CAN communication. 

      I'm assuming the problem is associated with moving the PieVectTable to RAM.

      Can someone help with this?  Please refer to the above post with regards to the moving the Pie table issue.

      Thanks,

      Rick

      Rick

      To see if it is the vectors, I suggest trying the debug step described on this wiki:

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

      When stepping through the code, check the PIE vector table itself to see if the vectors are populated correctly.

      Regards,

      Lori

       

      Did a reply answer your question? If yes, please click the "yes" button located at the bottom of that post.
      Visit these helpful C2000 Links!
      C2000 TI Wiki Pages
      TI Forum Sitemap
      ControlSUITE
      C2000 Getting Started
      CLA FAQs
      Workshop Material!
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Richard Shank
      Posted by Richard Shank
      on May 03 2011 20:58 PM
      Expert1455 points

      Hi Lori,

      Thanks for your help.  I used the debug method from the wiki and I don't really know how to "load symbols only".  I did step through the program and it appears the CAN is not working.  It works fine if I boot off of JTAG but when I recycle power the CAN stops working.  I don't have CAN in my MemCopy to ramfuncs.  I didn't see anywhere that shows how to copy the CAN to MemCopy.  Could this be the issue.

      Incidentally, there is a typo above with regards to my SysCtrl.c.  It has asm (RPT #7 || NOP").   The word formatter on this web page went nuts on me that day and I had to type it in 5 times and I missed the typo the last time.

      Thanks again,

      Rick

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Tim King61612
      Posted by Tim King61612
      on May 03 2011 21:28 PM
      Expert2355 points

      Richard Shank

      I did step through the program and it appears the CAN is not working.  It works fine if I boot off of JTAG but when I recycle power the CAN stops working.  I don't have CAN in my MemCopy to ramfuncs.  I didn't see anywhere that shows how to copy the CAN to MemCopy.  Could this be the issue.

      Generally differences between running code from Flash and from RAM are timing issues.  This may or may not be the case with your CAN code.  However, I recommend putting any time crictical code, particularly ISRs to run from RAM.  This is simply done by placing them in the ramfuncs section using the #pragma.

      e.g.

      #pragma CODE_SECTION(CAN_ISR, "ramfuncs")

      This will copy the code to RAM when all the rest of the ramfuncs code is copied. 

      Richard Shank

      Thanks for your help.  I used the debug method from the wiki and I don't really know how to "load symbols only".

      Try this (only partially tested but I think it does the trick):

      1) Target Menu -> Launch TI Debugger

      2) Target Menu -> Load Symbols.  Choose your program

      3) Target Menu -> Connect Target

       

      Tim

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Richard Shank
      Posted by Richard Shank
      on May 04 2011 08:38 AM
      Expert1455 points

      Thanks Tim but I'm running from flash.  I can boot from JTAG running out of flash and it runs fine but when I cycle power, it comes up and runs my program but I don't have CAN anymore.

      I'll try loading the CAN_ISR to ramfuncs.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Richard Shank
      Posted by Richard Shank
      on May 04 2011 15:33 PM
      Expert1455 points

      Thanks All,

      I had to pack the unit up to ship to the customer and I'm going to the customer for a couple days tomorrow so I didn't get a chance to try the latest suggestions.  If I get time, I'll try the above at the customer's or I'll try to get to it some time next week.  We also have CDR next week so it will be busy.

      I'll get back to you as soon as I get time to test this.

      Again, thanks for the help.

      Rick

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Lori Heustess
      Posted by Lori Heustess
      on May 23 2011 11:54 AM
      Guru52135 points

      Any luck, Rick?

      Did a reply answer your question? If yes, please click the "yes" button located at the bottom of that post.
      Visit these helpful C2000 Links!
      C2000 TI Wiki Pages
      TI Forum Sitemap
      ControlSUITE
      C2000 Getting Started
      CLA FAQs
      Workshop Material!
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Richard Shank
      Posted by Richard Shank
      on May 23 2011 12:11 PM
      Expert1455 points

      Hi Lori,

      After CDR I've been busy with my hardware to do list as I had to clean up a board and get a new one on order.  I have one final hardware test to do today and then I'm back on to software.  This issue is the first on my list.  I'll be back soon.

      Thanks,

      Rick

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Richard Shank
      Posted by Richard Shank
      on May 24 2011 14:23 PM
      Expert1455 points

      I've stepped through the initialization code from the flash entry to my "check for a CAN message" step.  I don't see anything wrong but I'm not a software guru either.  I do see where it appears I'm moving the pie vector table from flash to ram twice.  The first one was already in DSP280x_PieVect.c.  The second one is the memcpy I added because I wasn't sure the first one existed.  Here is a clip from my PieVect.c.

       

       7870.DSP280x_PieVect.pdf

       

      I'm still lost as to what the problem is.  It appears to not see a CAN input.  The code is there (not sure it is correct) but the CAN message is not recognized as being received.  Again, this works fine if I boot off the JTAG.  I can completely disconnect the JTAG after I boot and I run fine.  If I turn off power, the processor won't recognize the CAN until I boot through JTAG.  Every thing else in the code seems to work ok.

      Here is a screen shot of the C and assembly code where the code isn't working. 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Tim King61612
      Posted by Tim King61612
      on May 24 2011 15:48 PM
      Expert2355 points

      Richard Shank

      I'm still lost as to what the problem is.  It appears to not see a CAN input.  The code is there (not sure it is correct) but the CAN message is not recognized as being received.  Again, this works fine if I boot off the JTAG.  I can completely disconnect the JTAG after I boot and I run fine.  If I turn off power, the processor won't recognize the CAN until I boot through JTAG.  Every thing else in the code seems to work ok.

      This may be caused by one of your functions not being mapped into flash properly and thus only works when RAM is loaded (i.e. JTAG).  Just a possibility.  Are you able to post a copy of your .map file?

      Tim

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Richard Shank
      Posted by Richard Shank
      on May 24 2011 16:19 PM
      Expert1455 points

      Hi Tim,

      To my knowledge, I'm running from flash even when I boot from the JTAG.  Anyway, here is my .map file.

       1321.VGC.pdf

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Tim King61612
      Posted by Tim King61612
      on May 24 2011 16:45 PM
      Expert2355 points

      From your map file it seems what you say is true, that you are running the majority of your code from flash.  However, the sections ramfuncs and .cinit seem to reside in RAM.  These are sporadically used functions but may make a difference.  Am I able to see your linker file?

      Tim

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Richard Shank
      Posted by Richard Shank
      on May 25 2011 08:34 AM
      Expert1455 points

      Thanks Tim.  Here it is.  I'm just using the F2801.cmd from the kit.  I haven't changed anything.

      8284.F2801DOTcmd.pdf

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Lori Heustess
      Posted by Lori Heustess
      on May 25 2011 15:04 PM
      Guru52135 points

      Rick,

      In the linker command file there are sections that have a load address into flash and a run address in RAM.

       

      ramfuncs : LOAD = FLASHD,
                          RUN = RAML0,
                          LOAD_START(_RamfuncsLoadStart),
                          LOAD_END(_RamfuncsLoadEnd),
                          RUN_START(_RamfuncsRunStart),

      Have you copied the functions from their load address into their run address?  In our examples this is done with a memcopy routine just inside of main().  Make sure this is first - if you setup the PLL or ADC  before doing this you can find yourself in one of these functions that has not been copied.

      -Lori

      Did a reply answer your question? If yes, please click the "yes" button located at the bottom of that post.
      Visit these helpful C2000 Links!
      C2000 TI Wiki Pages
      TI Forum Sitemap
      ControlSUITE
      C2000 Getting Started
      CLA FAQs
      Workshop Material!
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    1234
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use