How to configure the External Memory Bus with WEC 2013


how is the right way to configure the imx6-EIM under WCE 2013? Do you provide any Sample Code?

unfortunately we don’t have an EIM-specific library at the moment and the exact configuration depends on the bus width (address and data) and mode (multiplexed or separate address and data lines) you plan to use.
You can use our GPIO library to multiplex the pins to their EIM alternate functions.
You can use MapMemLib to map EIM registers inside your application, then use a pointer to a structure to access them.
In the library download you will find a chm file with a full reference of all the libraries.
EIM is mapped at 0x021B8000 (physical address).
To access the registers you can use this data structure:

/* WEIM registers */
typedef struct {
    UINT32 CS0GCR1;
    UINT32 CS0GCR2;
    UINT32 CS0RD1; 
    UINT32 CS0RD2; 
    UINT32 CS0WR1; 
    UINT32 CS0WR2; 
    UINT32 CS1GCR1;
    UINT32 CS1GCR2;
    UINT32 CS1RD1; 
    UINT32 CS1RD2; 
    UINT32 CS1WR1; 
    UINT32 CS1WR2; 
    UINT32 CS2GCR1;
    UINT32 CS2GCR2;
    UINT32 CS2RD1; 
    UINT32 CS2RD2; 
    UINT32 CS2WR1; 
    UINT32 CS2WR2; 
    UINT32 CS3GCR1;
    UINT32 CS3GCR2;
    UINT32 CS3RD1; 
    UINT32 CS3RD2; 
    UINT32 CS3WR1; 
    UINT32 CS3WR2; 
    UINT32 CS4GCR1;
    UINT32 CS4GCR2;
    UINT32 CS4RD1; 
    UINT32 CS4RD2; 
    UINT32 CS4WR1; 
    UINT32 CS4WR2; 
    UINT32 CS5GCR1;
    UINT32 CS5GCR2;
    UINT32 CS5RD1; 
    UINT32 CS5RD2; 
    UINT32 CS5WR1; 
    UINT32 CS5WR2; 
    UINT32 WCR;
    UINT32 WIAR;
    UINT32 EAR;

hi valter,

thanks for your answer. Now there is the possibility to read the eim-register successfully. But how to write the register? I can’t find a function like “OUTREG32()” in the library reference.

//read the WEIM
_tprintf(TEXT("read: %08x\r\n"), g_pWEIM->CS0GCR1);


you should have

volatile PCSP_WEIM_REGS g_pWEIM 

You can write the same way as read. g_pWEIM->CS0GCR1 = 5 will set register to 5.