• 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 » ARM® Processors » Sitara™ ARM® » AM3x Sitara ARM Processors Forum » GPMC interface to external memory device (FPGA)
Share
Sitara™ ARM®
  • Forum
  • Announcements
Options
  • Subscribe via RSS

GPMC interface to external memory device (FPGA)

GPMC interface to external memory device (FPGA)

This question is not answered
Jure Zaninovich
Posted by Jure Zaninovich
on May 30 2012 20:31 PM
Prodigy160 points

We are interfacing an FPGA as a 16bit wide memory device ising the GPMC.

We have used the info as indicated below to have our system work, but we have some issues.

The configuration of the GPMC is rather involved, and we have tweaked it in order to satify our timen requirements.

 We have not optimized the timings yet.

Our test software produces two 16 bit wide writes, and we are OK with this.

In the case of read operations, a single 16 bit wide read transaction is produced,

and to actually receive the correct data, we need two reads.

Could any one please suggest what is happening here , and a way to resolve it ?

My impression is that we have a GPMC parameter wrong.

I'll post the configuration parameters in a follow up post.

 

Thanks, Jure Z.

 

=======================================================================================

We used the info in the thread:

http://e2e.ti.com/support/dsp/sitara_arm174_microprocessors/f/791/p/176492/643640.aspx#643640http://e2e.ti.com/support/dsp/sitara_arm174_microprocessors/f/791/t/190352.aspx

which points to the example file:

1641.GPMC_DRAM_example.zip

 

 

Sitara AM335x AM3359 GPMC external memory FPGA timing ICE
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Jure Zaninovich
    Posted by Jure Zaninovich
    on May 30 2012 20:46 PM
    Prodigy160 points

    These are the parameters, sniping some of the code:

     

    //## GPMC_CONFIG1 // configure for NOR and granularity x2

    temp = 0x01200; // device type 16 bit wide

    HWREG(SOC_GPMC_0_REGS + GPMC_CONFIG1(csNum)) = temp;

     

    //## GPMC_CONFIG2

    temp = 0x070B00;

    HWREG(SOC_GPMC_0_REGS + GPMC_CONFIG2(csNum)) = temp;

     

    //## GPMC_CONFIG3

    temp = 0x020200;

    HWREG(SOC_GPMC_0_REGS + GPMC_CONFIG3(csNum)) = temp;

     

    //## GPMC_CONFIG4

    temp = 0x07050606;

    HWREG(SOC_GPMC_0_REGS + GPMC_CONFIG4(csNum)) = temp;

     

    //## GPMC_CONFIG5

    temp = 0x08070A;

    HWREG(SOC_GPMC_0_REGS + GPMC_CONFIG5(csNum)) = temp;

     

    //## GPMC_CONFIG6

    temp = 0x07040000;

    HWREG(SOC_GPMC_0_REGS + GPMC_CONFIG6(csNum)) = temp;

     

    //## GPMC_CONFIG7

    temp = 0x0F49;

    HWREG(SOC_GPMC_0_REGS + GPMC_CONFIG7(csNum)) = temp;

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jure Zaninovich
    Posted by Jure Zaninovich
    on May 30 2012 21:57 PM
    Prodigy160 points

    and here is a more detailed table using the TRM table format:

    7.1.5.11 GPMC_CONFIG1_i

    The configuration 1 register sets signal control parameters per chip select.

    Table 7-65. GPMC_CONFIG1_i Field Descriptions

    31 WRAPBURST: 0 Synchronous wrapping burst not supported

    30 READMULTIPLE: 0 single access

    29 READTYPE: 0 Read Asynchronous

    28 WRITEMULTIPLE: 0 Single access

    27 WRITETYPE: 0 Write Asynchronous

    26-25 CLKACTIVATIONTIME : 0 First rising edge of GPMC_CLK at start access time

    24-23 ATTACHEDDEVICEPAGELENGTH : 0 4 Words

    22 WAITREADMONITORING :0 WAIT pin is not monitored for read accesses

    21 WAITWRITEMONITORING : 0 WAIT pin is not monitored for write accesses

    20 Reserved 0 Reserved

    19-18 WAITMONITORINGTIME : 0 WAIT pin is monitored with valid data

    17-16 WAITPINSELECT :0 WAIT input pin is WAIT0

    15-14 Reserved 0 Reserved

    13-12 DEVICESIZE 1h 16 bit

    11-10 DEVICETYPE :0 NOR Flash like, asynchronous and synchronous devices

    9-8 MUXADDDATA : 2h Address and data multiplexed attached device

    7-5 Reserved 0 Reserved

    4 TIMEPARAGRANULARITY : 0 ×1 latencies

    3-2 Reserved : 0 Reserved

    1-0 GPMCFCLKDIVIDER : 0 GPMC_CLK frequency = GPMC_FCLK frequency

    ------------------------------------------------

    7.1.5.12 GPMC_CONFIG2_i

    Chip-select signal timing parameter configuration.

    Table 7-66. GPMC_CONFIG2_i Field Descriptions

     

    31-21 Reserved 0 Reserved

    20-16 CSWROFFTIME : 7 GPMC_FCLK cycles

    15-13 Reserved 0 Reserved

    12-8 CSRDOFFTIME :0xB GPMC_FCLK cycles

    7 CSEXTRADELAY : 0 CS i Timing control signal is not delayed

    6-4 Reserved 0 Reserved

    3-0 CSONTIME 0 0 GPMC_FCLK cycle

    -----------------------------------------------------

    7.1.5.13 GPMC_CONFIG3_i

    ADV# signal timing parameter configuration.

    Table 7-67. GPMC_CONFIG3_i Field Descriptions

     

    31 Reserved 0 Reserved

    30-28 ADVAADMUXWROFFTIME : 0 0 GPMC_FCLK cycle

    27 Reserved 0 Reserved

    26-24 ADVAADMUXRDOFFTIME : 0 0 GPMC_FCLK cycle

    23-21 Reserved 0 Reserved

    20-16 ADVWROFFTIME : 2 GPMC_FCLK cycles

    15-13 Reserved 0 Reserved

    12-8 ADVRDOFFTIME : 2 GPMC_FCLK cycles

    7 ADVEXTRADELAY : 0 ADV Timing control signal is not delayed

    6-4 ADVAADMUXONTIME : 0 0 GPMC_FCLK cycle

    3-0 ADVONTIME : 0 0 GPMC_FCLK cycle

    ---------------------------------------------------------

    7.1.5.14 GPMC_CONFIG4_i

    WE# and OE# signals timing parameter configuration.

    Table 7-68. GPMC_CONFIG4_i Field Descriptions

     31-29 Reserved 0 Reserved

    28-24 WEOFFTIME : 7 GPMC_FCLK cycles 

    23 WEEXTRADELAY : 0 WE Timing control signal is not delayed

    22-20 Reserved 0 Reserved 

    19-16 WEONTIME : 5 GPMC_FCLK cycles

    15-13 OEAADMUXOFFTIME : 0 0 GPMC_FCLK cycle 

    12-8 OEOFFTIME : 6 GPMC_FCLK cycles

    7 OEEXTRADELAY : 0 OE Timing control signal is not delayed 

    6-4 OEAADMUXONTIME : 0 0 GPMC_FCLK cycle

    3-0 OEONTIME : 6 GPMC_FCLK cycle

     ------------------------------------------------

    7.1.5.15 GPMC_CONFIG5_i

    RdAccessTime and CycleTime timing parameters configuration.

    Table 7-69. GPMC_CONFIG5_i Field Descriptions

     

    31-28 Reserved 0 Reserved

    27-24 PAGEBURSTACCESSTIME : 0 0 GPMC_FCLK cycle

    23-21 Reserved 0 Reserved

    20-16 RDACCESSTIME : 0xA GPMC_FCLK cycles

    15-13 Reserved 0 Reserved

    12-8 WRCYCLETIME : 7 GPMC_FCLK cycles

    7-5 Reserved 0 Reserved

    4-0 RDCYCLETIME : 0xA GPMC_FCLK cycles

    ---------------------------------------------------------

    7.1.5.16 GPMC_CONFIG6_i

    Table 7-70. GPMC_CONFIG6_i Field Descriptions

    31-29 Reserved 0 Reserved

    28-24 WRACCESSTIME : 7 GPMC_FCLK cycles

    23-20 Reserved 0 Reserved

    19-16 WRDATAONADMUXBUS : 4

    15-12 Reserved 0 Reserved

    11-8 CYCLE2CYCLEDELAY :0 0 GPMC_FCLK cycle

    7 CYCLE2CYCLESAMECSEN :0 No delay between the two accesses

    6 CYCLE2CYCLEDIFFCSEN :0 No delay between the two accesses

    5-4 Reserved 0 Reserved

    3-0 BUSTURNAROUND : 0 0 GPMC_FCLK cycle

     

    -----------------------------------------------------

    7.1.5.17 GPMC_CONFIG7_i

    Chip-select address mapping configuration.

    Table 7-71. GPMC_CONFIG7_i Field Descriptions

     

    31-12 Reserved 0 Reserved

    11-8 MASKADDRESS 0xF Chip-select size of 16 Mbytes

    7 Reserved 0 Reserved

    6 CSVALID : 1 CS enabled

    5-0 BASEADDRESS : 9 Chip-select base address.

    ========================================================= 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jure Zaninovich
    Posted by Jure Zaninovich
    on Jun 06 2012 15:41 PM
    Prodigy160 points

    bump

    no answer...

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Brad Griffis
    Posted by Brad Griffis
    on Jun 06 2012 17:58 PM
    Guru57350 points

    What happens on the bus?  You'll need to look at the resulting transfers/timing to understand the root of the issue.  For starters, are you seeing both accesses on the bus?  Is the FPGA returning invalid data for the first read, but valid data for the second read?

    ---------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------- 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jure Zaninovich
    Posted by Jure Zaninovich
    on Jun 07 2012 04:46 AM
    Prodigy160 points

    on the read cycles, the processor drives the bus with stale data, data being correct for the previous access.

    a workaround would be to do double reads, (ignoring side effects).

    Write cycles, as stated , are just fine.

    Thanks, Jure Z.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Brad Griffis
    Posted by Brad Griffis
    on Jun 07 2012 17:17 PM
    Guru57350 points

    Jure Zaninovich
    on the read cycles, the processor drives the bus with stale data, data being correct for the previous access.

    What makes you think the processor is driving the bus with stale data?  For the case of a read my expectation is for the external device to do the driving of the bus.  Are you using the GPMC in a muxed or non-muxed mode?

    ---------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------- 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jure Zaninovich
    Posted by Jure Zaninovich
    on Jun 07 2012 19:44 PM
    Prodigy160 points

    we are capturing the data with chipscope ( Xilinx built in logic analyzer device probing the pins)

    yes we are configuring the GPMC in muxed mode as listed in earlier post:

     

    7.1.5.11 GPMC_CONFIG1_i

    9-8 MUXADDDATA : 2h Address and data multiplexed attached device

    Key: 

    0 Non-multiplexed attached device

    1h AAD-multiplexed protocol device

    2h Address and data multiplexed attached device

    3h Reserved

     

    I'll have to withdraw my statement  "the processor drives the data bus" , now that I think again, after you mentioned it.

    A better statement would be, " the data bus assumes the values that correspond to the previous read cycle".

    This clarification may lead into the posibility of something being wrong with the FPGA design itself...

     

     

    Thanks, Jure Z.

     

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Brad Griffis
    Posted by Brad Griffis
    on Jun 08 2012 15:45 PM
    Guru57350 points

    Jure Zaninovich

    I'll have to withdraw my statement  "the processor drives the data bus" , now that I think again, after you mentioned it.

    A better statement would be, " the data bus assumes the values that correspond to the previous read cycle".

    Aside from driving the address onto the pins, the processor would not be driving the bus.  It sounds to me like either you don't have the correct timing to talk to the FPGA or else something is wrong inside the FPGA itself.  If there is some kind of delay internal to the FPGA upon receiving the address you might need to implement a WAIT pin so the FPGA can temporarily stall the transfer until it has the data ready.

    ---------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------- 

    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