AVRStudio MFC Application Error

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
tomg375

AVRStudio MFC Application Error

Post by tomg375 » Tue Jul 14, 2009 7:02 pm

I used IAR Workbench, AVR Studio 4.xx and a JTAGICE MK1 for a number of years developing Atmega128 products on a WinXP PC and a Win2K PC. Several months ago I installed WinAVR on both PCs and started using a JTAGICE MK2 (my IAR version and the MK1 do not support the AT90USB1287). This combination worked properly for the 1287 MCU and the project was completed.

I recently tried to go back to one of the M128 projects but keep getting the messages “AVRStudio MFC Application has encountered a problem . . .” (on WinXP PC) and “AVRStudio.exe has generated errors . . .” (on Win2K PC). These issues are occurring on both the WinXP and Win2K PCs and with both the JTAGICE MK1 and MK2.

I have uninstalled WinAVR, uninstalled and reinstalled Studio 4.15, uninstalled Studio 4.15 and installed Studio 4.16 + SP (rebooting after each uninstall and install) without success.

I connected the JTAGICE MK2 to a WinXP PC that never had WinAVR installed and it works with one M128 board. On a second identical board the “MFC” error occurs. (Obviously it is no longer “identical” otherwise it would work. But no hardware changes were made since it last worked.)

I tried loading the 1287 project into both M128 boards (after changing the device to Atmega128). It loaded properly and ran on all combinations of PCs and JTAGICEs (until it hit the 1287-specific commands, of course). I think this proves that all the PCs, JTAGICEs and M128 boards are working.

Questions:
1 How do I get the M128 board to run on the WinXP and Win2K PCs that had previously had WinAVR installed?
2 How do I get the second M128 board to run on the WinXP PC that never had WinAVR installed? (What might be different about this board?)

Grendel
Rank 4
Rank 4
Posts: 167
Joined: Sat Dec 16, 2006 9:53 pm
Location: Oregon, USA
Contact:

Re: AVRStudio MFC Application Error

Post by Grendel » Tue Jul 14, 2009 9:57 pm

Running latest AVRS/AVRGCC/mkII under XP Pro x86 w/o any problems.

Have you installed AVRS and AVRGCC to default directories ? If not, try that.
Do your project names and/or project path names contain unusual characters ? (like #, $, % etc.) ? If so, try rebuilding it w/o them.
Do you have any special purpose USB devices installed ? (Like CAN interfaces, ISPs for other chip brands, USB analyzers etc.) Try uninstalling them. (I did problems w/ the Atmel drivers conflicting w/ jungo and SilLabs drivers.)

tomg375

Re: AVRStudio MFC Application Error

Post by tomg375 » Tue Jul 14, 2009 10:50 pm

Thanks for the inputs but not luck.

Have you installed AVRS and AVRGCC to default directories ? YES
Do your project names and/or project path names contain unusual characters ? (like #, $, % etc.) ? NO
Do you have any special purpose USB devices installed ? NO (although the 1287 project that used WinAVR did use HID)

Remember, I successfully used the same M128 boards, same PCs, same XP Pro, same Win2K, same Studio, same source files, same IAR-built project several months ago. The M128 project that I am having the difficulty with was compiled/linked with IAR (not AVRGCC).

Since everything worked before using WinAVR with the 1287 I am assuming that WinAVR is the culprit. But after removing it same errors. Is it possible that there are some WinAVR registry items that are causing the problem?

tomg375

Re: AVRStudio MFC Application Error

Post by tomg375 » Wed Jul 15, 2009 12:36 am

Some new information ---

I tried the original XP Pro PC with the JTAGICE MK2 on a 2nd M128 board (#2) and it works! Switched to the 1st M128 board and it does not work (MFC error). Sounds like #1 is bad, right?

Tried loading the 1287 code into M128 boards #1 and #2 (after changing the device to Atmega128) and BOTH boards run. That implies that #1 is OK.

XP Pro + JTAGICE MK2
Board #1 --- M128 code --- MFC error
Board #1 --- 1287 code --- works (proves Board #1 OK)

Board #2 --- M128 code --- works (proves M128 code OK)
Board #2 --- 1287 code --- works

Question
Why does Board #1 running the M128 project fail with MFC errors but runs flawlessly with the 1287 project?

Grendel
Rank 4
Rank 4
Posts: 167
Joined: Sat Dec 16, 2006 9:53 pm
Location: Oregon, USA
Contact:

Re: AVRStudio MFC Application Error

Post by Grendel » Wed Jul 15, 2009 1:23 am

Running out of ideas.

Do you have the boards USB connected when you try it ? (shouldn't really affect anything, the mkII is a vendor class device but who knows..)

I'm running my setup under XP SP3, and .net 3.5, everything patched to the brim (also have Visual Studio 2005 installed).

tomg375

Re: AVRStudio MFC Application Error

Post by tomg375 » Wed Jul 15, 2009 8:29 pm

No, the M128 target board is not connected to USB (other than through the JTAGICE MK2).

After more testing I found my intial investigation was not totally correct. Both M128 boards exhibit the same MFC Error problem when using the MK2.

AVRStudio opens correctly
AVRStudio reads the lockbits, fuses, etc correctly (the MK2 is talking to the M128 board)
M128 project loads correctly
Error occurs when trying to enter the Debug Mode

It may or may not mean anything but Microsoft .NET Framework was installed on the WinXP Pro PC since the M128 project last worked.

Post Reply