| 1 |
================================ |
| 2 |
Teensy 3.1 SPI + LPC/FWH Flasher |
| 3 |
================================ |
| 4 |
|
| 5 |
Note: this was made for the Teensy 3.1, but 3.2 should be compatible too. |
| 6 |
|
| 7 |
Hardware |
| 8 |
======== |
| 9 |
|
| 10 |
.. image:: 300px-Teensy31_lpcspi_flasher.jpg |
| 11 |
|
| 12 |
The hardware is made of a `Teensy 3.1 <https://www.pjrc.com/teensy/teensy31.html>`_ and a shield-like PCB over it. |
| 13 |
Schematic and board files for the PCB can be found `in the github <https://github.com/urjaman/frser-teensyflash/tree/master/hardware>`_. |
| 14 |
The PCB is also shared `at OshPark <https://oshpark.com/shared_projects/izukIxq8>`_. |
| 15 |
|
| 16 |
Other components required: |
| 17 |
|
| 18 |
* pin headers (total 28, but get more) |
| 19 |
* a DIL8 socket (if you want to use SPI DIL8) |
| 20 |
* a PLCC32 SMD socket (if you want to use LPC/FWH) |
| 21 |
* optional: small SMD capacitor - pad exists under the shield PCB |
| 22 |
|
| 23 |
Assembly |
| 24 |
-------- |
| 25 |
|
| 26 |
* start by installing the SMD cap (if available) and the DIL8 socket on the shield PCB |
| 27 |
* split appropriate strips of pin headers for the teensy and solder them on the teensy, you can use the shield pcb to align them |
| 28 |
|
| 29 |
* my arrangement was as pictured in order to have more ground clearance under the teensy for the prog button |
| 30 |
|
| 31 |
* push the shield pcb only a little bit on the pin headers, just so the headers dont come over the top of the PCB |
| 32 |
* solder two corner pins to keep the shield PCB in place, these can be done from above |
| 33 |
* solder the rest of headers from the underside while watching that you dont flood the topside with too much solder, especially for the ones close to the PLCC socket |
| 34 |
* in order to solder the SMD PLCC32 socket, you'll need to break out the middle plastic bit, but keep it safe |
| 35 |
|
| 36 |
* to protect from solder bridges forming between the pin headers and PLCC socket, i placed a very thin tape over the pin header holes on the pcb during the soldering |
| 37 |
* notice that the PLCC footprint isnt centered on the PCB, meaning dont try to align the PLCC socket exactly on the PCB |
| 38 |
|
| 39 |
* after soldering the PLCC socket, i installed the plastic bit back with a little bit of glue |
| 40 |
|
| 41 |
Software |
| 42 |
======== |
| 43 |
|
| 44 |
Firmware for the Teensy is available at https://github.com/urjaman/frser-teensyflash |
| 45 |
|
| 46 |
Also see the README in that directory, both it or this document might be outdated ;) |
| 47 |
|
| 48 |
As of writing the setup would be: |
| 49 |
|
| 50 |
* download arduino, extract it somewhere where you have write access |
| 51 |
* download the `Teensyduino thingy <https://www.pjrc.com/teensy/td_download.html>`_ |
| 52 |
* run it on that arduino tree |
| 53 |
* install the udev rules provided in the above url |
| 54 |
* compile and install the `teensy_loader_cli <https://www.pjrc.com/teensy/loader_cli.html>`_ in your path |
| 55 |
|
| 56 |
:: |
| 57 |
|
| 58 |
git clone --recursive https://github.com/urjaman/frser-teensyflash.git |
| 59 |
cd frser-teensyflash |
| 60 |
nano Makefile # Edit the TEENSYDIR path to include your arduino directory |
| 61 |
make |
| 62 |
make program-cli # If this waits you need to press the PROG button on the teensy |
| 63 |
|
| 64 |
After this you should be able to use it with flashrom serprog, for speedups and enhancements to serprog before they're upstreamed |
| 65 |
I'd suggest to use this flashrom tree: https://github.com/urjaman/flashrom/tree/sp-upstream3 |
| 66 |
|
| 67 |
Device should be something like /dev/ttyACM0 and the baudrate doesnt matter:: |
| 68 |
|
| 69 |
flashrom -p serprog:dev=/dev/ttyACM0:2000000 |
| 70 |
|
| 71 |
ISP Usage |
| 72 |
--------- |
| 73 |
|
| 74 |
The same software could be used on a bare teensy 3.1 for ISP SPI programming - this is untested and also the 3.3V supply in the teensy is not strong, so beware, but the SPI pins used would be: |
| 75 |
|
| 76 |
* CS: "Pin 2", PD0 |
| 77 |
* SCK: "Pin 14", PD1 |
| 78 |
* MOSI: "Pin 7", PD2 |
| 79 |
* MISO: "Pin 8", PD3 |
| 80 |
|
| 81 |
See https://forum.pjrc.com/threads/25643-Combined-Pin-Assignments-card for a good Teensy pinmap picture. |