!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Note that he Teensy 3.1 doesn't have an onboard SD card socket
and so the SD card functionality is disabled in this version of
the flexible loader
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


This flexible uTasker serial loader combines SREC-UART loading with SD card and also USB-MSD loading.
It is configured to operate on the TEENSY 3.1 board and occupies about 25k of the K20DX256's
internal flash. The UART is connected to RX1/TX1 - the USB-MSD interface is on the processor board.


The boot loader mode is forced by grounding pin 20 [A7] at reset.
The watchdog can be disabled by grounding pin 21 [A6] when the board is reset.

The application is linked to the start address 0x8080.

For further details of the serial loader and its modes of operation see the user's guide at
http://www.utasker.com/docs/uTasker/uTaskerSerialLoader.PDF



The following files are included:

- uTaskerSerialLoader_Teensy_3_1.hex - This is the serial boot loader, which can be programmed to the board using Teensy Loader

- software_V1.4.004_serial.S19 is a test application that can be loaded via the serial interface at 115200 Baud N 8.
When the application runs it displays V1.4.004 as version number (hit the enter key when the application is running to see
this and a menu with further operations). Alternatively the application creates a virtual COM in the USB interface and the same
menu can be used there.


- USB_software_1.4.004.bin and USB_software_V1.4.0T4.bin are two binary images of the two slightly different applications that can
be loaded using USB-MSD (when the TEENSY appears as a hard drive at the PC).


One application displays the software version "V1.4.004" and the other "V1.4.0T4" (hit the enter key when the application is
running to see this and a menu with further operations on the UART or on the virtual COM port).
The version number allows one to verify that the application has been successfully changed.


- password.txt - The loader allows copying back the application via USB-MSD (dragging the software file back to the PC) however the content
of the file will be all zeros since also password protection is enabled. By dragging this file to the disk (see the content for password)
it will temporarily remove password protection (until next reset) so that the content is then identical to the application binary file.

- note that when uploading new application software via USB-MSD it is possible to upload a file with the same name as the one loaded by
overwriting the file rather than first deleting it.


uTaskerFreescaleVirtualCOM.inf and uTaskerFreescaleVirtualCOM_64bit.inf are included for virtual COM port use.

Note that the application size is limited to 130k. To enable larger applications the uTasker project can be built with adjusted
settings or loader modes removed to decrease the required boot loader size.
Get full details, source code and support for your own project at www.uTasker.com.

See the boot loader in operation at http://youtu.be/XVlCisUmJMI

Good luck with your use of the flexibly serial loader!


HELP: when something goes wrong here are a few tips:
====================================================
- If building the serial loader yourself with CodeWarrior 10.x select the target uTaskerSerialLoader and ensure that the processor code M4 and
linker script file K_256_32.ld is configured.

- In the project code make sure that #define TEENSY_3_1 is active in config.h and make any of your own changes here or in either app_hw_kinetis.h or Loader.h

- If you have loaded "uTaskerSerialLoader_Teensy_3_1.hex" but the board doesn't seem to run please check the following
-- It may be that there is some code already loaded to the board which means that the address 0x8080 is not deleted (0xffffffff).
This will cause the serial loader to try to start it and fail. Ground pin 20 [A7] at reset to force the boot loader to be sure - when the
loader is running the red LED on the TEENSY flashes at 2.5Hz

- If you load your own application make sure that it has its reset code is linked to be at 0x8080. Interrupt vectors should be run from RAM
or set to a location in the code (not left at 0x00000000)
- Also note that the serial loader starts the watchdog and retriggers it every 200ms (with 2s timeout). Your application should do this otherwise
it will reset after 2s. The watchdog can also be disabled in the serial loader by setting 
#define WATCHDOG_DISABLE()   1
in app_hw_kinetis.h
To test a disabled watchdog ground pin 21 [A6] reset.




