• 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 » enet_uip_m3 example and the uDma access on Concerto
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
  • Forums

    enet_uip_m3 example and the uDma access on Concerto

    This question is answered
    Ronaldo Pace
    Posted by Ronaldo Pace
    on Apr 04 2012 04:39 AM
    Intellectual875 points

    The project I'm currently working uses the enet_uip_m3 as the base for the ethernet comms and everything is working fine.

    The problem is: this example uses the F28M25x_generic_M3_RAM.cmd and F28M25x_generic_M3_FLASH.cmd linker files and neither of those uses the shared Sx memory, and my project will be using it. But if I try to add those areas, the ethernet stops working.

    I'm assuming that, although not shown on the linker file, uDMA configured on enet_uip_m3 is using that area to process it's stuff and thou, conflicting with the rest of my code.

    So my questions are:

    is my assumption correct? how to I check which areas the uDMA is using?

    thanks.

    concerto f28m25x udma dma linker cmd memory
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Ronaldo Pace
      Posted by Ronaldo Pace
      on Apr 05 2012 06:47 AM
      Verified Answer
      Verified by Ronaldo Pace
      Intellectual875 points

      I can't explain exactly WHY it's working now but I made it working.

      I started tracking the addressing of stuff through the codes starting on the udma.h where we have the tDMAControlTable struct with a:

              // The ending source address of the data transfer.
      volatile void *pvSrcEndAddr; 

      ok , 'source address' that looks good, let's see where it's used, so I went to udma.c and found that it gets this address from pvSrcAddr that comes from this call:

      void uDMAChannelTransferSet(unsigned long ulChannelStructIndex,
      unsigned long ulMode, void *pvSrcAddr, void *pvDstAddr,
      unsigned long ulTransferSize)

      so then, I went to track on the enet_uip_m3 code where this is being called and we have two lines that does the call:

      	// Set up the DMA to transfer the Ethernet header when a packet is received
      uDMAChannelTransferSet(UDMA_CHANNEL_ETH0RX, UDMA_MODE_AUTO, (void *) (ETH_BASE + MAC_O_DATA), &pucBuf[2], lTempLen >> 2);

      and

      	// Configure the TX DMA channel to transfer the packet buffer.
      uDMAChannelTransferSet(UDMA_CHANNEL_ETH0TX, UDMA_MODE_AUTO, pucBuf, (void *) (ETH_BASE + MAC_O_DATA), lBufLen >> 2);

      which gives us two values to look at (in bold letters). ETH_BASE is defined on hw_memmap.h and it's a 0x40048000, all the way up on the peripheral registers mapping, so this definitely not the problem. Let's find pucBuf; it's being passed from this call:

      static long EthernetPacketPutDMA(unsigned long ulBase, unsigned char *pucBuf, long lBufLen);

      ok, let's see who is calling it; there's quite a few of calls but all of them pass the same uip_buf parameter; a few more searches and we find it being defined as a normal pointer to a u8_t and it's set to point to:

      	// Adjust the pointer to be aligned on an odd half word address so that DMA can be used.
      uip_buf = (u8_t *) (((unsigned long) ucUIPBuffer + 3) & 0xfffffffe);

      which is just that buffer declared there: u8_t ucUIPBuffer[UIP_BUFSIZE + 2];

      So, it shouldn't have problem at all ... so let's try to see again what would be the difference between the linker files with and without the Sx memory. Well, besides the obvious inclusion of the S0 areas... on the generic, the variable data is stored across the RAM

          .vtable :   >  C0 | C1 | C2 | C3
      .data : > C2 | C3
      .bss : >> C2 | C3
      .sysmem : > C0 | C1 | C2 | C3
      .stack : > C0 | C1 | C2 | C3

      while the example linker with the shared memory was all using C0 ... so I replace that line to include all the RAM and the thing started working almost as magic (but it's hard work science engineering and a bit of guessing).

      If anyone could the WHY of it all, I guess would be a good addition to the forum, but in any case, I'm marking my response as correct.

      Thanks for reading!

      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 Apr 05 2012 15:17 PM
      Expert7420 points

      Pace,

      Thanks a lot for your detailed debug and thanks for sharing it all.

      C0 and C1 memories on Master subsytem are not uDMA accessible. So the example linker command file for shared RAM(s) usage has to be corrected so that it does't place any data sections in C0/C1 RAM(s). Generic linker command files seems to be corrected in the latest countrolsuite release - we will update the shared RAM usage linker command files too.

      Also, please check the errata on uDMA - so that you are aware of it. Not that you are running into that same issue.

      Best Regards

      Santosh

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Balazs Vezsenyi
      Posted by Balazs Vezsenyi
      on Aug 10 2012 04:53 AM
      Prodigy70 points

      Santosh,

       I've a similar task to do with uDMA and ethernet controller, maybe you can help me.

      With the concerto unit, I have to write the shared memory continually and access to it at the same time.

      My question is:is it possible? I checked the errata of the Concerto MCUs and I've doubt about it:

      "If μDMA accesses Shared RAM (Cx and Sx) or MSG RAM when any other master
      (Cortex™-M3/C28x/DMA) accesses the same memory, data and parity may get
      corrupted in the memory."

      In my solution the c28 core saves its data to S0 shared RAM.

      I'd like to access to it with the uDMA controller from the M3 side and send it via ethernet...

       

      So any suggestion would be appreciate about this problem..

      Thanks,

      Balazs

      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 10 2012 13:12 PM
      Expert7420 points

      Balazs,

      That errata is valid for REV0 of Si, we are fixing it in the next REV.

      Depending on how you write your SW, you might not see the issue in your case, you can use IPC to realize a mutex operation on Sx RAM.

      > 1. C28 writes data to S0 RAM

      > 2. Sends IPC to Master and waits for IPC to clear.

      > 3. Master waits for it and receives the IPC and enables uDMA to transmit the data out

      >4. When master is done, it either sends an IPC back or clear the IPC it got in step 2.

      if you want to avoid waits in step2 and step3 you can two buffers in S0 RAM and alternatively switch between each of them. Depending on how fast C28 can give the new data for M3 to be transmitted you can do one of the above. Atleast this can be a good starting point.

      Pleaes let us know if you have any more questions. Our uDMA expert is monitoring this thread and he will chime in as needed.

       

      Best Regards

      Santosh

       

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Balazs Vezsenyi
      Posted by Balazs Vezsenyi
      on Aug 14 2012 01:57 AM
      Prodigy70 points

      Santosh,

      Thanks for the idea.

      If I willl have critical timings in my solution -so uDMA will necessary- something like this is going to be implemented.

      regards,

      Balazs

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Mason
      Posted by Mason
      on Feb 21 2013 17:01 PM
      Prodigy150 points

      Hi Santosh,

      We are experiencing the same problem with enet_uip and DMA refusing to interrupt on the Concerto. I looked into the linker files provided in the ControlSuite latest version and couldn't find anything for the ARM with shared memory. Could you send me an example ARM linker file that solves this problem.

      Thanks,

      Mason

      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 22 2013 11:00 AM
      Expert7420 points

      Mason,

      the problem could be different, can you open a new forum post explaining the scenario? and which device you are looking at 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.
    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