I am using Toradex Colibri iMX6DL SBC

I have found one sample code for EIM (External Interface Module) on Toradex site, which link is given below.

I am using below details to build sample code.

  1. Windows Embedded Compact 7
  2. Visual Studio 2008
  3. Toradex CE Libraries V2.6
  4. SBC : Col iMX6DL 512MB IT V1.1B

Using above configuration and build EIM sample code, but it is not working properly.

I am trying to write known data, 1, 2, 3,…,so on, but this data is not written on the allocated memory.

When I am trying to read the data, which is written by me, but it’s return value is zero(0).

Could you please help me to figure out this problem. What is actually happening ?

// Access memory at CS0 address.
// The address range for nCS0 is 0x08000000 to 0x0ffeffff (127MB).
// However, we map only 64kB here.
extBus = (volatile BYTE*)Map_MapMemory(EIMBUS_BASE_ADDRESS, 0x10000);

// 16 x Write
for (i = 0; i <= 15; i++)
{
*(extBus + i) = i; ///< write
printf(“Read data[%d] = %hhd\n”, i, *(extBus + i));
}

Program O/P :-
Read data[0] = 0
Read data[1] = 0
Read data[2] = 0
Read data[3] = 0
Read data[4] = 0
Read data[5] = 0
Read data[6] = 0
Read data[7] = 0
Read data[8] = 0
Read data[9] = 0
Read data[10] = 0
Read data[11] = 0
Read data[12] = 0
Read data[13] = 0
Read data[14] = 0
Read data[15] = 0

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Based on the context provided, it seems you are trying to use the External Interface Module (EIM) on the Colibri iMX6DL with Windows Embedded Compact 7 and are encountering issues with writing and reading data. Here are a few suggestions to help troubleshoot the problem:

  1. Memory Mapping: Ensure that the memory mapping is correctly set up. The base address and size should match the EIM configuration. Double-check the EIMBUS_BASE_ADDRESS and ensure it aligns with the EIM configuration on your hardware.

  2. EIM Configuration: Verify that the EIM is properly configured in your system. This includes setting up the correct chip select, address, and data bus width. The EIM configuration registers need to be correctly initialized before accessing the external memory.

  3. Permissions: Ensure that your application has the necessary permissions to access the memory-mapped I/O. This might involve setting appropriate access rights in your development environment or operating system.

  4. Hardware Connections: Check the physical connections to the external memory device. Ensure that all necessary signals are correctly connected and that there are no hardware issues.

  5. Debugging: Use debugging tools to step through the code and verify that the memory mapping and data writing operations are being executed as expected. This can help identify if the issue is with the code logic or the hardware setup.

  6. Consult Documentation: Refer to the Toradex documentation and any available sample code for the EIM on the Colibri iMX6DL to ensure that all necessary steps are being followed.

If these suggestions do not resolve the issue, it may be beneficial to reach out to Toradex technical support for further assistance, as they can provide more specific guidance based on your setup and configuration.

Please, also check if these links can help you solve your problem:

How to communicate through EIM in C#?.

Could you please specify which external memory you connected to the EIM bus and share schematic snippets depicting its connection to the Colibri iMX6 module.

I am using Toradex “Colibri Evaluation board V3.1a” with “Colibri iMX6DL” on this setup, your EIM sample code build successfully.

I have found another behaver , On “Colibri Evaluation board V3.1a” with “Colibri T20 256MB IT”, using this development environment EIM sample code is working fine without doing a single change, but when I am trying to build this EIM sample on “Colibri Evaluation board V3.1a” with “Colibri iMX6DL” on this development environment, your EIM sample code out o/p is previously maintained.

I am converting from Colibri T20 WinCE project to Colibri iMX6 WinCE project.

#define EIMBUS_BASE_ADDRESS 0x08000000
int i;

on this line
extBus = (volatile BYTE*)Map_MapMemory(EIMBUS_BASE_ADDRESS, 0x10000);

Memory is allocated or no, I don’t know.
But I am getting virtual address every time is 0x00140000. and using this address, I am trying to write known value give below snippet.

// 5x Write
for (i = 0; i < 5; i++)
*(extBus + i) = i; ///< write

// 5 x Read
for (i = 0; i < 5; i++)
tmp = *(extBus + i); ///< read

In the every iteration tmp value is Zero(0), so what can I check ?

Please specify which exactly Colibri T20 sample code you are referring to.

Please note that the EIM bus on the Colibri T20 is completely different from that on the Colibri iMX6. You need to take the code provided in this article and modify the EIM configuration (EIM_CS0GCR1, EIM_CS0GCR2, etc.) to match the parameters of the external memory chip you are using. Simply converting the Colibri T20 WinCE project to a Colibri iMX6 WinCE project will definitely not work.

Sorry, but I don’t understand what do you mean by saying “your EIM sample code out o/p is previously maintained.”

I am taken form below link

" GMI_Sample_Code_T20_T30_r2426.zip"

Hi Alex.tx,

Good morning…

I have 2 question related conversion Colibri T20 to Colibri iMX6DL.

In Colibri T20, we are used this below call

  1. setFreq = ClkLibSetClockFrequency(SNOR_CLK_TEG, 50000000, 60000000,(tClockOptimise) FALSE);
  2. g_gmiReg->SNOR_CONFIG_0 = SNOR_SEL_CS2;

Which functions, I will use instead of above function in Colibri iMX6.

Hi, is any one know about below function, and which function used in iMX6DL instead of below functions. and how to select CS1 in iMX6DL.

  1. setFreq = ClkLibSetClockFrequency(SNOR_CLK_TEG, 50000000, 60000000,(tClockOptimise) FALSE);
  2. g_gmiReg->SNOR_CONFIG_0 = SNOR_SEL_CS2;

Any update or any hints.