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.
Windows Embedded Compact 7
Visual Studio 2008
Toradex CE Libraries V2.6
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));
}
Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
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:
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.
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.
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.
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.
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.
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:
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.”