• 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 » Concerto problem when running 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?
  • Product Folder: F28069F, F28068F, F28062F, F28068M, F28069M
  • User’s Guide
  • Technical User’s Manual
  • Tools
  • Concerto problem when running from Flash

    Concerto problem when running from Flash

    This question is answered
    Pablo Garcia
    Posted by Pablo Garcia
    on Aug 16 2012 04:13 AM
    Prodigy150 points

    Hi,

    We are developing a program which needs to be run from Flash. The program is working propertly when running from RAM but M3 core halts when running from flash. After debugging the problem has been narrowed to the following:

    - M3 correctly starts C28 core

    - C28 core calls a IPCLite function in order to communicate to the M3:

    IPCLiteCtoMFunctionCall(IPC_FLAG1, pulMsgRam[0], buff_pos, IPC_FLAG32);

    -  C28 continues working ok

    - M3 halts because trying to execute something at 0xfffffffe

    In order to propertly run the code from Flash we have following all the recommend steps indicated in v130\F28M35x_examples_Dual\flash\m3\flash_m3.c. Additionally, the changes included in this thread: http://e2e.ti.com/support/microcontrollers/tms320c2000_32-bit_real-time_mcus/f/171/p/116460/488697.aspx has been followed, except for the change from the IntRegister to IntRAMRegister, being the reason that the second one macro is not found.

    I am using V1.30 version for the ControlSuite. 

    Attached are the .cmd and .map files for both cores.

    7367.TarjetaAD_TCP_IP_m3_map.txt

    [View:http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-3681.TarjetaAD_TCP_IP_C28_map.txt

    2146.F28M35x_generic_wshared_C28_FLASH_cmd.txtfiles/171/7610.F28M35x_5F00_generic_5F00_wshared_5F00_M3_5F00_FLASH_5F00_cmd.txt]

    Any help will be appreciated.

    Regards,

    Pablo

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Santosh Athuru
      Posted by Santosh Athuru
      on Aug 16 2012 10:53 AM
      Expert7400 points

      Pablo

      Pablo Garcia

      IPCLiteCtoMFunctionCall(IPC_FLAG1, pulMsgRam[0], buff_pos, IPC_FLAG32);

      its possibly the above line of code. what is the address of the function that you are asking Master to call? This function sends an IPC message to master application, with the function address as parameter. Make sure that is what you want and also make sure that there is a valid function loaded on M3 before you send this message to it. You could repleace this function with a simple READ/WRITE IPCLite call and see if the application is good, then add on to it.

      Please let us know if you have any more questions.

      Best Regards

      santosh

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Pablo Garcia
      Posted by Pablo Garcia
      on Aug 16 2012 12:48 PM
      Prodigy150 points

      Dear Santosh,

      yes, I've also checked that the address was ok. The function is located at the same address stored in the pointer (C28ADNewData). When I hit this problem it was my first idea, but no luck.

      I will also try to test if a read IPC command works, but for our application we really need to call a function in order to make some actions.

      Have you looked at the .map/.cmd files?

      Regards,

      Pablo

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Santosh Athuru
      Posted by Santosh Athuru
      on Aug 16 2012 13:30 PM
      Expert7400 points

      Pablo,

      it could be that the function is not returning properly or corrupting the stack?

      you can also put a break point in the function and step through and see? also try calling that function first from your M3 appication code and see if it returns properly.

      Best Regards

      santosh

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Pablo Garcia
      Posted by Pablo Garcia
      on Aug 16 2012 14:54 PM
      Prodigy150 points

      Santosh,

      the function never is called when using IPC, instead the code jumps directly to the address I posted in my first message. I also tried to call it directly from M3 and in that case it is executed ok, so it does not seem a corruption in the stack (at least not before the IPC call).

      Regards,

      Pablo

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Santosh Athuru
      Posted by Santosh Athuru
      on Aug 16 2012 15:40 PM
      Expert7400 points

      Pablo,

      that means M3 is not able to get the address properly, can you give me the values of the below, that will help figure out what is going wrong here.

      On C28x, before calling IPCLiteCtoMFunctionCall()

      > what is the value of pulMsgRam[0] -> is it a 32 bit value?

      > what is the value of buff_pos

      On C28x, after calling IpcLiteCtoMFunctionCall()

      what is the value of the below registers?

          CtoMIpcRegs.CTOMIPCCOM = ?;
          CtoMIpcRegs.CTOMIPCADDR = ?;
          CtoMIpcRegs.CTOMIPCDATAW = ?;

       

      Does M3 see IPC interrupt at all? if yes, can you put a break point in the interrupt service routine and give the values that M3 sees in its memory map for the above registers?

      Does the application work fine if you don't call the IPCLiteCtoMFunctionCall, but instead call some any other simple read/write IPCLiteCtoM* call?

       

      Best Regards

      Santosh

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Pablo Garcia
      Posted by Pablo Garcia
      on Aug 17 2012 01:27 AM
      Prodigy150 points

      Dear Santosh,

      - on C28x, before calling IPCLiteCtoMFunctionCall()

      - value for pulMsgRam[0] is 0x2000075D, this is the address for the C28ADNewBuffer function in the M3 and it is a 23 bit value

      - buff_pos is an index accessing a vector, its value in the first call is 0 as it should be

      - these are the values for the registers in the C28x after calling IPCLiteCtoMFunctionCall()

      CtoMIpcRegs.CTOMIPCCOM = 0x12;
      CtoMIpcRegs.CTOMIPCADDR = 0x2000075D;
      CtoMIpcRegs.CTOMIPCDATAW = 0;

      As you can see, everything is right here. I also had made this debug before posting at the forum,

      Even more, the M3 core is ok until the C28x forces IPC event:

      CtoMIpcRegs.CTOMIPCSET.all |= (ulFlag | ulStatusFlag);

      inside the IPCLiteCtoMFunctionCall() 

      - The M3 does not reach the interrupt handler, which is CtoMIPC1IntHandler. The address of the interrupt handler is 0x200006C4 

      - using other IPC call:

      IPCLiteCtoMDataRead(IPC_FLAG1, pulMsgRam[0], IPC_LENGTH_32_BITS,IPC_FLAG32);

      causes the same error and after executing

       CtoMIpcRegs.CTOMIPCSET.all |= (ulFlag | ulStatusFlag);

      M3 core is again at 0xfffffffe

      Regards,

      Pablo

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Pablo Garcia
      Posted by Pablo Garcia
      on Aug 17 2012 02:26 AM
      Verified Answer
      Verified by Santosh Athuru
      Prodigy150 points

      Santosh,

      I have solved the problem. The CtoMIPC1IntHandler was not registered:

      IntRegister(INT_CTOMPIC1, CtoMIPC1IntHandler);

      I missed this one because it is also missed in your examples: F28M35x_examples_Dual\ctom_ipcdrivers_lite\m3\ctom_ipcdrivers_lite_m3.c 

      and because it works when executed from RAM. Where is the interrupt vector address assigned in that case?

      Regards,

      Pablo

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Santosh Athuru
      Posted by Santosh Athuru
      on Aug 17 2012 09:31 AM
      Expert7400 points

      Pablo,

      I guess I know the issue, the examples have to be updated for running from flash yet. I should have asked whether you are running from flash or RAM earlier.

      When the code is executed from RAM, NVIC TABLE is pointed to RAM locations in your main properly and that RAM location is initialized by the table during CCS load. When the code is linked to run from flash, no one is initializing the NVIC table in RAM but main is still pointing it to the location.

      The IntRegister function call, checks for that error and auto corrects the scenario by copying the table from flash to RAM. If the main() doesn't call IntRegister, then the handler is not registers and the program goes to weeds. That is what is happening.

      we are fixing the issue in next release of controlSuite.

      Best Regards

      Santosh

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • William Perdikakis
      Posted by William Perdikakis
      on Feb 14 2013 07:53 AM
      Intellectual520 points

      Santosh,

      Sorry for resurrecting this thread, but do you have an example of code that calls IntRegister?

      Right now, all I am trying to do is get a simple program to run without the use of an emulator on a controlCard.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Santosh Athuru
      Posted by Santosh Athuru
      on Feb 14 2013 08:54 AM
      Expert7400 points

      Will,

      did you check the driverlib the interrupt.c file it should have functions that access the NVIC interrupt registers, if that is what you are asking?

      which device you are trying on, F28M35x or F28M36x?

       

      Best Regards

      santosh

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • William Perdikakis
      Posted by William Perdikakis
      on Feb 14 2013 09:07 AM
      Intellectual520 points

      The 35x.

      My problem is that I can not get any program running unless I run it from the emulator.  I have tried using the blinky project, setting the M3 side to Flash or Flash Stand-alone and it will not run after a power cycle.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Santosh Athuru
      Posted by Santosh Athuru
      on Feb 14 2013 09:20 AM
      Verified Answer
      Verified by Santosh Athuru
      Expert7400 points

      are the boot mode pins set to boot to flash? with emulator connected, after loading the application in flash, set a breakpoint at main() and do a debug reset and RUN. Device should run through the bootROM and enter main(), if that is working then I don't see a reason why it won't work in stand-alone.

       

      Best Regards

      santosh

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • William Perdikakis
      Posted by William Perdikakis
      on Feb 14 2013 10:00 AM
      Intellectual520 points

      Embarrassing!  The jumper pins are set to ON by default on these controlCards which sets the Boot pins to all 0000...

      I thought they were all off.  SIGH!

      It works now.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    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