Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

How you debug these things?


  • Please log in to reply
1 reply to this topic

#1 Emilio x64

Emilio x64

    Advanced Member

  • Members
  • PipPipPip
  • 40 posts

Posted 24 July 2013 - 05:40 PM

I am planning a design based on the Netduino Plus 2 (tentative) and I created a custom emulator (nothing fancy really) project in VS.2013 Ultimate on Windows 7 Ultimate x64. As pointed out in a previous question this is targetted to a desktop framework (.NET 4.5) and it seems to work well.

 

I also created the Microframework application (SDK 4.3). Basically the application sends commands to the device (as emulated) via the SPI bus, It sends 16 bit commands to control a MAXIM 7219 chip.

 

I seem to have gotten the communication between emulator an app right from the examples. So, I can click on a button on the emulator which causes an interrupt to be processed on the app (Emulator to App comms). Also the application sends commands via SPI to the emulator (no actual device yet). My emulator receives the SPI commands and acts accordingly to update the custom UI. I also have a form that shows the registers of the device which has SPI (slave) and see that the commands are received.

 

The problem is... If I add initialization code in the app that sends initialization commands via SPI then the whole thing crashes. If I omit the initialization code (sent by SPI) and simply assume everything is initialized then I can interact with the emulator.

 

So to my question, how can one debug these things? when I enabled the initialization code sent to my device the emulator UI appears, I see in the Output Windows "found emulator!..."  and then I briefly see a bunch of messages, the thing crashes and the whole output window is ERASED leaving me with absolutely no clue as to what went wrong. 

 

I put a breakpoint on the call to the initialization code which is invoked in Program.cs then it doesn't even break, it craps out erases all output and no clue.... If I remove that call to the initialization then 99% of the times it starts and works. But usually the 1st time it crashes (same modus operandi of erasing all useable output) and the next time it runs fine.

 

How can I debug this???? I am not even using an actual hardware device. Why are the breakpoints ignored in DEbug mode?



#2 Emilio x64

Emilio x64

    Advanced Member

  • Members
  • PipPipPip
  • 40 posts

Posted 24 July 2013 - 05:47 PM

I found the following messages on the "Microframework Device Deployment" category of the Output Window in VS.2013:

Looking for a device on transport 'Emulator'Launching emulator with command line: '"N:CodeMicroFrameworkDisplayMyDeviceEmulatorbinDebugMyDeviceEmulator.exe" "/waitfordebugger" "/load:C:Program Files (x86)Microsoft .NET Micro Frameworkv4.3AssembliesleMicrosoft.SPOT.Native.pe" "/load:C:Program Files (x86)Microsoft .NET Micro Frameworkv4.3Assemblieslemscorlib.pe" "/load:C:Program Files (x86)Microsoft .NET Micro Frameworkv4.3AssembliesleMicrosoft.SPOT.Graphics.pe" "/load:C:Program Files (x86)Microsoft .NET Micro Frameworkv4.3AssembliesleMicrosoft.SPOT.Hardware.pe" "/load:N:CodeMicroFrameworkDisplayMyDeviceEmulatorbinDebugleMyDeviceEmulator.pe"'Restarting interpreter...Attaching to device...Deployment error: failed to (re)connect debugger engine to debugging target.The debugging target and the debugger engine failed to initialize because of unspecified device errors.The debugger engine thread has terminated unexpectedly with error 'Debugger engine could not attach to debugging target.'.

But that "unknown device errors" isn't really much of a help, isn't it? shouldn't it give a stack trace or something to work with?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.