Due to how SPI works in mbed, using the FIFOs would only slow it down. The overhead depends on the clock speed you are using. If you are more in a hurry you can use BurstSPI lib, but to be fair, if you are looking at speeds of <5MHz the overhead should be negligible.
Regarding PWM, try adding a wait (or random other statement which takes more than 20ms) in front. Setting up the PWM already changes the period/dutycycle registers. Sadly I have been working on that PWM way too long to get a normal PWM functioning properly, but in the end it did not seem possible to make those buffers do what I want them to do, what for example the KL25 PWM buffers can do. The K20 has a different version of the timer for PWM, it has a legacy mode, and that legacy mode of course does not work the same as the legacy PWM peripheral does. So plan A would have been to follow the route the KSDK (K64F/K22F) boards (and too many others) use: That is everytime you switch to a different pulsewidth/period, reset the complete timer, change the values, start the timer again. I considered this unacceptable.
What it does now is have some kind of synchronization enable. Software sets a flag to sync the values in the registers to the PWM hardware at the right moment (so you don't get glitches), and new reads are only done once the old write has been processed. Since the pwm = 0.5 needs to read the current period, and that has only just been set, it needs to wait 20ms (default period).
So, option A: Don't use the pwm.write, but use the pulsewidth functions. These dont need to read and always happen immediatly. Or use the pwm.write, but do not do multiple write actions in a single period. Yes, I could have added software registers which would also keep track of all the pulsewidths and periods of the different pins. But since I considered it to be a quite unlikely situation after initial setup, I decided not to do this, and in general I considered having good output waveforms to be too important to go the route many other targets use of resetting the PWM all the time.
For the first one: Such things can happen indeed :). Which pins specifically? Is easy enough to fix it.
Finally, your first one: So you got the program you linked, removed mbed lib, and imported mbed-src lib instead? I just tried to check it, and compiles fine for me. From the compile dropdown menu you can also try compile-all, this does a clean compilation from the start.
Hmmm, i went to the your mbed-src URL and imported the library (had to remove the old library from the program folder first). but the compile failed looking for toolchain.h .... I've never tried this kind of mbed update before to on-line compiler ???? i'm testing with https://developer.mbed.org/users/yoonghm/code/Teensy_MBED_BLINKY/
Other observations on teensy3.1 platform: 1) i think the I2C pins are revsersed in PinNames.h 2) tried a simple PWM test, a pwm.write(0.5); took over 19 ms!! i need to view with logic analyzer 3) SPI speeds are not near SPI CLK rate, presumably FIFO's aren't being used as in teensyduino firmware...
thanks for porting the MBED stuff to teensy3.1, an ambitious undertaking!