Gas station without pumps

2015 July 30

Getting KL25Z bootloader to work without Windows 7

Filed under: Circuits course — gasstationwithoutpumps @ 20:26
Tags: , , , , ,

The one thing I hate about the Freedom KL25Z boards is that they are shipped with a bootloader that doesn’t work.  More precisely, they are shipped with a bootloader that works only with Windows 7, not Mac OS X, not Linux, and not even Windows 8.  (Note: never get P&E Micro to do any software work for you—they are responsible for this crappy bootloader.)  There is a newer bootloader from P&E Micro, but you need a Windows 7 computer to download it, so that does no good at all (it’s worse than that: see below).

I bought a new KL25Z board recently, to replace one that my son borrowed for Futuristic Lights, and soldered up the headers today, and was ready to test it out. I was hoping that they were now using one of the newer P&E bootloaders, that supposedly works on Macs (I’ve never seen a P&E bootloader that works with Macs, but I was willing to believe that P&E got enough complaints that they eventually fixed their bugs). Unfortunately, what I got is

MicroBoot Kernel Version is: 1.05
Bootloader Version is: 1.09

but P&E Micro reports

Bootloader versions 1.10 and earlier are not allowing firmware update and MSD FLASH programming on my OpenSDA board, with the Linux, MacOS, or Windows 8/8.1 operating systems.

I understand that on some of their newer boards, Freescale is using the bootloader, which is the one I want to install on my KL25Z board. My choices at this point seem to be:

  • Take the 6.5-mile bicycle ride round-trip to campus to use an ancient Windows 7 machine from the circuits lab (this is what I’ve done in the past).
  • Buy a Windows 7 laptop to use at home, for initializing KL25Z boards and for testing PteroDAQ multi-platform support.
  • Look on the web for a workaround.
  • Ask my son if he found a workaround for his Linux laptop.

I’m too lazy to bike to campus (I did that cycle ride 4 times in the last 6 days), and I can’t get a laptop delivered instantly (and it will take quite a bit to put aside my aversion to Windows enough to buy even an $85 used laptop with Windows). That leave the web search and asking my son.

I did find a workaround on the web for Windows 8 []:

Configure “Do not allow locations on removable drives to be added to libraries”  as discussed here: and you should be able to do updates from Windows 8.1.

I don’t know whether this workaround works, as I don’t have access to a Windows 8 machine to test it on.

My son pointed me to a workaround that has been posted for Linux systems [], and that he has used successfully. I tried that on Mac OS X, but the utilities for manipulating mounting of disks is different—you need to use ‘diskutil unmount’ and there is no “modprobe”.

I tried doing the closest corresponding actions on Mac OS X, but they did not work.  I could unmount and mount the disk easily enough (it showed up as /dev/disk1, which can be most easily discovered with ‘diskutil list’), but copying the mbed sda file to the disk still had no effect.

We tried the original script from on my son’s Linux laptop, and it worked ok.  We could install the firmware (from using the Linux script with the unmount/mount trick. The mbed software worked as usual to download PteroDAQ to the board.

I think tried some more experimenting. We updated the Bootloader to v1.11, using the latest download from P&E Micro, as pointed to by their OpenSDA page. The update worked, to the extent that the Bootloader reported being v1.11, instead of 1.09, but despite P&E’s claims, it still did not work with Mac OS X. I could not download P&E micro .SDA files nor  the 20140530_k20dx128_kl25z_if_opensda.s19 file from

So we used my son’s Linux laptop again to put the mbed software on the KL25Z board, and I’ll have to be carefully not to get into Bootloader mode unless either he’s around with his laptop or I’m willing to cycle to campus.  (Or I break down and get a junky Windows laptop just for rebooting KL25Z boards.)

My son has been suggesting that we get a junky Windows box, so that he can test out the multi-platform features of PteroDAQ without having to cycle to campus with me.  I might do that while he is away at Ashland next week, if I can find a cheap enough laptop that I believe will actually function.

2014 March 31

First day of S14 circuits class went ok

Filed under: Circuits course — gasstationwithoutpumps @ 21:21
Tags: , , , , , ,

I went into the class with a long to-do list, and managed to cover the following:

  1. Issued permission codes for students with missing prereqs to register but I forgot that they’d need permission codes for BME 101L as well—I’ll give those out as soon as I get them. The class is up to 9 students, which is still much less than the 20–40 I had projected. I’m going to have to use the same parts next year, so that the over purchase doesn’t cause budget problems.
  2. Went over syllabus .I showed them the syllabus and managed to go over scheduling of labs, partner work, and online texts, but did not get to some of the boilerplate about cheating and about disability services.  Oh well, it is enough that the boilerplate is on the syllabus.
  3. Demoed pressure sensor and EKG with PteroDAQ on KL25Z board. I explained that I chose these labs to demo, since they were soldered onto protoboards, and so sturdier than ones built on breadboards. Amazingly, the alpha prototype of PteroDAQ worked fine for the demo. I was even able to illustrate a debugging technique. The EKG seemed to be missing a lot of my heartbeats, so I saved the data to a file, looked at it with gnuplot, and zoomed in, where it became obvious that the problem was that the R pulses on the EKG were shorter than the time between samples. I went back to the PteroDAQ control panel, increased the sampling rate from 20Hz to 120Hz, and took another 30 seconds of samples.  Saving that and viewing it with gnuplot made it clear that the EKG amplifier was working fine, and the PQRST parts of the EKG signal were all quite clear.
  4. Ohm’s Law V=IR:  The students volunteered this when I asked them the relationship between voltage and current.  Good!
  5. Kirchhoff’s Current Law:  Again many had heard of the concept that if charge is not accumulating (steady-state), then the current into a node is the same as the current out of the node. In general, that the sum of all currents into a node is 0.
  6. Explained about voltage being a difference between two nodes or across a component, and contrasted that with the current through a component. I implicitly used Kirchhoff’s Voltage Law by introducing the notion of voltage at a node, as the voltage between that node and an arbitrarily chosen node that we call “ground”.
  7. I showed them a voltage divider and had them derive the voltage across each resistor (from having the same current), then from there deriving the voltage across the resistors in series (thus deriving the idea that series resistors add). We then solved for I in the Vin equation and plugged it into the equation for Vout, getting the standard voltage-divider formula V_{out} = V_{in} \frac{R_{down}}{R_{up}+R_{down}}.
  8. I introduced the notion of an NTC thermistor (and listed other temperature sensors: PTC thermistor, RTD, thermocouple, bandgap temperature sensor, giving a brief idea when each would be used). I did not plot the resistance as a function of temperature based on the model , but that would be a good thing to do in the gnuplot lesson on Wednesday.
  9. I did explain the notion of sensitivity of a sensor: the derivative of the output with respect to the input, and went over (in a general way, with helpful suggestions from the students) how one would go about maximizing sensitivity of a voltage divider with a thermistor and fixed resistor at a particular operating temperature.  I’ll see in lab tomorrow or during the analysis session on Wednesday whether students got the idea or not.

It was a very content-full class, but I did manage to get in a number of side remarks:

  • reading the lab handouts well before lab, since they weren’t fill-in-the-blanks worksheets, but sometimes had design assignments buried in them.
  • partners changing every week, so no one gets a free ride for very long and no one has to suffer with a freeloader.
  • no failures on lab reports—just REDO, until the end of the quarter, when all un-redone work turns to F.
  • need for perfect schematics. Sloppy schematics will trigger an automatic REDO.
  • one of the students asked about the circuits-class t-shirt I was wearing, and I explained that I’d created the shirt for last year’s class and that if students were interested we could do another order this year.

Overall, I’m fairly happy with how the first day of class went.

I’m less happy with the rest of the day, though. In the morning my son accompanied me to the lab to help me set up the Windows drivers and to test PteroDAQ on the Windows machines, but the lab staff had changed the system they used for authenticating administrators, so I couldn’t install the drivers. I knocked on their door (no answer) and sent them e-mail through the request system, but it took them about 3 hours to answer (by which time my son had gone home and I was teaching class). After they had reauthorized me, I spent 2 hours installing Windows drivers on the 12 machines in the lab, so that they could talk with the KL25Z boards.  (Windows is a major pain—I really hate having to deal with it.)  I finally got a chance to test PteroDAQ on the Windows machine, and it didn’t work—I tried installing Python3.4 on one of the machines and that changed the nature of the error, but did not fix it. [Did I mention that the students have to be able to use it on Thursday?]

My son will go in with me again tomorrow (he’s on Spring break) and try to get the PteroDAQ function at least to the level that it is at on the Mac, which is minimally functional under Python3, but with a mysterious failure to open the USB serial port under Python2.7.

I also found out that the missing parts that the lab staff forgot to order have just been shipped from Hong Kong, and should be here next week.  Unfortunately, that includes the USB cables that the students will need to connect up the KL25Z boards. [Did I mention that the students have to be able to use it on Thursday?]

Also, the TA union is probably going on strike system-wide Wednesday and Thursday. I don’t have a TA, but there will probably be pickets at the base of campus and city buses won’t cross the picket lines, so there will probably be some students who can’t make it to class or lab. (I never penalize students for honoring picket lines, but it is going to be very difficult to get back on schedule if we fall behind.

On the subject of possibly falling behind—the campus facilities people are promising some long power outages mid-week one or more times during the quarter—they find it better to make everyone else stop working rather than work on weekends themselves, I guess.

I did get the cups and coffee urn for the water baths needed in this weeks lab transported to the lab, but I found out that the staff had not ordered any 22 gauge hookup wire—there was only a small amount of red and black 24 gauge wire in the lab. The soldering irons weren’t in the lab either, but I need them for tomorrow’s lab. With the small class, I can probably get away with only 5 soldering stations, but I don’t even have a working one I can bring in from home.

One of the students in classed asked about the jumper wires I was using to connect to the KL25Z board.  I was using 9″ long female-female jumper cables with double-male pins (something like these from Adafruit though I probably bought them elsewhere).  I have a very cheap set of male-male jumpers, but I rarely use them, because they are incredibly high resistance (on the order of ohms instead of milliohms).  Adafruit has some high-quality male-male jumpers, which may be easier to work with than the female-female ones that I’ve been using. Sparkfun has a mixed pack (half M/M and half F/F), but a set of 100 is is $25.

The students are supposed to have double-male header pins in their kits anyway, since the pins are very handy for making oscilloscope probe points on a breadboard.




%d bloggers like this: