Savvy CAN low speed GMLAN (SWCAN) "hack"

This is my first time using Savvy CAN…wow is it an awesome piece of software. Excellent work to all who were involved in making it!

Unfortunately the one huge downside is that it doesnt support the third SWCAN bus on the M2.

But for anyone with a GM vehicle that wants to log both high speed GMLAN (500k) and low speed GMLAN (33k SWCAN) simultaneously…here is a quick and dirty hack:

Basically what you’re going to be doing is using the M2’s “MSCAN” port as SWCAN. Yes, MSCAN is dual-wire and SWCAN is, well, single wire. But all you have to do is tie the “MSCAN -” wire to ground, and the “MSCAN +” wire to the SWCAN pin on the OBD port (pin 1). And set the baud rate for “CAN1” to 33333 of course.

I made a little plug and play OBD port adapter for the M2 that does this “re-wiring” of the MSCAN +/- ports to the SWCAN pin and ground, respectively.

Is it “proper” to interface with a SWCAN bus this way? No, and Im sure Ill have the electrical engineers coming after me with pitchforks for doing this. But whatever, for tinkering around, it works perfectly fine.

Hopefully the Savvy CAN crew adds true SWCAN support using the M2’s MCP2515/TH8056 soon…but until then, heres something to get the GM guys up and running on both busses. :+1:

Ben

=============================================================

That would be the second canbus port I assume?

The savvycan recognizes the SWCAN interface being there so hopefully it won’t take much to get it working.

Rodney

The single wire can stuff you see in SavvyCAN is a relic of an older project to add SWCAN to an EVTV CANDue 2.0. So, unfortunately it doesn’t have much to do with SWCAN support on the M2. However, technically SWCAN is initialized by M2RET at this point. The only thing is that SWCAN frames aren’t read and forwarded to SavvyCAN. It would not take a lot of extra code to make this happen. I’ll try to push this through the pipeline fairly soon.

That would be awesome if Savvy CAN could be made compatible with the SWCAN bus on the M2!!!

I havent looked too deeply into the M2RET code…but do you think it could be done just in the M2RET code alone? Or would the SavvyCAN software also need work?

I only need to log two CAN busses at once, high speed CAN, and SWCAN…so I wonder if it would be possible to tweak the M2RET code to simply feed the MCP2515/TH8056 SWCAN traffic into SavvyCAN via “CAN bus 1”, while using “CAN bus 0” as regular high speed CAN?

So effectively, SavvyCAN wouldnt even know/care where its getting the data from, the M2RET code is just spitting out “bus 1” data received from the MCP2515 instead of received from the Due’s internal CAN bus-1 controller???

Or is there a lot more complex nuts and bolts going on between SavvyCAN and the M2RET software when initializing and piping stuff?

Ben

Maybe something along the lines of:

-add the MCP2515 initialize code in setup, set the CS and INT pins etc.

-set the SWCAN mode pins both high, so TH8056 goes to normal mode

-modify this bit of code so that instead of reading in CAN traffic from the Due’s internal CAN-1 controller,
it reads in CAN traffic from the MCP2515…?

change it to something like:

if (!digitalRead(SWCAN_INT)) {
SWCAN.readMsgBuf (incoming);
addBits(1, incoming);
toggleRXLED();
if (isConnected) sendFrameToUSB(incoming, 1);
if (digToggleSettings.enabled && (digToggleSettings.mode & 1) && (digToggleSettings.mode & 4)) processDigToggleFrame(incoming);
if (SysSettings.logToFile) sendFrameToFile(incoming, 1);
}
}

===========================================================================

if (Can1.available()) {
  Can1.read(incoming);
    addBits(1, incoming);
    toggleRXLED();
    if (isConnected) sendFrameToUSB(incoming, 1);
    if (digToggleSettings.enabled && (digToggleSettings.mode & 1) && (digToggleSettings.mode & 4)) processDigToggleFrame(incoming);
    if (SysSettings.logToFile) sendFrameToFile(incoming, 1);
}

====================================================================================

Not sure if this helps, but I just posted a quick example of how to receive (and send) SWCAN frames and print to terminal. Of course this is a very simple sketch and only prints raw data.

Wondering if the h/w hack is still the only way of capturing SWCAN in SavvyCAN?

Just received my M2 and for a 1st project needed to capture window switch control msgs. Reading How I reverse engineered everything for my car seems to indicate it is the lowspeed CAN I need to capture on my 2014 Holden/Chevy SS.

The SWCAN is likely the correct bus. From what has been posted so far you are correct. I don’t believe SavvyCAN has been changed to support a third bus at this time but he has added support for looking at the SWCAN from savvycan from one of the standard buses as far as I can tell. Maybe Collin will chime in.

DMaxBen posted a way to do it currently. Basically, single wire CAN is just like normal CAN except that instead of two wires called High and Low you have High and ground. Standard CAN is differential and does not need a common ground connection between all of the nodes on the bus. So, you can do like he said and just connect the CAN-L pin of one of the standard CAN buses on the M2 to ground and then use CAN-H for the SWCAN wire. This will work if you set the speed to 33333. Technically M2RET does support SWCAN natively on the proper SWCAN pin. If you bring up a serial console you can send and receive SWCAN traffic from M2RET. The problem is that SavvyCAN doesn’t pay attention to this third CAN port so you won’t see anything show up in the GUI. So, yes, currently his hack is necessary if you want to use the GUI. The only thing you’d lack while doing this is that you can’t do HV wake up on the single wire CAN with the standard ports.

Anyway, sorry it isn’t in there yet. I’ve been pretty busy recently. I do hope to get support for SWCAN into SavvyCAN soon.

Thanks for your replies guys, and thanks CollinK for your work.
No probs, just wanted to check b4 ordering the connectors.

Collin thats awesome to hear! Im really looking forward to native SWCAN support in SavvyCAN…thats going to be huge for the GM guys.

Ben

1 Like

Hi dmaxben,

I’m just getting into GMLAN myself an need a suitable simulator/ECU. I see from your photo above you have a BCM P/N 22737275. If you think this is a reasonable starting point then I can get one off ebay, but can’t find a wiring diagram. Do you have a pinout or can you tell me the pins to get GMLAN connected? Thanks and sorry for going a bit off topic.

Seeing another reply in this thread reminds me… SWCAN support is in SavvyCAN in V180. So, if you have everything up to date you can do SWCAN captures now. Make sure to update M2RET to the latest published version too.

Yep! The latest version of SavvyCAN 64-bit works perfectly for SWCAN…again, excellent work Collin!

One thing I noticed is the 32-bit version doesnt seem to have SWCAN working? My main laptop has a bad battery so I grabbed an older laptop (windows 7 x86) when I wanted to try some stuff out the other day, so I downloaded the 32-bit SavvyCAN, and SWCAN did not work.

Check the 32 bit version number. When I downloaded it last week it was still version 174 and NOT 180.

Hopefully @CollinK will see this response and update the 32bit version. I am sure it was just missed.

With all this good feeling around can I get a reply dmaxben?

green connector, pin 21 and pin 14 are “switched ignition” power.

Blue connector, pin 2 and pin 3 are “constant battery” power.

Blue connector, pin 5 is “ground”.

Blue connector, pin 10 is SWCAN (low speed GMLAN)

Blue connector, pin 8 is high speed CAN “+/high”

Blue connector, pin 9 is high speed CAN “-/low”.

1 Like

I have GM Factory service manual if you need anything more specific. Covers up to 2009 GM vehicles.

Thanks so much. I’ve just ordered the ECU today and won’t have it until January so I might pester you in the new year. I can see from ben’s picture which the blue and green connectors are so the only issue I might have is knowing which pin is which.

Why do you have to wait until January?