Hi mjr...so I'm off work today and digging into this. I built the repository and put the new bin file on the card. One thing I'm not sure about is how to verify it actually loads the new image correctly. I had issues when I was updating the bootloader. It seemed to take several tries before I got it to update. I was using the SDA_INFO.HTM page to verify my boot version and it took 3 tries before the version number changed. So I wanted to know how to be sure its updating your application bin file. After I place your bin file in the board and then pull the USB cord, wait a few seconds, then plug it back in. Then I disconnect again and power back up into the bootloader the stats page is showing the application version as 0.00....should I be seeing something different there? Plus I wanted to verify when you put a new bin file on the board you don't need to plug a second USB cable into the board do you because I've just been disconnecting from the programming port and plugging back into the joystick port to do the updates.
So I also tried the config tool and I'm getting an error. I have Visual Studio 2008 so I did some debugging with the config tool application and I narrowed it down to where its doing the initial communication with the card during the FindDevices method. The report size is coming back as 13 bytes but your expecting 15 bytes. After the dialog about that error the form still comes up showing the unit as number 8. If I try to disable the plunger since I don't have it hooked up yet I get another error "Error sending request to device: The supplied user buffer is not valid for the requested operation (Win32 error 1784)". I can dig into this more but you may be able to tell me whats wrong quicker than I can find it.
Update: Looking at the USBJoystick.cpp for the embedded code it has const int reportLen = 14;
The buffer size error definitely means a version mismatch between the config tool and the controller software - the report size of 13 means that you have an older version of the controller software, so this confirms your suspicions that the KL25Z isn't updating properly.
(The controller side and the Windows side will always be off by one on buffer length, by the way. The "report type" prefix byte is hidden on the device side but visible on the Windows side, so the Windows report length will always be one byte longer. 14 bytes on the controller == 15 bytes on Windows.)
First, you should double-check that you installed the right boot loader originally. There are two versions of the KL25Z boot loader in the PEMicro zip file. The one you want is MSD-DEBUG-FRDM-KL25Z_Pemicro_v114.SDA. I think the other one is for use with the Code Warrior dev platform. This is another detail I added to the guide after other people ran into it, so it might not have been mentioned in the version you first got.
There's definitely not much feedback from the boot loader either when you install it or when you load new software with it. The easiest way I've found to be sure that an update goes through is to keep both USB cables plugged in while you're doing the update. If you do that, you should hear the Windows "USB device removed" sound effect followed a few second later by the Windows "USB device connected" sound effect. The boot loader automatically reboots the KL25Z after the install completes, so Windows will detect the device being unplugged and plugged back in. If that *doesn't* happen, you know something went wrong with the update. There's also the KL25Z SDA LED - the green LED closer to the programming port, not the RGB LED that the controller software uses as an indicator. The green LED should blink rapidly while the boot loader is doing a download of new software, and should then turn solid green again after the software is installed. If it's not solid green at the end of the download, there's something wrong.
One thing to check is that the virtual flash drive on the KL25Z isn't full. Your web browser is probably putting a suffix - [1].bin, [2].bin, etc - at the end of the filename each time you build a new copy on mbed, so they look like separate files to the KL25Z. The disk is only 128K so you'll eventually fill it up this way. I think it automatically clears out old files each time you power cycle the board, so if you're switching cables this might not be an issue for you. But you might want to look at the drive contents in Windows, and if there are a bunch of old .bin files sitting there, just delete them from Windows to free up space.
Apart from the disk-full situation, I can't think of any other failure modes I've run into with the MSD-DEBUG boot loader. It was a colossal pain to get the boot loader going in the first place because of the Windows 8.1 glitches in the factory firmware, but once I got past those it's been trouble-free, so I'm afraid I don't have anything from own experience that would explain flaky update behavior.
Edit: forgot to answer your question about the USB cables. You are correct - you only need one cable. You can switch back and forth between the ports as needed. You *also* can leave both plugged in all the time if you want, but that's not necessary.
Edited by mjr, 29 August 2014 - 06:09 PM.