All Forums
 Microsoft Windows CE
 .NET Application Development
 Buildin CIO driver for .NET ?
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

nghia

36 Posts

Posted - 10 Mar 2003 :  10:35:29  Show Profile  Email Poster
Hi,

ADS CE 3.0 has a build in CIO1: driver and CIOtest program as a example howto access to the Ethernet controller LAN911C.
Since I upgrade to CE.NET 4.12, I can not open the CIO driver to access the LAN911c registers because the CE.NET doesn't have CIO driver.

1. Which driver in CE.NET has the same function like CIO driver in
CE 3.0 to access the LAN911c controller ?
2. Does it have the CIOtest program for CE.net ?
3. Is the LAN911c address map change in CE.NET 4.12 ?

Best Regards.

Nghia.

akidder

1519 Posts

Posted - 14 Mar 2003 :  16:27:48  Show Profile  Email Poster
Hi Nghia:

As we discussed earlier this week, we're phasing out the WinCE CIO1: driver in favor of the faster CF driver library we've recently developed. You can find that driver posted at topic 845.

While it will take a few minutes to convert your code over to the new driver format, I think you will find the performance improvements well worth your while. Let us know how it goes!
Go to Top of Page

nghia

36 Posts

Posted - 21 Mar 2003 :  15:39:12  Show Profile  Email Poster
Hi Drew,

It doen't work on my ADS development system running CE 4.12 ( BitSy Plus). I compile with eVC++ 4.0
The following message is a debug output:

========Debug output ========
Fbus.exe
coredll.dll

---- 5 minutes left in test ----

GPIO_CTRL_REGISTER: 0x00070000
GPIOCtrl old: 0x00000008
GPIOCtrl new: 0x00000008
Data:
{test data cropped for clarity}

0x2c000000 mapped to: 0x00080000
MEM_CTRL_REGISTER: 0x00090000
FAST = 1:
Slot 0 reset
Setting memory speed to 0x1f
MECR old: 0x8545f145
MECR new: 0x8545fd45
Writing...
Write failure
W>> 0x18fe 0xe82 0x89 0x36ea 0x21d5 0x5c9c 0x8a3 0x42ab
R>> 0x8b8b 0x8b8b 0x8b8b 0x8b8b 0x8b8b 0x8b8b 0x8b8b 0x8b8b

Setting memory speed to 0x1e
MECR old: 0x8545ed45
MECR new: 0x8545f945
Writing...
Write failure
W>> 0x18fe 0xe82 0x89 0x36ea 0x21d5 0x5c9c 0x8a3 0x42ab
R>> 0x00 0x8b8b 0x8b8b 0x8b8b 0x8b8b 0x8b8b 0x8b8b 0x8b8b

{etc.}


===== End Debug output ============

Nghia.
Go to Top of Page

ctacke

877 Posts

Posted - 21 Mar 2003 :  17:22:09  Show Profile  Email Poster
I discussed this problem with Nghia and it turns out that he had nothing in the PCMCIA slot when he ran the test.

As the header of the application code states, this test writes to the PCMCIA slot and then reads back the same address for comparison. This works only if there is a card in the slot and the Memory space is writeable (i.e. an SRAM card).
Go to Top of Page

nghia

36 Posts

Posted - 07 Apr 2003 :  13:29:26  Show Profile  Email Poster
Hi Chis,

We buy a new CF memory and insert into a PCMCIA Slot and run the ReadPCMCIA application. I get the folloeing result:

1.EthernetDetectThread: OK.
2.ReadWriteTestThread : Fail.
3.ReadOnlyTestThread : Fail.


DEBUG output:
Ethernet Controller Detect:
[…
*** ADSLOAD.EXE (do nothing build): Complete ****
Checking if extended keep alive timeouts feature is set...No
0x38000000 mapped to: 0x00070000
Ethernet chip detected.
Chip ID: 9 (SMSC 91C11) Revision: 1
..]


ReadWrite Memory Test:
[..
Checking if extended keep alive timeouts feature is set...No
Checking if extended keep alive timeouts feature is set...No
GPIO_CTRL_REGISTER: 0x00070000

---- 1 minutes left in test ----

GPIOCtrl old: 0x0000000b
GPIOCtrl new: 0x00000009
Data:
..]

ReadOnly memeory:
[….
Checking if extended keep alive timeouts feature is set...No
GPIO_CTRL_REGISTER: 0x00070000

---- 1 minutes left in test ----

GPIOCtrl old: 0x0000000a
GPIOCtrl new: 0x0000000a
0x38000000 mapped to: 0x00080000
Slot 1 reset
MEM_CTRL_REGISTER: 0x00090000
Setting memory speed to 0x1f
MECR old: 0x85458145
MECR new: 0xfd458145
GPIOCtrl old: 0x0000000a
GPIOCtrl new: 0x0000000a
Slot 1 reset
Reading...
inconsistent read!
LAST>> 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
THIS>> 0x0ff2 0x8b8b 0x8b8b 0x8b8b 0x8b8b 0x8b8b 0x8b8b 0x8b8b

inconsistent read!
LAST>> 0x0ff2 0x8b8b 0x8b8b 0x8b8b 0x8b8b 0x8b8b 0x8b8b 0x8b8b
THIS>> 0x0707 0x0707 0x0707 0x0707 0x0707 0x0707 0x0707 0x0707
…]


2. Beside that I integrated the MappAddress(..) function into my CPcmciaCF C++ class as follow:

LPVOID CPcmciaCF::MapAddress(DWORD dwPhyBaseAddress)
{
DWORD LastError = -1;
LPVOID pAddr = (DWORD *)VirtualAlloc(NULL, MEMORY_SIZE, MEM_RESERVE, PAGE_READWRITE);

if(pAddr)
{
RETAILMSG(1, (_T("Virtual Alloc OK\r\n")));
if(VirtualCopy (pAddr, (LPVOID)(dwPhyBaseAddress >> 8), (DWORD)MEMORY_SIZE,
(DWORD) PAGE_PHYSICAL | PAGE_READWRITE | PAGE_NOCACHE) )
{
//RETAILMSG(1, (_T("Virtual Copy OK\r\n")));
byBaseAddress = (BYTE *) pAddr;
wBaseAddress = (WORD *) pAddr;
dwBaseAddress = (DWORD *) pAddr;
RETAILMSG(1, (_T("0x%08x mapped to: 0x%08x\r\n"), dwPhyBaseAddress, byBaseAddress));
}
......

and it executes "VirtualAlloc" and "VirtualCopy" without error, but if it executes the
" byBaseAddress = (BYTE *) pAddr;"
line code then the LCD screen is blank ( all Icons are disappeared)
unless I have to eject the PCMCIA adapter.

My question is: Did I do something wrong here ?
1. I run BitSy Plus ADS development system wit CE.NET 4.12
2. I run eVC++ 4.0 with SP1 on PC under Win2000
3. ActiveSync 3.6.

Thanks for your advice.

Nghia.
npho@fetest.com
Go to Top of Page

ctacke

877 Posts

Posted - 07 Apr 2003 :  13:44:55  Show Profile  Email Poster
Nghia,

Is this a RAM card or an ATA filesystem card? The ReadWrite test will only work if the card has writable Memory space. If you're using an ATA card, then you should try the ReadOnly test.

The device "hanging" when you run the code sounds like the CARDB_WAIT signal is telling the CPU to go into a wait state. The line of code you state causes the hang should have no effect on the system as you are simply assigning a variable to the allocated memory's base address. Are you sure this is where is halts?

Also note that the ADSCF2 source does not have this code. Is there a reason you aren't simply using the ADSCF2 source files as-is?

Go to Top of Page

nghia

36 Posts

Posted - 08 Apr 2003 :  10:17:36  Show Profile  Email Poster
Chris,

It is a ATA Card but I did use the ReadOnly option (see the debug output).

I guess that after make a execution "VirtualAlloc" and "VirtualCopy" (without error return) the system assign the memory address "out of range"(?) because after I reject the PCMCIA card the Windows CE.NET 4.12 pop up the error message:

"Application Lan91C_4.exe has performe dan illegal
operation and will be shut down.If problem persists,
contact the program vendor.
Program: Lan91C_4.exe
Exception: 0xc0000005
Address: 00013564 "

and with the remote dedug tools I do not find the address location 000013564.

and on the PC I get the error message:

" You can not continue debugging
The platform Manager server is not available
You must stop debugging, exit EVC.EXE, and restart.
OK
"

Is is possible that System returns the invalid address from VirtualAlloc and VirtualCopy functions ? or
do I configure something wrong in my system setup ?

Thanks.

Nghia.




Go to Top of Page

madav

15 Posts

Posted - 15 May 2003 :  21:53:38  Show Profile  Email Poster
Hi
I am having problems writing to the Board. The read seems to work as I can see the data value change . But when I write & then read. I do get my expected values. I am not sure as to how only write can fail.
(Or is that both are failing??)

BTW, I am trying to write to registers on a board connected using through the CF Interface. I am using the SLOT1_IO_ADDR for MapAddress()

Any Suggestions

Thanks
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.05 seconds. Snitz Forums 2000