The MS-II™ downloader by Eric Fahlgren now includes a "package browser", which lets the user pick a package site and grab the latest updated code/ini files directly via the GUI downloader, and the downloader will automatically update both MegaSquirt® and MegaTune with the right files.
You can get the V2.00 Downloader here: ms2dl200_setup.exe
Install the program like any other Windows application.
To do a code and INI update:
The downloader drops the .msu file into either the "car" directory or "car/packages" directory and then the downloader automatically stores them in car/mtCfg (unless it's not found in which case it drops them in "." - the directory in which the .msu file is found).
MegaSquirt/ Car1/ mtCfg/ extracted.ini packages/ *.msu
User Notes:
The quick synopsis is:
where you can grab files from anywhere and they end up in one MSP.
If you set the 'Settings/Verbosity' to 3 or higher, the main log window will display the ftp conversation (useful to debug things).
File Format
The following comments contain the official documentation of the MSU (MegaSquirt Update) file format.
Once you've got the program installed, you can look at the file:
for the documentation on the MSU file format as well as the source code.
The MSU file is pure text, with "fences" defining the sections. The sections may appear in any order, which can be useful in that they are processed in the order given in the file, so user-defined output messages can delimit the system status messages in a meaningful way.
There are four MSU keywords that have meaning, all are prefixed with these six characters: #!MSU-
The prefix must reside starting in the first column of the MSU file. The four keywords are: END, INI, OUT, S19 (described below).
Some keywords have argument lists enclosed in parentheses. Any text after the keyword or its arguments are ignored, so you can put commentary on the fence lines if you like (see the first and last lines of the example file below).
Keyword Descriptions
#!MSU-INI(file.ini)
where the "file.ini" part is extracted from the input and used as the name of the destination file.
NOTE: The GUI-based MS Downloader will determine the destination file location via a MegaTune-like search algorithm. (The command-line downloader forces you to supply the destination directory explicitly with the "-i" switch, otherwise it uses ".".)
a) If the .msu file is found in a directory named "updates", then the search begins in "..", otherwise it starts in ".".
b) If a directory named "mtCfg" is found, then it is used as the destination, otherwise the files are extracted into ".".
Based on this, it is strongly suggested that you install your update files into the following directory structure:
MegaSquirt\ Car1\ updates\ Put Car1 MSU files here. mtCfg\ Car1 INI files will be extracted into this directory. Porsche\ updates\ Put Porsche MSU files here. mtCfg\ Porsche INI files will be extracted into this directory.
Both of these uses are valid.
#!MSU-S19 #!MSU-S19(file.s19)
Example
Here's an example, which may be cut and pasted into a file for test purposes. The S19 section is gibberish, so while it will read in just fine, you should not use it while connected to an active MegaSquirt®.
#!MSU-OUT <-- This is the first line of the MSU file. ----------------------------------------------------------- WARNING! Read this first. This text block is copied to the output log window. #!MSU-S19 S02E0000433A5C4D5349495F454D4245444445445C4D5349495F56315F43575C62696E5C4D6F6E69746F722E61627393 S1138000CF3FFF16B744CED454CD3800CC00002760 S113FB0002C0038402D003D14FC7FFFF6E011E6EF3 S113FB10011F4502409445FB00AD22A600B705A68F S113FB2070B73EA604B73C0F3CFDB63DA1052529A0 S113FB30C6FAFEA1FF272220C487898A8819361BAA S104FF7EF688 S12340800848084008390831082A0822081B0813080C0807080207FD07F807F007E907E171 S123410006B806B306AE06A906A406A1069F069C069A06950690068B06860681067C0677B5 S9030000FC #!MSU-INI(megasquirt-II.ini) ;------------------------------------------------------------------------------- ;#alert "This 2.6 version of megasquirt-II.ini is not complete,\nget a newer one when it is available." [MegaTune] writeXML = true MTversion = 2.50 ; MegaTune itself; needs to match exec version. versionInfo = "S" ; Put this in the title bar. queryCommand = "Q" ; Verify against signature. signature = "MSII Rev 2.60000 " ; MS-II sends a null at 20th byte. ; 123456789.123456789. #if LAMBDA afrTable1 = array , U08, 48, [12x12], "AFR", 0.10000, 0.00000, 9.00, 20.00, 1 afrTable2 = array , U08, 192, [12x12], "AFR", 0.10000, 0.00000, 9.00, 20.00, 1 #else afrTable1 = array , U08, 48, [12x12], "AFR", 0.10000, 0.00000, 9.00, 20.00, 1 afrTable2 = array , U08, 192, [12x12], "AFR", 0.10000, 0.00000, 9.00, 20.00, 1 #endif #!MSU-INI(myCustom.ini) [MegaTune] MTversion = 2.50 [Units] TPS = "raw" #!MSU-OUT Read this last. ----------------------------------------------------------- #!MSU-END <-- This is the last line of the MSU file.
The downloader will produce a diagnostic error code (more correctly, it is the serial monitor on the MS-II™ that produce the error code that the downloader reports). These error codes have the following meaning:
Quoting these errors codes can be helpful when mentioning code loading issues on the forums.
The downloader also has a command line version (ms2dl.exe) included in the package. You can run the command line version in a script, so if you have makefiles or something of the sort, you don't need to interact with GUI version at all.
Look in the downloader installation directory (typically 'C:\Program Files\MegaSquirt\MS Download 2.00') and you'll see ms2dl.exe, which can be invoked from the command line (or .bat file) like this:
Where:
("ms2dl -h" gives you a usage message.)
You can even hook this up to one of the buttons/keys in the CodeWarrior IDE, if you are doing code development. Add it under 'Edit/Commands and Key Bindings', by creating a 'Downloader/DL to MegaSquirt' menu item. It should look like this:
You might need quotes around the 'Execute' field value if there are any blanks in the directory path. The 'Directory' field should be the path to the BIN directory containing the .S19 files (and will depend on your compiler set-up).