none
NK Kernel DEBUGCHK Failed in vm.c RRS feed

  • Question

  • Hi,

    I have built an OSDesign in DEBUG mode. Once the image boots completely (i.e. Standard Shell comes up and I am waiting for all the messages to be displayed in Debug Output window).

    At this time I am launching an application which waits or infinitely loops till Storage Card is mounted.

    But, after running the application I am seeing DEBUGCHK failed messages on hyperterminal.

    The errors are

    NK Kernel: DEBUGCHK failed in file d:\yzkiqfe\private\winceos\COREOS\nk\kernel\n
    knormal\..\vm.c at line 3568
    NK Kernel: DEBUGCHK failed in file d:\yzkiqfe\private\winceos\COREOS\nk\kernel\n
    knormal\..\vm.c at line 3568
    NK Kernel: DEBUGCHK failed in file d:\yzkiqfe\private\winceos\COREOS\nk\kernel\n
    knormal\..\vm.c at line 3568

    The line number 3568 contents are     DEBUGCHK (!((DWORD) pAddr & VM_PAGE_OFST_MASK)); and the function name is _GetPFN.

    When I searched google some of the posts suggests to call NKForceCleanBoot and I have used this API in OEMInit function.

    What is causing for this error. How to debug this.

    TCHAR			szFileLaunch[MAX_PATH]={0};
    TCHAR			szFileApp[MAX_PATH]={0};
    WIN32_FIND_DATA		fdLaunch ={0};
    WIN32_FIND_DATA		fdCommand = {0};
    int WINAPI WinMain
    ( 
    	HINSTANCE hInstance, 
    	HINSTANCE hPrevInstance, 
    	LPTSTR lpCmdLine, 
    	int nCmdShow
    )
    {
    	BOOL				bRetVal;
    	WORD				wfname[NUM_CHAR]=  {0};				// File Name to open <<launch.txt>>
    	HANDLE				hLaunch;
    	HANDLE				hCommand = NULL;
    	DWORD				dwErrorVal;
    	UINT32				u32Index;
    	PROCESS_INFORMATION ProcInfo; 
    	HANDLE				SDCardEvent;
    	BOOL				bLaunchUsrApp;
    	DWORD				dwBytesReturned;
    	BOOL				bUARTAvlbl;
    	UINT32				u32StartTick;
    
    	bUARTAvlbl = FALSE;
    	SDCardEvent = NULL;
    	hLaunch = NULL;
    	u32Index = FALSE;
    	dwErrorVal = FALSE;
    	bLaunchUsrApp = FALSE;
    	dwBytesReturned = FALSE;
    	u32StartTick = FALSE;
    
    	LPTSTR  szDeviceName;							// Device Name (COM2,COM1)						
    	HANDLE  hPort = INVALID_HANDLE_VALUE;			// COM Port Handle	
    	DCB		PortDCB;
    
    	szDeviceName	= TEXT("COM1:"); /* UART 1*/			
    	bRetVal			= FALSE;
    	hLaunch			= INVALID_HANDLE_VALUE;
    	hCommand		= INVALID_HANDLE_VALUE;
    	dwErrorVal		= FALSE;
    
    	// Create a Named Event same as in SD Host Controller driver
    	SDCardEvent = CreateEvent( NULL, FALSE, FALSE, TEXT("SDCEvent") );
    	if ( SDCardEvent == NULL ) 
    	{
           	RETAILMSG(1, (TEXT("\r\nAutoLaunch:Error creating SDCardEvent***")));
    		return FALSE;
    	}
    
    	if(!CloseHandle(SDCardEvent))
    	{
    		ERRORMSG (1,(L"AutoLaunch: CloseHandle Failed\r\n"));
    	}
    	
    	RETAILMSG(1, (TEXT("\r\n\r\n\r\n\t\t----------------------------------------------\r\n")));             
    	RETAILMSG(1, (TEXT("\r\n\r\n\r\n\t\t-----***----- WELCOME to E-TrolZ -----***-----\r\n")));             
    	RETAILMSG(1, (TEXT("\r\n\r\n\r\n\t\t----------------------------------------------\r\n")));
    	RETAILMSG(1, (TEXT("\r\n\r\n\r\n\t\tSearching for Storage Card.....")));
    
    //	WaitForSingleObject(SDCardEvent,INFINITE);			// Wait for Event from SD Card Driver.
    //	ResetEvent(SDCardEvent);							// Reset the SD Card Event.
    
    
    	/* Open launch.txt from the SD card &  Get the cmd from the launch.txt 
    	 * For some reason Storage Card is not mounted and we have to wait
    	 * till it mounted, in a while loop. The reason for infinite loop is
    	 * there is no point in proceeding without Storage Card. This behaviovr
    	 * observed with PEC20 HW only
    	 */
    	lstrcpy(szFileLaunch, TEXT("\\Storage Card\\launch.txt"));
    	u32StartTick = GetTickCount();
    	DEBUGMSG (1,(L"TickCnt Start=0x%x\r\n",u32StartTick));
    	while(TRUE)
    	{
    		hLaunch = FindFirstFile(szFileLaunch, &fdLaunch);	
    		if(INVALID_HANDLE_VALUE == hLaunch)
    		{
    			dwErrorVal = GetLastError();
    		}
    		else
    		{
    			RETAILMSG (1,(L"AutoLaunch: Launch.txt found in Storage Card\r\n"));
    			bRetVal = FindClose(hLaunch);
    			if(!bRetVal)
    			{
    				ERRORMSG (1,(L"AutoLaunch: FindCloseAPI Failed...Err=%d\r\n",
    					GetLastError()));
    			}
    			break;
    		}
    		Sleep(200);
    	}
    	/* Dsiplay message that Searching For Storage Card is Done */
    	RETAILMSG(1, (TEXT("Done\r\n")));
    
    	DEBUGMSG (1,(L"Time=%d TickCnt End=0x%x\r\n",
    		GetTickCount()-u32StartTick,GetTickCount()));
    
    


    Please let me know how to proceed.

    Thanks for your time.

    Regards,

    GSR

    Tuesday, October 11, 2011 11:35 AM

All replies