Main Site Documentation

Serial Debug using FEZ Spider


#1

Hi, this is my first post, but I have made several Gadgeteer Apps that deploy/debug over USB. I want to use USB to communicate with a PC using CRC, so I am trying to swap the deploy/debug to Serial (RS485). I have created a simple FEZ Spider setup to test this. What am I doing wrong? Am I missing something obvious like a DIP switch?

# Setup #
Framework 4.3
FEZ Spider Mainboard
2 modules:

  • USB Client SP (socket 1)
  • RS485 Module (socket 11, connected to the PC using a Moxa UPort 1130 in RS485, 2wire mode)
    <Attached as Spider Serial Debug - Setup.png>

# Confirmed #
I can deploy over USB.
I can communicate over RS485 while deployed over USB.
<Attatched as Attached as Spider Serial Debug - RS485 Comm Test.png>

# Issue #
I cannot deploy over RS485.
Error: “Unable to communicate with device Serial:COM8”
<Attached as Attached as Spider Serial Debug - Deployment Error>

[quote]Looking for a device on transport 'Serial’
Starting device deployment…
Iteration 0
Opening port \.\COM8
Attaching debugger engine…
… cannot attach debugger engine![/quote]
Note: The PC appears to be transmitting while deploying because the TX LED flashes on the Moxa when deploying over “Serial”


#2

Additionally, using FezConfig,

I can ping the device over USB.

I cannot ping the device over Serial (RS485).

[quote] Pinging…
Failure - Device is not connected or not responding. [/quote]


#3

Welcome jonking3 !

serial debug only works over COM1 (on the netmf device). Not owning a Spider, is the module connected to the COM1 socket ? And do you have the switches set correctly for serial debug ?

I’ve never seen anyone try this over RS485, it’s typically over RS232; but to be honest, there’s no reason I can expect that you can’t use it, it is after all just a different transport. But you must remember, if you use serial for debugging you can’t use it for anything else. Are you causing a conflict in your code ?

Fundamentals would say you first need to get MFDeploy to show debug messages (working PING response will suffice) over serial before you can proceed with deployment, so get that sorted. My suspicion is it’s just switches…


#4

Thanks, Brett. I got it working. Cheers! :slight_smile:

I had to change the DIP Switches.
<Attached as Spider Serial Debug - Spider 1.0 Serial Debug DIP Switches.png>

I discovered this while looking at this link: https://www.ghielectronics.com/docs/54/loader-tinybooter-g120-and-emx-families#2438 – Although the document is marked “Obsolete”, you do need to set the DIP switch on the Spider (which switch depends on the version of the Spider - I have the Spider 1.0)

Also, COM8 is the PC-side Virtual Com Port for my Moxa USB/RS485 Adapter. It is configurable. Visual Studio allows you to choose any comm port it sees. Here’s a pic of it working over Serial Debug with COM8.
<Spider Serial Debug - Successful Deployment.png>

Now it’s time to get USB communication working using CDC!

Respectfully,
Jonathan King


#5

nice job.

Yep, I understood COM8 was the pc-based COM port, that’s why I was (hopefully) clear about COM1 being on the Fez side of the equation :slight_smile:

And if you’re interested, when I want serial debugging, I revert to using a cheap-as no-name CP2102 USB-TTL serial adapter from ebay, I have several of them around the place, they’re cheap and have an OK driver so cause few issues (not all cheap devices are this easy :slight_smile: ). Saves me using my “good” USB-serial devices (my FTDI’s) on transitory projects (who am I kidding, actually I’ve never used my FTDIs on a Fez project :slight_smile: )

As you say, now onto CDC !