Hi All
What is the relation ship between power manager and battery driver? How the
power manager accesses battery functions. I use sample battery driver
supplied with wince 5.0 and unmodified pm code with smdk2440. I get following
prefetch abort exception while booting the system

--
Message posted via PocketPCJunkies.com
http://www.pocketpcjunkies.com/Uwe/Forums.aspx/wince-pb/200803/1

Re: Relationship between battdrvr and pm by Luca

Luca
Fri Mar 21 08:11:52 PDT 2008

the power manager calls GetSystemPowerStatusEx2 API (in coredll) to gain
battery information.
the API basically performs a DeviceIoControl with
IOCTL_BATTERY_GETSYSTEMPOWERSTATUSEX2
to the battery driver

--

Luca Calligaris
www.eurotech.it

"sohailto via PocketPCJunkies.com" <u37977@uwe> ha scritto nel messaggio
news:817062e5dd62c@uwe...
> Hi All
> What is the relation ship between power manager and battery driver? How
> the
> power manager accesses battery functions. I use sample battery driver
> supplied with wince 5.0 and unmodified pm code with smdk2440. I get
> following
> prefetch abort exception while booting the system
>
> --
> Message posted via PocketPCJunkies.com
> http://www.pocketpcjunkies.com/Uwe/Forums.aspx/wince-pb/200803/1
>



Re: Relationship between battdrvr and pm by Bruce

Bruce
Fri Mar 21 09:14:44 PDT 2008

Prefetch abort, that means the the CPU ran out of instructions to run.
Possible causes include:

1. System bus unavalable to read the next instruction
2. NULL function pointer being dereferenced
3. Corrupt stack
4. Corrupt RAM

--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member

"sohailto via PocketPCJunkies.com" <u37977@uwe> wrote in message
news:817062e5dd62c@uwe...
> Hi All
> What is the relation ship between power manager and battery driver? How
> the
> power manager accesses battery functions. I use sample battery driver
> supplied with wince 5.0 and unmodified pm code with smdk2440. I get
> following
> prefetch abort exception while booting the system
>
> --
> Message posted via PocketPCJunkies.com
> http://www.pocketpcjunkies.com/Uwe/Forums.aspx/wince-pb/200803/1
>



Re: Relationship between battdrvr and pm by sohailto

sohailto
Fri Mar 21 23:05:08 PDT 2008

Dear Bruce

I actually forgot to paste exception error and tell that I have no debug
support. I couldnt understand that by adding battdrvr, how a prefetch abort
occur in pm.dll? kindly suggest something.

Prefetch Abort: Thread=8ff93d48 Proc=8de4bd30 'device.exe'
AKY=00000009 PC=00000000(???+0x00000000) RA=03f31e9c(pm.dll+0x00011e9c)
BVA=00000000 FSR=00000005

Thanks

Sohail

Bruce Eitman [eMVP] wrote:
>Prefetch abort, that means the the CPU ran out of instructions to run.
>Possible causes include:
>
>1. System bus unavalable to read the next instruction
>2. NULL function pointer being dereferenced
>3. Corrupt stack
>4. Corrupt RAM
>
>> Hi All
>> What is the relation ship between power manager and battery driver? How
>[quoted text clipped - 3 lines]
>> following
>> prefetch abort exception while booting the system

--
Message posted via PocketPCJunkies.com
http://www.pocketpcjunkies.com/Uwe/Forums.aspx/wince-pb/200803/1


Re: Relationship between battdrvr and pm by wrani

wrani
Sun Mar 23 03:58:01 PDT 2008

On Mar 22, 8:05=A0am, "sohailto via PocketPCJunkies.com" <u37977@uwe>
wrote:
> Dear Bruce
>
> I actually forgot to paste exception error and tell that I have no debug
> support. I couldnt understand that by adding battdrvr, how a prefetch abor=
t
> occur in pm.dll? kindly suggest something.
>
> Prefetch Abort: Thread=3D8ff93d48 Proc=3D8de4bd30 'device.exe'
> AKY=3D00000009 PC=3D00000000(???+0x00000000) RA=3D03f31e9c(pm.dll+0x00011e=
9c)
> BVA=3D00000000 FSR=3D00000005
>
> Thanks
>
> Sohail
>
> Bruce Eitman [eMVP] wrote:
> >Prefetch abort, that means the the CPU ran out of instructions to run.
> >Possible causes include:
>
> >1. =A0System bus unavalable to read the next instruction
> >2. =A0NULL function pointer being dereferenced
> >3. =A0Corrupt stack
> >4. =A0Corrupt RAM
>
> >> Hi All
> >> What is the relation ship between power manager and battery driver? How=

> >[quoted text clipped - 3 lines]
> >> following
> >> prefetch abort exception while booting the system
>
> --
> Message posted via PocketPCJunkies.comhttp://www.pocketpcjunkies.com/Uwe/F=
orums.aspx/wince-pb/200803/1

Hey,
I sould suugest you write a small program that calls
"GetSystemPowerStatusEx2 ", see if this happen again.

I believe the exception happens in your battery driver, when trying to
read from HW. How do you have the battery connected to your
platform ?



Re: Relationship between battdrvr and pm by sohailto

sohailto
Sun Mar 23 21:12:39 PDT 2008

Hi Warni

I am trying to use the sample driver for the time being (actually the battery
is sharing ADC of S3C2440 with touch screen) so no hardware interaction is
taking place. And I have tried to call GetSystemPowerStatusEx2, but it is not
included in coredll. I think there is a library linking problem (and I am
loading the driver as a dll). Honestly I couldnt understand the battery
driver architecture. In docs, the coredll module is battdrvr.lib while in
sample driver, it is battdrvr_lib.lib, what is this? can anyone explain?
It will be highly appreciated that some provide a step by step guide to
integrate the sample driver.

Best regards
Sohail

wrani wrote:
>On Mar 22, 8:05 am, "sohailto via PocketPCJunkies.com" <u37977@uwe>
>wrote:
>> Dear Bruce
>>
>[quoted text clipped - 26 lines]
>> --
>> Message posted via PocketPCJunkies.comhttp://www.pocketpcjunkies.com/Uwe/Forums.aspx/wince-pb/200803/1
>
>Hey,
>I sould suugest you write a small program that calls
>"GetSystemPowerStatusEx2 ", see if this happen again.
>
>I believe the exception happens in your battery driver, when trying to
>read from HW. How do you have the battery connected to your
>platform ?

--
Message posted via http://www.pocketpcjunkies.com


Re: Relationship between battdrvr and pm by Dean

Dean
Mon Mar 24 06:46:58 PDT 2008

You must include battery support from the catalog and redo the sysgen. That
will bring in the GetSystemPowerStatusEx2 call.

--
Dean Ramsier - eMVP
BSQUARE Corporation


"sohailto via PocketPCJunkies.com" <u37977@uwe> wrote in message
news:819df80498281@uwe...
> Hi Warni
>
> I am trying to use the sample driver for the time being (actually the
> battery
> is sharing ADC of S3C2440 with touch screen) so no hardware interaction is
> taking place. And I have tried to call GetSystemPowerStatusEx2, but it is
> not
> included in coredll. I think there is a library linking problem (and I am
> loading the driver as a dll). Honestly I couldnt understand the battery
> driver architecture. In docs, the coredll module is battdrvr.lib while in
> sample driver, it is battdrvr_lib.lib, what is this? can anyone explain?
> It will be highly appreciated that some provide a step by step guide to
> integrate the sample driver.
>
> Best regards
> Sohail
>
> wrani wrote:
>>On Mar 22, 8:05 am, "sohailto via PocketPCJunkies.com" <u37977@uwe>
>>wrote:
>>> Dear Bruce
>>>
>>[quoted text clipped - 26 lines]
>>> --
>>> Message posted via
>>> PocketPCJunkies.comhttp://www.pocketpcjunkies.com/Uwe/Forums.aspx/wince-pb/200803/1
>>
>>Hey,
>>I sould suugest you write a small program that calls
>>"GetSystemPowerStatusEx2 ", see if this happen again.
>>
>>I believe the exception happens in your battery driver, when trying to
>>read from HW. How do you have the battery connected to your
>>platform ?
>
> --
> Message posted via http://www.pocketpcjunkies.com
>



Re: Relationship between battdrvr and pm by Marina

Marina
Thu May 15 21:02:02 PDT 2008


Hi Luca,

Do you know any sample of how to do a basic DeviceIoControl with
IOCTL_BATTERY_GETSYSTEMPOWERSTATUSEX2 in C#

I have been stuck all week :(

Please help me, thanks
Marina



"Luca Calligaris" wrote:

> the power manager calls GetSystemPowerStatusEx2 API (in coredll) to gain
> battery information.
> the API basically performs a DeviceIoControl with
> IOCTL_BATTERY_GETSYSTEMPOWERSTATUSEX2
> to the battery driver
>
> --
>
> Luca Calligaris
> www.eurotech.it
>
> "sohailto via PocketPCJunkies.com" <u37977@uwe> ha scritto nel messaggio
> news:817062e5dd62c@uwe...
> > Hi All
> > What is the relation ship between power manager and battery driver? How
> > the
> > power manager accesses battery functions. I use sample battery driver
> > supplied with wince 5.0 and unmodified pm code with smdk2440. I get
> > following
> > prefetch abort exception while booting the system
> >
> > --
> > Message posted via PocketPCJunkies.com
> > http://www.pocketpcjunkies.com/Uwe/Forums.aspx/wince-pb/200803/1
> >
>
>
>

Re: Relationship between battdrvr and pm by sohailto

sohailto
Fri May 16 06:29:19 PDT 2008

Hi Marina
In C# you dont need to do a DeviceIoControl, instead import coredll.dll and
call GetSystemPowerStatusEx2 function. this will give you the power status of
your system.


Marina wrote:
>Hi Luca,
>
>Do you know any sample of how to do a basic DeviceIoControl with
>IOCTL_BATTERY_GETSYSTEMPOWERSTATUSEX2 in C#
>
>I have been stuck all week :(
>
>Please help me, thanks
>Marina
>
>> the power manager calls GetSystemPowerStatusEx2 API (in coredll) to gain
>> battery information.
>[quoted text clipped - 9 lines]
>> > following
>> > prefetch abort exception while booting the system

--
Message posted via PocketPCJunkies.com
http://www.pocketpcjunkies.com/Uwe/Forums.aspx/wince-pb/200805/1


Re: Relationship between battdrvr and pm by Marina

Marina
Fri May 16 15:33:00 PDT 2008


Hi sohailto,

thank you for replying... GetSystemPowerStatusEx2 looks good but this is for
Windows Operating systems not CE (sorry for posting this in the wrong forum)
but i need to be able to use DeviceIoControl but i dont know how this is done?

Or can i use GetSystemPowerStatusEx2 without CE ?

thanks

"sohailto via PocketPCJunkies.com" wrote:

> Hi Marina
> In C# you dont need to do a DeviceIoControl, instead import coredll.dll and
> call GetSystemPowerStatusEx2 function. this will give you the power status of
> your system.
>
>
> Marina wrote:
> >Hi Luca,
> >
> >Do you know any sample of how to do a basic DeviceIoControl with
> >IOCTL_BATTERY_GETSYSTEMPOWERSTATUSEX2 in C#
> >
> >I have been stuck all week :(
> >
> >Please help me, thanks
> >Marina
> >
> >> the power manager calls GetSystemPowerStatusEx2 API (in coredll) to gain
> >> battery information.
> >[quoted text clipped - 9 lines]
> >> > following
> >> > prefetch abort exception while booting the system
>
> --
> Message posted via PocketPCJunkies.com
> http://www.pocketpcjunkies.com/Uwe/Forums.aspx/wince-pb/200805/1
>
>

Re: Relationship between battdrvr and pm by sohailto

sohailto
Fri May 16 22:29:41 PDT 2008

Hi Marina
GetSystemPowerStatusEx2 is indeed for Windows CE. But I am confused by your
last sentence "can i use GetSystemPowerStatusEx2 without CE ?" , what do you
mean by "without CE"? Using DeviceIOCtl from applications is not a good idea.
Sohail

Marina wrote:
>Hi sohailto,
>
>thank you for replying... GetSystemPowerStatusEx2 looks good but this is for
>Windows Operating systems not CE (sorry for posting this in the wrong forum)
>but i need to be able to use DeviceIoControl but i dont know how this is done?
>
>Or can i use GetSystemPowerStatusEx2 without CE ?
>
>thanks
>
>> Hi Marina
>> In C# you dont need to do a DeviceIoControl, instead import coredll.dll and
>[quoted text clipped - 16 lines]
>> >> > following
>> >> > prefetch abort exception while booting the system

--
Message posted via PocketPCJunkies.com
http://www.pocketpcjunkies.com/Uwe/Forums.aspx/wince-pb/200805/1


Re: Relationship between battdrvr and pm by Marina

Marina
Sat May 17 19:46:00 PDT 2008

Thanks again, i need to get laptop battery information such as the battery
name and chemistry using DeviceIoControl (cannot use WMI)and I think I have
to use IOCTL_BATTERY_QUERY_INFORMATION ???

http://msdn.microsoft.com/en-us/library/aa372698(VS.85).aspx

Trying to use that from C# but i dont know how to :(


"sohailto via PocketPCJunkies.com" wrote:

> Hi Marina
> GetSystemPowerStatusEx2 is indeed for Windows CE. But I am confused by your
> last sentence "can i use GetSystemPowerStatusEx2 without CE ?" , what do you
> mean by "without CE"? Using DeviceIOCtl from applications is not a good idea.
> Sohail
>
> Marina wrote:
> >Hi sohailto,
> >
> >thank you for replying... GetSystemPowerStatusEx2 looks good but this is for
> >Windows Operating systems not CE (sorry for posting this in the wrong forum)
> >but i need to be able to use DeviceIoControl but i dont know how this is done?
> >
> >Or can i use GetSystemPowerStatusEx2 without CE ?
> >
> >thanks
> >
> >> Hi Marina
> >> In C# you dont need to do a DeviceIoControl, instead import coredll.dll and
> >[quoted text clipped - 16 lines]
> >> >> > following
> >> >> > prefetch abort exception while booting the system
>
> --
> Message posted via PocketPCJunkies.com
> http://www.pocketpcjunkies.com/Uwe/Forums.aspx/wince-pb/200805/1
>
>

Re: Relationship between battdrvr and pm by Chris

Chris
Sun May 18 16:16:45 PDT 2008

This is a Windows CE newsgroup. You might try asking in a relevent group
instead.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com

"Marina" <Marina@discussions.microsoft.com> wrote in message
news:6AE0E28E-BA54-41D5-BFDD-6D7314EE67C2@microsoft.com...
> Thanks again, i need to get laptop battery information such as the battery
> name and chemistry using DeviceIoControl (cannot use WMI)and I think I
> have
> to use IOCTL_BATTERY_QUERY_INFORMATION ???
>
> http://msdn.microsoft.com/en-us/library/aa372698(VS.85).aspx
>
> Trying to use that from C# but i dont know how to :(
>
>
> "sohailto via PocketPCJunkies.com" wrote:
>
>> Hi Marina
>> GetSystemPowerStatusEx2 is indeed for Windows CE. But I am confused by
>> your
>> last sentence "can i use GetSystemPowerStatusEx2 without CE ?" , what do
>> you
>> mean by "without CE"? Using DeviceIOCtl from applications is not a good
>> idea.
>> Sohail
>>
>> Marina wrote:
>> >Hi sohailto,
>> >
>> >thank you for replying... GetSystemPowerStatusEx2 looks good but this is
>> >for
>> >Windows Operating systems not CE (sorry for posting this in the wrong
>> >forum)
>> >but i need to be able to use DeviceIoControl but i dont know how this is
>> >done?
>> >
>> >Or can i use GetSystemPowerStatusEx2 without CE ?
>> >
>> >thanks
>> >
>> >> Hi Marina
>> >> In C# you dont need to do a DeviceIoControl, instead import
>> >> coredll.dll and
>> >[quoted text clipped - 16 lines]
>> >> >> > following
>> >> >> > prefetch abort exception while booting the system
>>
>> --
>> Message posted via PocketPCJunkies.com
>> http://www.pocketpcjunkies.com/Uwe/Forums.aspx/wince-pb/200805/1
>>
>>