This flexible uTasker serial loader combines SREC-UART loading with SD card and also USB-MSD loading.
It is configured to operate on the Freescale TWR-K40D100M tower board and occupies about 25k of the K40X128's
internal flash. The TWR-SER extension board is required for UART and USB-MSD interface.


The boot loader mode is forced by holding down SW2 when the board is reset.
The watchdog can be disabled by holding down SW1 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_TWR-K40D100M.S19 - This is the serial boot loader, which can be programmed to the KWIKSTIK board
(for example by using CW10.x "Flash File to Target" function).

- software_V1.4.003_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.003 as version number (hit the enter key when the application is running to see
this and a menu with further operations)


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


One application displays the software version "V1.4.003" and the other "V1.4.0T3" (hit the enter key when the application is
running to see this and a menu with further operations - requires UART5). 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 remopve 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.



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 MK40X256VMD100_SERIAL_BOOT_FLASH.

-In the project code make sure that #define TWR_K40D100M 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_TWR-K40D100M.S19" 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. Hold down SW2 when starting to force the boot loader to be sure - when the
loader is running the freescale logo flashes in the display (deleting the entire internal flash before beginning helps).

- 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 hold down SW1 when the board is reset.



