Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to create create timer wince ISR

7 views
Skip to first unread message

kovendan_24 via PocketPCJunkies.com

unread,
Jun 19, 2009, 3:39:18 AM6/19/09
to
Sir,

Now i am having the BSP for PXA 270 wince , and i need to create the
Timer ISR routine using OSMR2 , where OSMR2 is used as a wince profiler in
BSP (C:\WINCE600\PLATFORM\COMMON\SRC\SOC\PXA27X_MS_V1\OAL\PROFILER"). I
copied this file into my paltform and started a new project with it to clone
the BSP , but i get fatal error C1083: Cannot open include file: 'nkintr.h':
No such file or directory error .I dont know how to clone it and add to my
project,so Plz guide me the step by step
procedures where how to clone the BSP and how to add the bsp to the my
platform
folder(dll file)as device driver(platform builder. It is because i need to
write device driver for Seven Segment Display.The main thing is i need to
create timer ISR for less than 1 ms andrefresh each seven segment . PLZ sir
any one help me...

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

Michel Verhagen [eMVP]

unread,
Jun 19, 2009, 6:26:39 AM6/19/09
to
Use Clone BSP in the Platform Builder menu to clone the entire BSP
first, then read the following for cloning individual parts from common
and public code (also read the comments for some more info):

http://guruce.com/blogpost/cloningpubliccodeanexample
http://guruce.com/blogpost/manualcloneofpubliccode


Good luck,

Michel Verhagen, eMVP
Check out my blog: http://GuruCE.com/blog

GuruCE
Microsoft Embedded Partner
http://GuruCE.com
Consultancy, training and development services.

kovendan_24 via PocketPCJunkies.com

unread,
Jun 23, 2009, 6:29:52 AM6/23/09
to

Dear sir,

The board supply vendors told that i should not clone the BSP ,
but i should create the new driver for timer application, for that i can
refer the profiler.After this i copied profiler into my folder and edited the
coding but i am not getting interrupts ., many of the functions cannot be
accessed. The code is given below.

// create_fi.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <windows.h>
#include <commctrl.h>
#include <nkintr.h>
#include <oal.h>
#include <intr.h>
#include <bulverde.h>
#include "GPIO_API.h"

static XLLP_OST_HANDLE_T g_XllpOSTHandle;

UINT32 OALProfileIntrHandler(UINT32 ra);
VOID OEMProfileTimerEnable(DWORD interval);
void init(void);


static struct
{
BOOL enabled; // is profiler active?
UINT32 countsPerHit; // counts per profiler
interrupt
} g_profiler;


int _tmain(void)
{
GPIOConfig(54,1);
GPIOConfig(81,1);
GPIOConfig(108,1);
GPIOConfig(104,1);
GPIOConfig(103,1);
GPIOConfig(95,1);
GPIOConfig(94,1);
GPIOConfig(53,1);
GPIOConfig(93,1);
GPIOConfig(105,1);
GPIOConfig(85,1);
GPIOConfig(84,1);
GPIOConfig(43,1);
GPIOConfig(42,1);
init();
return 0;
}


//----------------------------------------------------------------------------
--
//
// Function: OEMProfileTimerEnable
//
// This function is called by kernel to start kernel profiling timer.
//

BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID
lpReserved )
{
switch(ul_reason_for_call) {
case DLL_PROCESS_ATTACH:
OutputDebugString(L"Demo - DLL_PROCESS_ATTACH\n");
break;
case DLL_PROCESS_DETACH:
OutputDebugString(L"Demo - DLL_PROCESS_DETACH\n");
break;
case DLL_THREAD_ATTACH:
OutputDebugString(L"Demo - DLL_THREAD_ATTACH\n");
break;
case DLL_THREAD_DETACH:
OutputDebugString(L"Demo - DLL_THREAD_DETACH\n");
break;
default:
break;
}
return TRUE;
}

void init(void)
{
OEMProfileTimerEnable(1);
}


VOID OEMProfileTimerEnable(DWORD interval)
{
BOOL enabled;
UINT32 irq;

OALMSG(TRUE, (L"+OEMProfileTimerEnable(%d)\r\n", interval));

// We can't enable timer second time
if (g_profiler.enabled) return;

// How many hi-res ticks per profiler hit
//g_profiler.countsPerHit = (g_oalTimer.countsPerMSec * interval)/1000;

// Following code should not be interrupted
enabled = INTERRUPTS_ENABLE(FALSE);

// Configure profiling ISR callback function.
//g_pProfilerISR = OALProfileIntrHandler;

// Obtain pointers to OST and INTC registers.
//
// g_XllpOSTHandle.pOSTRegs = OALPAtoVA(BULVERDE_BASE_REG_PA_OST, FALSE);
// g_XllpOSTHandle.pINTCRegs = OALPAtoVA(BULVERDE_BASE_REG_PA_INTC, FALSE)
;

// XLLI initializes oier and rtsr to zeroes, so no further
// initialization needs to be done. Match timers and
// alarms are disabled.
//
// Current usage of Match registers:
// M0 - Scheduler
// M1 - Touch Panel
// M2 - Profiler

// Update the compare register for the next profile hit.
//
// XllpOstConfigureMatchReg(
// &g_XllpOSTHandle, MatchReg2, g_profiler.countsPerHit
// );

// Enable interrupts
// INTERRUPTS_ENABLE(enabled);
irq = IRQ_OSMR2;
//OALIntrDoneIrqs(1, &irq);

// Set flag
g_profiler.enabled = TRUE;

OALMSG(TRUE, (L"-OEMProfileTimerEnable\r\n"));
}


UINT32 OEMProfileIntrHandler(UINT32 ra)
{
UINT32 irq;
UINT32 count;


// Update the compare register for the next profile hit.
// XllpOstConfigureMatchReg(
// &g_XllpOSTHandle, MatchReg2, g_profiler.countsPerHit
// );

// First call profiler
//ProfilerHit(ra);

// Enable interrupts
irq = IRQ_OSMR2;
// OALIntrDoneIrqs(1, &irq);

switch (count)

switch(count)
{
case 1:

GPIOClear(43);
GPIOSet(42);
GPIOClear(84);
GPIOClear(105);
GPIOClear(85);
GPIOClear(108);
GPIOClear(93);
GPIOClear(94);
GPIOClear(53);
GPIOSet(54);
GPIOClear(81);
GPIOClear(104);
GPIOClear(103);
GPIOClear(95);

count++;
//printf("Cool!\n");
break;
case 2:
{
GPIOClear(42);
GPIOSet(43);

GPIOClear(84);
GPIOClear(105);
GPIOClear(85);
GPIOClear(108);
GPIOClear(93);
GPIOClear(94);
GPIOClear(53);
GPIOSet(54);
GPIOClear(81);
GPIOClear(104);
GPIOClear(103);
GPIOClear(95);

count=1;
//printf("Cool1\n");
break;
}
}

return SYSINTR_NOP;
}

Pl check and help me to create a ISR routine . PLz

Michel Verhagen [eMVP] wrote:
>Use Clone BSP in the Platform Builder menu to clone the entire BSP
>first, then read the following for cloning individual parts from common
>and public code (also read the comments for some more info):
>
>http://guruce.com/blogpost/cloningpubliccodeanexample
>http://guruce.com/blogpost/manualcloneofpubliccode
>
>Good luck,
>
>Michel Verhagen, eMVP
>Check out my blog: http://GuruCE.com/blog
>
> GuruCE
> Microsoft Embedded Partner
> http://GuruCE.com
> Consultancy, training and development services.
>

>> Sir,
>>
>[quoted text clipped - 11 lines]


>> create timer ISR for less than 1 ms andrefresh each seven segment . PLZ sir
>> any one help me...

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

kovendan_24 via PocketPCJunkies.com

unread,
Jun 26, 2009, 2:01:25 AM6/26/09
to

Dear sir,

static XLLP_OST_HANDLE_T g_XllpOSTHandle;

//----------------------------------------------------------------------------

void init(void)
{
OEMProfileTimerEnable(1);
}

switch (count)

return SYSINTR_NOP;
}

Michel Verhagen [eMVP] wrote:
>Use Clone BSP in the Platform Builder menu to clone the entire BSP
>first, then read the following for cloning individual parts from common
>and public code (also read the comments for some more info):
>
>http://guruce.com/blogpost/cloningpubliccodeanexample
>http://guruce.com/blogpost/manualcloneofpubliccode
>
>Good luck,
>
>Michel Verhagen, eMVP
>Check out my blog: http://GuruCE.com/blog
>
> GuruCE
> Microsoft Embedded Partner
> http://GuruCE.com
> Consultancy, training and development services.
>

>> Sir,
>>
>[quoted text clipped - 11 lines]

>> create timer ISR for less than 1 ms andrefresh each seven segment . PLZ sir
>> any one help me...

--

Bruce Eitman [eMVP]

unread,
Jun 26, 2009, 6:45:15 AM6/26/09
to

What does "many of hte functions cannot be accessed" mean?

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT EuroTech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

EuroTech Inc.
www.EuroTech.com

"kovendan_24 via PocketPCJunkies.com" <u48635@uwe> wrote in message
news:9829dc04f7d75@uwe...

kovendan_24 via PocketPCJunkies.com

unread,
Jun 27, 2009, 5:34:54 AM6/27/09
to

Dear sir,

XllpOstConfigureMatchReg(
&g_XllpOSTHandle, MatchReg2, g_profiler.countsPerHit
);

g_XllpOSTHandle.pOSTRegs = OALPAtoVA(BULVERDE_BASE_REG_PA_OST, FALSE);
g_XllpOSTHandle.pINTCRegs = OALPAtoVA(BULVERDE_BASE_REG_PA_INTC, FALSE)
;

g_profiler.countsPerHit = (g_oalTimer.countsPerMSec * interval)/1000;


g_pProfilerISR = OALProfileIntrHandler;


INTERRUPTS_ENABLE(enabled);
irq = IRQ_OSMR2;
OALIntrDoneIrqs(1, &irq);

These are the functions that i am unable to acceses , i get errors as
"INTERRUPTS_ENABLE(enabled);" undefined identifiers.

Like this all these functions are given error .I added all the header files
also still i get the errors.

I need to use this profiler as timer ISR routine.

Plz help me to do this , i.e i need to write a driver (i.e DLL file) for
timer application .plz any one guide me to do this . plz

Bruce Eitman [eMVP] wrote:
>What does "many of hte functions cannot be accessed" mean?
>

>> Dear sir,
>>
>[quoted text clipped - 232 lines]

Bruce Eitman [eMVP]

unread,
Jun 27, 2009, 9:51:48 AM6/27/09
to

This is a much better way to describe your problem.
> "INTERRUPTS_ENABLE(enabled);" undefined identifiers.

It means that you are getting a linker error. Header files that you include
affect the complier. Now you need to deal with the linker, which you do by
linking with the correct library files. I don't which file you should link
with, you must know that.

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT EuroTech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

EuroTech Inc.
www.EuroTech.com

"kovendan_24 via PocketPCJunkies.com" <u48635@uwe> wrote in message

news:98384bb974ae9@uwe...

0 new messages