New serial protocol / MS3 pre1.1 alpha codes 12+

Testing and development of Megasquirt 3

Moderators: muythaibxr, jsmcortina

New serial protocol / MS3 pre1.1 alpha codes 12+

Postby jsmcortina » Sat Jul 02, 2011 4:25 am

EDIT: jump to alpha12 release here: viewtopic.php?f=125&t=41274#p290770

For a while now we have been working on a new error checked serial system for communication between TunerStudio and MS3. PhilT has made the additions to TS and I've added the firmware side.

Now that alpha11 has been released, it is the intention to focus on just this "newserial" for the next alpha release. (Unless any show-stopping bugs crop up.)

The serial changes should be totally behind the scenes to most users but should improve the robustness of the protocol, however, in the process a lot of code has changed so there is a lot to test. The end result will be good, but there are likely a few icebergs on the way.

We'll likely want some "super-alpha" testers in the near future once Ken and I have tried this on our cars.

James
I can supply, repair or upgrade Megasquirts in UK.

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 27131
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

Re: New serial protocol

Postby ashford » Sat Jul 02, 2011 6:16 am

i have a ms3 with a dead battery voltage circuit (ad4) and a known noisy, problem car/mainboard. if you can turn off batt v checks i don't care if i fry the processor or not.
ashford
Master MS/Extra'er
 
Posts: 797
Joined: Sun Apr 27, 2008 4:29 pm

Re: New serial protocol

Postby prof315 » Sat Jul 02, 2011 7:02 am

Count me in James. I'll step up to alpha 11 today. I was planning on working on the car all weekend anyhow getting my water injection up an running.

Jeff
Linfert Performance: The Megasquirt guy in Central Florida
92 Corrado 2.0L ABA and Borg Warner EFR 6258 on MS3Pro.
Support the developers!
prof315
Super MS/Extra'er
 
Posts: 1836
Joined: Sun Jan 18, 2009 3:13 am
Location: Melbourne, FL

Re: New serial protocol

Postby y8s » Sat Jul 02, 2011 7:45 am

I wont get a chance to load up alpha 11 until after the 4th but am happy to test that and the upcoming stuff.
y8s
Master MS/Extra'er
 
Posts: 478
Joined: Wed Jan 07, 2009 3:21 pm

Re: New serial protocol

Postby UnaClocker » Sat Jul 02, 2011 9:42 am

My Monday-Friday spare time has evaporated with my new job, but if you need testing on a weekend, I DEFINITELY have a problematic serial connection in my car. I'd be more than happy to do some testing, I can do both PL2303 serial adapter and the onboard USB.
I was getting ready to take some drastic measures to fix my problem, like buying a new MS harness and rewiring the whole thing from scratch, as well as removing the IGBT's and injector drivers from inside the MS completely.
Any chance you're going to turn up the serial speed? I've been told that you can go up to 230k or even 500ish? That'd definitely be a way to test the robustness of your new protocols and methods. Might not normally need that kind of speed, but with an ADC heavy CAN device, it seems to overwhelm the 115k connection when you have both INI's enabled.
Brian
'84 Dodge Rampage
User avatar
UnaClocker
Super MS/Extra'er
 
Posts: 1932
Joined: Fri May 07, 2004 12:59 pm
Location: Tacoma, WA

Re: New serial protocol

Postby jsmcortina » Fri Jul 15, 2011 1:46 pm

Nearly there... the "new serial" release should be out in a few days all being well.

Una, increasing the serial speed could be problematic though - the CPU has this other task of actually running an engine to contend with as well. But if you want to test it you MUST have been on alpha11 first.

James
I can supply, repair or upgrade Megasquirts in UK.

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 27131
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

Re: New serial protocol

Postby MWPau » Fri Jul 15, 2011 6:08 pm

Details on the new protocol?
How are you adding CRC (i gather its CRC) while keeping backwards compatibility?
Toyota Celica GT4/Alltrac (ST185) with 5S-GTE stroker (ST215 based).
MS3 + MS3X + TinyIOx
MWPau
Helpful MS/Extra'er
 
Posts: 131
Joined: Thu Mar 03, 2011 6:24 pm

Re: New serial protocol

Postby UnaClocker » Fri Jul 15, 2011 6:17 pm

MS3 is already not backwards compatible. You must be using TunerStudio. MegaTune ran into a wall before the MS3 project even started.

James, I'll make a point to get the car up on Alpha 11 between rain showers this weekend. I hadn't moved up to 11 because it didn't seem to change anything relevant to my setup, but I'll give it a whirl and make sure it's still working for me. And for the record, I gave up on sequential and COP. It's nice having it just fire up when I turn the key, not worth the hassle my screwball cam signal was causing.
Brian
'84 Dodge Rampage
User avatar
UnaClocker
Super MS/Extra'er
 
Posts: 1932
Joined: Fri May 07, 2004 12:59 pm
Location: Tacoma, WA

Re: New serial protocol

Postby racingmini_mtl » Fri Jul 15, 2011 6:21 pm

The lack of compatibility is not in the serial protocol but in the ini format. That's a different issue.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
racingmini_mtl
Super MS/Extra'er
 
Posts: 6286
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada

Re: New serial protocol

Postby UnaClocker » Fri Jul 15, 2011 6:28 pm

Oh, I get it.. He's thinking of something like the Megaview or something along those lines? Eh, those things should have been using the CAN bus.. Maybe someone can add CAN support to the Megaview, or a new version could be created.
Brian
'84 Dodge Rampage
User avatar
UnaClocker
Super MS/Extra'er
 
Posts: 1932
Joined: Fri May 07, 2004 12:59 pm
Location: Tacoma, WA

Re: New serial protocol

Postby xrattiracer » Fri Jul 15, 2011 11:35 pm

ive been running alpha 11 on mine, but have only done one autocross event with it so far. did some minor tweaks to the tune and took a couple small datalogs without issue, but otherwise have not done much that required serial comms.
xrattiracer
Experienced MS/Extra'er
 
Posts: 195
Joined: Fri Aug 01, 2008 2:25 pm

Re: New serial protocol

Postby jsmcortina » Sat Jul 16, 2011 4:45 am

Megaview doesn't work with the new serial yet (but I will make it.)

James
I can supply, repair or upgrade Megasquirts in UK.

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 27131
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

Re: New serial protocol

Postby jsmcortina » Sun Jul 17, 2011 7:14 am

New serial / alpha12 release

Requirements:
You must have been running alpha11 successfully before trying alpha12
Tunerstudio beta >= 1.074 is needed.
( http://www.efianalytics.com/TunerStudio/beta/ )

Major changes since alpha 11
New serial protocol.
All transactions to/from the MS3 are sent in CRC checked packets. The aim here is to eliminate the uncertainty that was present in the existing serial system. This involved almost a complete re-write of the serial system. A full transaction is read into memory and then processed if the packet passes size and CRC checks. (Previously the serial was handled on-the-fly with no checking.) This has removed most of the interrupt-side serial code and it is now handled in the mainloop.
Testing by JSM/KC/PT so far seems to be positive, but wider field testing could easily reveal unexpected issues - be careful !

Small changes:
Add option to only correct in EGO between a specific threshold.
Add CLT lower threshold, below which wastegate is held open.
Add option to turn on fan with AC button or not.
ini tweaks per PT
V3 board injector testmode 'all'
Firmware loader allows tune to be refreshed while preserving sensors and is more verbose about what it preserved.

Known issues
The firmware loader isn't 100% perfect at detecting between old and new serial formats, more work required.
Megaview will not work yet.
SDcard serial utility programmes will not work yet.
JBperf IO-Extender time-set utility will likely not work. (untested)
Any other utilities, loggers or dashes that use old serial will not work.

The alpha release is available from:
http://www.msextra.com/doc/ms3/files/alpha/

James
I can supply, repair or upgrade Megasquirts in UK.

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 27131
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

Re: New serial protocol

Postby jsmcortina » Sun Jul 17, 2011 7:19 am

I can supply, repair or upgrade Megasquirts in UK.

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 27131
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

Re: New serial protocol

Postby racingmini_mtl » Sun Jul 17, 2011 7:30 am

Is there a way for some CAN passthrough applications, such a the IOx utilities, to detect that it is connecting to an MS3 with the new protocol? That would be very useful to be able to do that without requiring the user to know about it. So if the old format commands such as 'Q' or 'S' are still there and can return something that would identify the code is using the new format then that would be a good way to do it.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
racingmini_mtl
Super MS/Extra'er
 
Posts: 6286
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada

Re: New serial protocol

Postby jsmcortina » Sun Jul 17, 2011 7:37 am

I need to add more to that doc...
The old style 'Q' and 'S' are supported both as before and in newserial mode. I also added a command 'F' that returns 001 for newserial and times out returning nothing on oldserial. You could also send an unsupported command 'N' perhaps and newserial will return with an error message.

If you have any thoughts on better ways of handling this, I'm happy to consider adding some else to the new firmware.

James
I can supply, repair or upgrade Megasquirts in UK.

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 27131
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

Re: New serial protocol

Postby racingmini_mtl » Sun Jul 17, 2011 7:46 am

Should we add the 'F' command to MS2/Extra for future release? I assume it could return 000 which could speed things up a bit when using CAN passthrough. By the way, is the 001 three bytes with 0, 0 and 1 or 3 bytes with ASCII values so 48, 48, 49 or something else?

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
racingmini_mtl
Super MS/Extra'er
 
Posts: 6286
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada

Re: New serial protocol

Postby jsmcortina » Sun Jul 17, 2011 7:50 am

ASCII '0','0','1'
Yes we could add this to MS2/Extra and MS3 release. As I said, I'm open to any better ideas?

James
I can supply, repair or upgrade Megasquirts in UK.

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 27131
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

Re: New serial protocol

Postby racingmini_mtl » Sun Jul 17, 2011 8:06 am

Actually, that's the type of thing I would have done so it's fine with me.

One thing I would change is the header of the new protocol. Since you will likely not be using 16 bits for the packet size, you could reserve 4 bits for the format number. That way the ECU is certain that the PC is actually sending the format it is expecting. Of course that limits the format numbers to 16 and the packet size to 4K but that should be acceptable.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
racingmini_mtl
Super MS/Extra'er
 
Posts: 6286
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada

Re: New serial protocol

Postby racingmini_mtl » Sun Jul 17, 2011 8:18 am

One more question. Does the CRC32 include the payload size or not?

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
racingmini_mtl
Super MS/Extra'er
 
Posts: 6286
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada

Next

Return to MS3 Development

Who is online

Users browsing this forum: No registered users and 2 guests