Prefetch Abort Exception on WinCE 7 while debugging in VS2008

// Expert user has replied.
A Adithya Krishnamurthy 2 years 11 months ago
27 1 0

Has anyone seen a 'Prefetch Abort' exception while stepping thru code in debug mode in VS 2008? This occurs with an MK3190 (MPA 3.0; OS is WEC 7) connected to a Windows 7 PC, running VS 2008 with EMDK 2.7 installed and the Motorola Patch 1 for the EMDK 2.7 also installed. The customer application is written in VB .NET. The error occurs only in Debug mode while stepping thru the code.
 
Installing below MS patch did not resolve the issue either:
http://www.microsoft.com/en-us/download/details.aspx?id=11935
 
Any pointers would be greatly appreciated! Thanks.
 

Please register or login to post a reply

1 Replies

A Adithya Krishnamurthy

Changing a reg key on the device resolved the issue. Turns out WinCE 6 and 7 (both use.NET CF 3.5) limit the stack to grow only up to 32MB in debug mode unless the reg key is changed explicitly. See MS article below:

http://msdn.microsoft.com/en-us/library/hh300132.aspx

Managed application crashes with debugger attached on ARMv7
If your managed application consumes more than 32MB on an ARMv7 platform you may run in to problems when debugging with your application crashing. Typically the application runs fine when launched on the device, but when launched from the Visual Studio debugger the application will crash as soon as the stack consumption goes above 32MB. This hotfix describes the problem better than I can:  http://support.microsoft.com/kb/973905   You do not need to apply the hotfix to WEC7 as PB will have already placed the fixed .netCF assemblies on to your image, however you will need to add the registry value to activate the fix:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETCompactFramework]  "JITCodeBufferSizeLimitEnabled"=dword:1

Below is another VS 2008 patch that might come in handy also. But the above registry fix alone solved the issue for us.
http://www.microsoft.com/en-us/download/details.aspx?id=11935

CONTACT
Can’t find what you’re looking for?