Author Topic: KINETIS Project Code  (Read 26717 times)

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2747
    • View Profile
    • uTasker
KINETIS Project Code
« on: April 27, 2012, 03:50:25 PM »
Hi All

This thread contains all versions of the release code - the latest release is at the top and previous releases are maintained in descending order.
Please check the patch list after the release notes of each version to get latest information on workarounds or bug-fixes.

OPENSOURCE VERSION:  - download freely and anonymously V1.4.11 from 5.2.2016 from the thread

Release 1.4.12 - 22.1.2017 - made available for registered users with valid support contract via private SVN and GIT

- Replaced all IIC references by I2C (file names, defines, variables)
- Added FRDM_KEAZN32Q64, FRDM_KEAZ64Q64 and FRDM_KEAZ128Q80
- Added TEENSY3.5 and TEENSY 3.6
- Added S32 Design Studio Projects
- Added I2C slave simulator
- Added CMSIS FFT support (with HW FPU support)
- Added ASE256 support (with HW CAU support)
- Flexible DMA trigger support for port pin interrupts, PITs, PWM.
- UART break support added
- DHCP server support
- Visual Studio 2015 Community Edition used as standard
- Blaze full support
- SVN and GIT repositories

In make_uTaskerV1.4_GNU_Kinetis m4 processor should be set up to correctly select FPU or non-FPU part!
All GCC based projects now share the linker scripts in "\Applications\uTaskerV1.4\GNU_Kinetis"

When working with VisualStudio post-build GCC make file, first edit the bat file to set your local GCC tool chain.
SET PATH=%PATH%;D:\Freescale\KDS_v3\Toolchain\bin
in case KDS V3 is installed on drive D: in the directory Freescale.

Release 1.4.11 - 5.2.2016
This is a consolidation of developer's versions (V1.4.8..V1.4.10) with most up-to-date support for registered users (free for non-commercial use) and licensed by professionals who value a fast and efficient development route to reliable, flexible, low-footprint solutions with intense support when and where needed.

- KBOOT serial mode option added to serial loader
- K02F, KE04, KE06, KEA128, KL03, KL43, K22,  K24, KL27, KV10 and KV31 support added
- Added Coffeebrain Capuccino-KL27 support
- Teensy LC support
- Low power support for WAIT, STOP, VLPS added, including unrestricted UART operation up to 57600 Baud in STOP based modes [FRDM-K64F] (higher Bauds possible but single reception byte errors can occur occasionally)
- KL TPM configurations to use OSCERCLK or MCGIRCLK instead of MCGPLLCLK/2 or MCGFLLCLK
- Low power timer Tick option (K and KL devices)
- RTC Tick option (KE devices)
- USB HID keyboard mode
- Multiple USB-CDC interfaces added, also in combination with other composite classes
- Composite USB device configurations added (mixtures of USB-MSD, USB-HID (mouse or keyboard) and (mutiple) USB-CDC)
- Updated extended file system to require the user to avoid using more that 61 blocks in the standard range and changed from "ZXXX" to "zXXX".
- Crystal-less USB option for K22, K24, KL26, K63, K64, K65 and K66 devices (USB_CRYSTAL_LESS) plus RUN_FROM_DEFAULT_CLOCK option to run from default FLL configuration (20..25MHz) without external clocks.
- True 2 stop bit mode added to UARTs which have no 2-stop bit support on their UARTs (interface tx needs to be used in interrupt driven mode and not DMA mode and option TRUE_UART_TX_2_STOPS enabled)
- Optional multiple FTP sessions supported (FTP_CONNECTIONS defines the quantity) 2 allows operation with FTP clients that require more than one for file transfers (such as Internet Explorer).
- K70 RGB support added
- Optional use of "section" programming operation for internal Flash programming
- KE IRQ support
- KE Keyboard interrupt support
- KE02 EEPROM support added
- LLWU low-leakage wakeup from LLS mode added
- Option for locating fixed interrupt vectors in flash
- USB IN/OUT endpoints can share a single Kinetis USB controller endpoint
- utFAT in SPI Flash (AT45DBxxx with 512/528 byte page size) and in internal flash
- Time keeper module added which controls RTC, time-zones, daylight saving, time conversions, display and SNTP operation (based on simple second counter or RTC)
- RTC alarm and wakeup from low leakage modes
- Software RTC (with time maintained across resets) for devices without in-built RTC
- TELNET client
- Updated SNMPv1/V2c for enterprise MIB operation
- Green Hills project added
- Software FIFO (queue) driver added
- Single/Double SC16IS7xx SPI extension for additional 2/4 UARTs added.
- Integrated FreeMaster USB/serial support with additional write support in internal and/or external SPI Flash (provisional implementation)
- Touchscreen mouse interface added with press, release and move events
- Kinetis peripherals removed from kinetis.c to their own individual include files
- IAR projects udated to IAR7
- uVision projects udated to uVision5
- Microchip ENC624J600 driver allowing dual-port Ethernet operation on parts with Ethernet or Ethernet extension for parts without
- Spansion S25FL SPI flash driver added with automatic suspend/resume to interrupt sector erasure
- Modbus ASCII possible on multiple USB-CDC interfaces, together with command line menu and USB-UART bridges on further CDCs.
- Optional out-of-order TCP frame input buffer (USE_OUT_OF_ORDER_TCP_RX_BUFFER)
- Composite USB-MSD and KBOOT serial loader configuration
- USB-MSD loader full MAC OSX and Windows 8.1 compatibility
- Optional AN2295 Freescale Developer's Serial Bootloader compatibility mode added to the serial loader
- Nordic-Semi nRF24201+ 2.4GHz application radio support
- HID raw USB device support added
- Winbond W25Q SPI flash driver added
- USB host MSD boot loader (with optional device mode at the same time)
- utFAT on both SD card and memory stick (multiple disks)
- New board/device support: KW21, KW24
- I2C slave support
- Double-buffered I2C operation (master and slave compatibility with KLx7 for example)
- tinyK20 target
- rcARM target
- USB-MSD Host/Device loader using new USB-OTG driver (allows host [memory stick] and device loader mode at the same time, with automatic detection of the mode to use). See the updated user's guide:
- Emulated FAT - see
- Touch Slider for KL boards
- Display worst-case stack use depth
- USB device driver replaced with USB OTG driver
- Memory Swap support (available in several Kinetis parts) - with UART S-REC and USB-MSD operation: see
- Memory stick (USB-host) support (FAT), also in parallel with SD card operation (SD card is disk D: and Memory stick is disk E:)
- Serial loader supports Intel Hex and/or SREC
- USB-CDC SREC/iHex mode in serial loader
- USB-MSD memory stick loader supports deleting the file after successful loading
- USB-MSD host supports memory sticks that share bulk endpoints to IN and OUT
- Memory stick disk simulation added (equivalent to SD card simulator) - saved as MEMSTICKx.bin (where there are multiple files for multiple LUNs (x); x = 0 if single LUN)
- Faster disk simulation method enabled (thanks to Steve S.)
- USB-CDC host mode for connection to USB-CDC devices for bi-directional communication link (virtual COM between two boards)
- DHCP client supports resolving on multiple networks and interfaces
- FRDM-K82F support
- DAC and PWM sigal generator from buffer using DMA
- Buffer<->peripheral support integrated in DMA driver
- IP fragmentation/de-fragmentation option
- Integrated EzPort cloner
- USB Audio device class
- RNDIS support added (USB-Ethernet adapter which can operate together with the TCP/IP stack without an Ethernet interface)
- FreeLON board support
- Blaze support

When using USB-MSD please add the following lines to the routine fnConfigureApplicationEndpoints() in usb_application.c:
At line number 3817:

    #if defined USE_USB_MSD
        #if defined USB_HS_INTERFACE
    tInterfaceParameters.usEndpointSize = 512;                           // endpoint queue size
    tInterfaceParameters.usEndpointSize = 64;                            // endpoint queue size (2 buffers of this size will be created for reception)

which sets the correct endpoint size - it had got lost in this configuration and so was random.

Release 1.4.7 - 8.7.2014 - download the latest version from the thread
- LPTMR support added
- Optimised DMA based uMemset()/uMemcpy()/uReverseMemcpy() to utilise widest transfer sizes possible (aligned buffer copies can be 7.5x faster than conventional byte based memcpy())
- PWM_LED_CONTROL option added to allow RGB colour control (available on various Freescale boards) based on accelerometer readings
- USB clock configuration based on PLL1 added (mainly for use by 150MHz parts at full speed)
- Add operating details (memory sizes, bus and flash clock speeds and UART settings) to simulator status bar
- Added KE02 serial boot loader (initial KE family support)
- Added KE02 application (UART, I2C FTM with PWMs, SPI with SD-card)

This version has the CodeWarrior set as default (Atollic and KDS settings can be loaded according to details in the readme.txt in the highest directory of the project).
Serial loader and V1.4 application are configured for KE02 as default; set the Kinetis part as required.

Note that the Ethernet interface is disabled by default so be sure to enable it if needed (eg. when following the Ethernet tutorial!):
In config.h:
//#define ETH_INTERFACE                                                // enable Ethernet interface driver

IMPORTANT correction in utFAT [mass_storage.c]:
In the function
static int _utOpenFile(const CHAR *ptrFilePath, UTFILE *ptr_utFile, unsigned long ulAccessMode)
        uMemcpy(&openBlock.DirectoryEndLocation, &ptr_utFile->ptr_utDirObject->public_disk_location, sizeof(openBlock.DirectoryEndLocation)); // {1}
after the line
openBlock.ptr_utDisk = &utDisks[ptr_utFile->ptr_utDirObject->ucDrive];
at line number 4616.

When using the Rowley Crossworks or Keil projects the (new) files stack\igmp.c and Applications\uTaskerV1.4\snmp_mib_handlers.c need to be added to the V1.4 project if either IGMP or SNMP are enabled.

In uMemcpy() in kinetis.c (when based on DMA) move

            while (Size--) {                                             // {87} complete any remaining bytes
                *ptr++ = *buffer++;

from before
            while ((ptrDMA->DMA_DSR_BCR & DMA_DSR_BCR_DONE) == 0) { fnSimulateDMA(DMA_MEMCPY_CHANNEL); } // wait until completed
to after it. This will ensure that buffer shifts base on DMA can't have the last byte(s) corrupted due to writing before the DMA has used the initial values.

For Keil users:
Rename (in kinetis.c)
__attribute__((section("F_INIT"))) const KINETIS_FLASH_CONFIGURATION flash_config
__attribute__((section("F_INIT"))) const KINETIS_FLASH_CONFIGURATION __flash_config
to match the linker script's keep setting.

When using Keil uVision for KE or KL projects the following conditional assembler code is needed in Kinetis_asm.s

    EXPORT start_application
    ldr r1, [r0,#0]                                                      ; get the stack pointer value from the program's reset vector   
    mov sp, r1                                                           ; copy the value to the stack pointer
    ldr r0, [r0,#4]                                                      ; get the program counter value from the program's reset vector
    blx r0                                                                  ; jump to the start address
    ldr r1, [r0,#0]                                                      ; get the stack pointer value from the program's reset vector
    mov sp, r1                                                           ; copy the value to the stack pointer
    ldr r0, [r0,#4]                                                      ; get the program counter value from the program's reset vector
    blx r0                                                                  ; jump to the start address
    ldr sp, [r0,#0]                                                      ; load the stack pointer value from the program's reset vector
    ldr pc, [r0,#4]                                                      ; load the program counter value from the program's reset vector to cause operation to continue from there

When using ETH_INTERFACE: the files stack\igmp.c and snmp.c may need to be added to the TCP/IP group in the uVision project. Also snmp_mib_handlers.c to the Source Files group.

Set the defines KINETIS_KL or KINETIS_KE (when using these devices) in the asm define setup.

Release 1.4.6 - 12.6.2014 -
- Add KL DMA support for memcpy() and memset()
- Add KL DMA support for UART transmission (UARTs 0, 1 and 2)
- Add KL port interrupt support
- KL02, KL04 and KL05 I2C and TPM pin configurations added
- FlexNVM support added as data memory
- K64F DMA and ADC setup added
- Interrupt driven accelerometer setups added
- Memory debug interface improved and extended with storage display and modification capabilities
- CooCox CoIDE projects added
- Crossbar configuration added for optimised DMA priority control
- Encrypted SD card loader support
- KBOOT 1.0.1 HID mode added to serial loader

Note that the Eclipe setup is for KDS so replace the Eclipse setup files (as explained in the V1.4.5 release notes below) when working with CW10.x or Atollic

In case of compiler errors in the routine utReadFile() when building mass_storage.c  place the close bracket at line 3757 of mass_storage.c by the following

Release 1.4.5 - 04.5.2014 -
- Add KL RTC support based on LPO 1kHz or external clock (plus time display in KL46 SLCDs) [see SUPPORT_RTC and SUPPORT_SLCD]
- Add KL PIT support (single-shot and periodic interrupts) [see SUPPORT_PITS and TEST_PIT in ADC_Timers.h]
- Add KL TPM support (PWM, single-shot and period interrupts) [see SUPPORT_TIMER and SUPPORT_PWM_MODULE and TEST_TIMER and TEST_PWM in ADC_Timers.h]
- I2C lockup detection and recovery added to I2C driver (if a reset took place when a slave device was in the process of returning an acknowledgment the I2C bus can get stuck in a bus busy state - this is detected and clocks generated on the SCL line to free the slave and allow normal operation without requiring a power cycle)
- HID loader support for Freescale PC program "HIDBootloader.exe" from the application note AN4764 "Freescale HID Bootloader"
- FRDM-K64F configuration changes to match some K64 peripherals and board requirements

- KDS (Kinetis Design Studio) support added.
IMPORTANT: This release is configured by default for the FRDM-K64F and so can be imported directly into KDS. To work with CodeWarrior copy the Eclipse project files from \Applications\uTaskerV1.4\KinetisCodeWarrior\ProjectSettings to the project root directory after removing the KDS ones from that location; switch between CW10.x, KDS and Atollic using the same method - there is a corresponding set of Eclipse project files in:
- \Applications\uTaskerV1.4\KinetisDesignStudio\Project_Settings
- \Applications\uTaskerV1.4\KinetisCodeWarrior\ProjectSettings
- \Applications\uTaskerV1.4\KinetisAtollic\Project_Settings
It is recommended to keep a backup of these settings when switching between IDEs in case one environment corrupts the setting of others.

Get latest news about KDS and help in case of problems at

When using the USB-MSD loader in FAT12 mode (standard) the following #if def needs to be inverted (changed from #if !defined UTFAT16 to #if defined UTFAT16) so that read-back operates correctly:
- usb_loader.c line 1781 just after the line with if (iSoftwareState == SW_AVAILABLE) {

When using the IAR project the new files stack\igmp.c and Applications\uTaskerV1.4\snmp_mib_handlers.c need to be added to the IAR project.

When using the K61, K70 or K60F120 processors increase the size of RAM reserved for their interrupt vectors in the linker script used (eg. K_1M_128.ld) to 0x1f0
eg. in IAR linker script
define symbol __ICFEDIT_region_RAM_start__ = 0x1fff01b0;
should be change to
define symbol __ICFEDIT_region_RAM_start__ = 0x1fff01f0;

Release 1.4.4 - 16.4.2014 -
- Initial KL support added (FRDM_KL02Z, FRDM_KL05Z, FRDM_KL25Z, FRDM_KL26Z, TWR_KL25Z48M, TWR_KL46Z48M)
- Additional board configurations added (FRDM_K20D50M, TWR_K20D72M, TEENSY_3_1, TWR_K21D50M, TWR_K21F120M, TWR_K40D100M, FRDM-K64F, TWR_K64F120M)
- Flexible serial loader configurations for all board configurations included
- Atollic project included
- CodeWarrior 10.5 project reconfigured for GCC compiler so that KL devices can be used
- USB host mode Beta
- LED simulation configuration has an additional control to define whether the LED is in the '0' or '1' state should the driving pin be configured as an input.
- Port details displayed when mouse hovers over connected inputs/switches on board
- Multi-colour LED colour mixture support in the simulator
- SNMPV1 and SNMPV2c with multiple manager support, MIB table according to rfc 1213 and user entry capability
- IGMP V1/V2 support on multiple networks and interfaces
- 3-axis accelerometers (MMA8451Q and MMA7660F)
- 6-axis sensor (accelerometer/magnetometer FXOS8700CQ)
- Wave file recorder added to DMA controlled ADC streaming
- Multiple network IP/MACs displayed in simulator (test two IP addresses with "#defined IP_NETWORK_COUNT 2")
- Standalone web server software upload support added to serial loader project
- Single shot and periodic interrupts option using FlexTimer

IGMP is enabled as default. The IP counters are extended when enabled and they don't match with the counters on the statistics page of the web server. Either disable IGMP so that they do match or else use the following HTML file in place of 8Stats.htm -

When using the SREC boot loader add the following line to the end of the task intialisation:
This line got lost when Ethernet code was added.

When using the VisualStudio uTaskerV1.4 project the new file igmp.c needs to be added to the project when Ethernet and IGMP are enabled.

When using SDCARD_SUPPORT in the serial loader add the following to SDLoader.c
#undef T_GO_TO_APP
before the line
#define T_GO_TO_APP                1
to remove a warning about the value being redefined.

Release 1.4.3 - 2.01.2014
- Added general purpose routine uReverseMemcpy() [same as memcpy but in reverse order - useful when right-shifting buffers] - also using DMA as option
- Serial Loader supports SREC, USB-MSD and SD-card at the same time
- utFATV2.0 - Beta
- ADC -> DAC buffered mode based on PDB/DMA with digital delay line demonstration

In Kinetis.c fnGetRndHW() when RNGA is used the simulator needs the following lines
    while (!(RNG_SR & RNG_SR_OREG_LVL)) {
        #if defined _WINDOWS
        RNG_SR |= RNG_SR_OREG_LVL;

        #if defined _WINDOWS

This version includes a Beta version of utFAT2.0 and the following change is required to ensure that deleting LFN directories can't cause the corruption of a random sector on the disk:
In static int _utOpenFile(const CHAR *ptrFilePath, UTFILE *ptr_utFile, unsigned long ulAccessMode)
    else if (iReturn == UTFAT_SUCCESS) {                                 // a directory was matched
        uMemcpy(&ptr_utFile->private_disk_location, &ptr_utFile->ptr_utDirObject->public_disk_location, sizeof(ptr_utFile->ptr_utDirObject->public_disk_location)); // copy the referenced directory details
        ptr_utFile->ulFileMode = (UTFAT_FILE_IS_DIR | ulAccessMode);     // {103a} mark that the entry is not a file but a directory
        ptr_utFile->ucDrive = ptr_utFile->ptr_utDirObject->ucDrive;
#if defined UTFAT_LFN_READ && ((defined UTFAT_LFN_DELETE || defined UTFAT_LFN_WRITE) || defined UTFAT_EXPERT_FUNCTIONS)
        uMemcpy(&ptr_utFile->lfn_file_location, &openBlock.lfn_file_location, sizeof(ptr_utFile->lfn_file_location)); // save the start of a LFN entry so that its length and location is known

    return iReturn;

To ensure that new LFN are conform there is an error in fnInsertLFN_name() that needs to be corrected:
            // Fall through intentional
        case -1:
            ptrLongFileEntry = (LFN_ENTRY_STRUCTURE_FAT32 *)ptrDirectorEntry;
            uMemset(ptrLongFileEntry, 0x00, sizeof(LFN_ENTRY_STRUCTURE_FAT32));   // ensure initially zeroed

When using the RTC ensure that the data calculated from the seconds count value is correct by modifying two lines in static void fnConvertSecondsTime(unsigned long ulSecondsTime, int iSet) in kinetis.c:
iLeapYear = LEAP_YEAR(usYear); this line should be changed to
iLeapYear = LEAP_YEAR(_usYear); (note the underscore in the variable name)

_ucDayOfWeek = fnIncDayOfWeek(_ucDayOfWeek, monthDays[ucMonthOfYear]); thsi line should be changed to
_ucDayOfWeek = fnIncDayOfWeek(_ucDayOfWeek, monthDays[_ucMonthOfYear]); (note the underscore in the variable name)

When working with the simulator, the following changes in extern void fnInitInternalRTC(char *argv[]) will ensure that the seconds counter is correctly synchronised to the PC's time
if ((RTC_MONTH > 2) || (RTC_DOM > 28)) { should be change to
if ((RTC_MONTH > 2) && (RTC_DOM > 28)) {[//tt] - note the &&

ulKinetisTime += monthDays[RTC_MONTH ]; should be changed to
ulKinetisTime += monthDays[RTC_MONTH - 1]; - note the -1

If is recommended to make the following two pointers in the routine fnEnterInterrupt() in kinetis.c volatile:

// Function used to enter processor interrupts
extern void fnEnterInterrupt(int iInterruptID, unsigned char ucPriority, void (*InterruptFunc)(void)) // {55}
    volatile unsigned long *ptrIntSet = IRQ0_31_SER_ADD;
    volatile unsigned char *ptrPriority = IRQ0_3_PRIORITY_REGISTER_ADD;

This avoids the possibility of compilers that in-line the function and perform agressive optimisation of register accesses from losing an interrupt mask setting when multiple fnEnterInterrupt() are called in a row.

Release 1.4.2 - 9.09.2013
- Ethernet Boot Loader added to Full Licensed Project.
- TCP/IP stack adapted for multiple interface and multiple network support - see for details about application compatibility.
- FTP client only commands ASCII or Binary modes when it is not known in which mode it is presently in and a change is needed.
- FTP client Listing and Getting requires both the server's success response and the data connection to be closed before terminating and informing of success.
- FTP client now supports operation with servers over IPv6.
- Free running UART DMA reception mode
- Reset TCP connections when SYN (without ACK) received on connected TCP port.
- Devices that support EMAC little-endian mode of operation use this automatically (see ETHER_DBSWP bit).
- Optional polling of SD card to detect removal during operation (by reading a sector), by polling card detect switch, or based on card detect switch interrupt (see
- Program once area supported (SUPPORT_PROGRAM_ONCE) and MAC address can optionally be stored there (MAC_FROM_USER_REG) - when this is enabled the MAC address is only saved to the OTP area when saved using the MAC command via the command line index. This can never be deleted!!
- EmCraft K70F120 and K61F150 configurations added.
- uTaskerCombine has new optional srec output as well as srec/ihex offset parameter
- uTaskerV1.4 project uses a new include file for debug.c called debug_hal.h. This includes some hardware specific functions allowing easier management of processor and hardware target types
- Managed read and managed write support added
- Add PHY SMI mode and KSZ8863 support including tail-tagging mode
- PHY_POLL_LINK support for designs without PHY interrupt line
- DHCP_HOST_NAME option for DHCP
- Respect peer's MSS when sending HTTP frames
- TCP polling timer enabled only when required by a socket
- Optional high resolution TCP polling timer resolution (T_TCP_PERIOD)
- Don't reply to NetBios requests when DHCP is still resolving
- _EXTENDED_HTTP_MIME_CONTENT_SUPPORT activates HTTP content-type to be added to HTTP header
- Magic Ethernet frame reception support added
"The define _MAGIC_RESET_FRAME enables magic frame checking support.
Initially no checking is done until it is enabled by calling fnEnableMagicFrames(1).
It can later be disabled if require by calling fnEnableMagicFrames(0).
When active, each received Ethernet frame is checked directly in the receive interrupt routine for Ethernet payloads of 93 bytes in length.
The definition of _MAGIC_RESET_FRAME determines the magic frame pattern that is expected (repeated 16 bit value) - for example
#define _MAGIC_RESET_FRAME        0x1234
A magic frame must then contain this value repeated 24 times in the first 60 bytes of the payload (following the two Ethernet II MAC addresses) in order to be recognised.
The 61st byte in the frame can then be used as code to trigger an action. The value 0x01 causes the board to reset and place a code in the boot loader mail box so that the boot loader can recognise that the board was reset via use of a magic frame. The boot loader will normally remain in the boot loader mode (possibly for a limited period of time) to allow software updates to be accepted.
The final 32 bytes of the frame are undefined and can have any pattern. The user can use these as optional information bytes if required (for example, there is adequate space to pass 2 IPv6 addresses for special configuration purposes, etc.)
The handling interface has to be supplied by the user (eg. in application.c) as follows:
extern void fnMagicFrame(unsigned char ucType, unsigned char usOptionalDate[32]) {}"
- ELZET80 Network-Utility for discovery and commanded reset to boot loader mode
- Add IP multicast rx and tx
- MEMORY_DEBUGGER adds a memory debugger (memory display, memory modify and memory fill) to the command line interface
- DAC interface added for non-buffered software mode
- SDRAM with secondary uMalloc() area in external memory
- PARAMETER_NO_ALIGNMENT option to improve parameter block efficiency when byte writes are not needed (the application must write aligned blocks)
- High-speed USB device support for Kinetis devices with this controller [#define USB_HS_INTERFACE]
- KBED configurations added (KBED and NETK60)
- ST7565S LCD support added via flex bus or SPI
- HS USB MSD boot loader mode
- TWR-SER2 support (Ethernet/HS USB)

Release 1.4.1 - 27.04.2012

- Long File Name delete added using define UTFAT_LFN_DELETE
- Access to SD card (utFAT) controllable individually for HTTP and FTP; root directories can be changed during operation.
- SD card visualisation in simulator (preliminary)
- Optional polling of SD card to detect removal during operation
- Corrected UDP and IPV6 checksum insertion when offloading enabled
- Added TWR-K70F120M support
- Added TWR-K53N512 support
- Added TWR-K20N50M support
- K20 (32..144 pin parts included in simulator)
- Advanced IPv6 support with link-local and global IPv6 addresses. TCP based services (such as HTTP and FTP) are operational on link-local IPv6 address and global IPv6 address as well as IPv4 (dual-stack).
- Global IPv6 address can be optionally tunnelled in 6in4 (tunnelling IP address is configurable) when native IPv6 is not possible.
- Configurable 6in4 relay agent to expose multiple IPv6 devices behind simple IPv4 routers.
- Start web page shows IPv4 or IPv6 source address depending on connection.
- Flash programming adaptation to respect FPU type Flash with phrase write rather than word write (corresponding adjustment to uParameterSystem interface and 4k Flash sector size)
- UART DMA support on transmission (up to 6 UARTs) and reception (half or full buffer notifications) - simulation of DMA operation integrated
- Configurable DMA channels and priorities
- New I2C simulation devices (PCA9539, PCF2129A)
- PWM support (FTM)
- Ethernet bridging support
- Buzzer output simulation (eg. for use with keypad)
- Frontpanel simulation support with connection of keys and LEDs to ports - including external I2C port expanders
- User button simulatins in frontpanel and configurable frontpanel image
- x,y coordinates shown when mouse is on keypad/front panel
- Touch Sense support including simulation
- Improved CW10.2 projects for simple building with bootloader support
- Task performance monitoring configuration
- ADC support including (preliminary) simulation support
- define HTTP_POST_DEFINES_PAGE allows user file to be served as specified by the file name in a POST, rather than special uFile name
- define HTTP_SET_USERFILE_START_PAGE allow a specific user file to act as HTTP default start side
- define HTTP_SERVE_ONLY_USER_FILES allows serving exclusively user files - if a defined user file is not found display 404 error rather than a uFileSystem equivalent

This version (specifically IPv4/IPv6 dual-stack) can be seen in operation at:

The following modification is required when simulating internal flash on devices without FPU (using long word programming rather than phrase programming).
In kinetis.c, routine fnFlashNow()

    #if defined KINETIS_K_FPU                                            // {10} write second long word
            FTFL_FCCOB8 = (unsigned char)(*ptr_ulWord >> 24);            // enter the second long word to be programmed
            FTFL_FCCOB9 = (unsigned char)(*ptr_ulWord >> 16);
            FTFL_FCCOBA = (unsigned char)(*ptr_ulWord >> 8 );
            FTFL_FCCOBB = (unsigned char)(*ptr_ulWord);
    #ifdef _WINDOWS
            *(unsigned long *)fnGetFlashAdd((unsigned char *)(ptrWord + 1)) = *ptr_ulWord;;

This needs to be modified to only write the simulated flash when the define KINETIS_K_FPU is true:

    #if defined KINETIS_K_FPU                                            // {10} write second long word
            FTFL_FCCOB8 = (unsigned char)(*ptr_ulWord >> 24);            // enter the second long word to be programmed
            FTFL_FCCOB9 = (unsigned char)(*ptr_ulWord >> 16);
            FTFL_FCCOBA = (unsigned char)(*ptr_ulWord >> 8 );
            FTFL_FCCOBB = (unsigned char)(*ptr_ulWord);
        #ifdef _WINDOWS
            *(unsigned long *)fnGetFlashAdd((unsigned char *)(ptrWord + 1)) = *ptr_ulWord;


It has been found that some builds of CW10.2 fail with a linking error missing symbol called __SP_INIT.
To solve, add the symbol to the linker script file being used by the project (eg. \Applications\uTaskerV1.4\KinetisCodeWarrior\Project_Settings\Linker_Files MK60N512VMD100_flash.lcf):

For example, at the end:

} >> sram
__text_load_start__ = ___DATA_ROM;
__text_start__ = __text_load_start__;
__text_end__ = __text_load_start__;
__data_start__ = ___DATA_RAM;
__data_load_start__ = __text_load_start__;
__data_end__ = ___DATA_END;
__bss_start__ = __START_BSS;
__bss_end__= ___BSS_END;
__heap_end__ = __bss_end__;
__SP_INIT   = __bss_end__;                             <---- dummy symbol to satisfy the linker

The value given to the symbol is not important since it is not used.
The potential linker problem is also discussed here:

Release 1.4.0 - 22.02.2012
- Additional queue protection added to allow nested writes and nested reads from same queue in interrupts
- New target for TWR-K60F120M (configuration allows high speed FPU based devices to be used)
- SD card recognition in SDHC mode corrected
- The size of SD card larger than 4G is now displayed in kBytes to stop byte length overflow in 32 bit format
- SD card simulator can be configured to simulate 1G, 2G, 4G, 8G and 16G SD cards, as well as no SD card inserted
- Rowely Crosswork projects reworked to include RAM based debugging as well as Flash based

Note that the project is configured for the KWIKSTIK - change the target in config.h to suit and adjust any settings in the IDE used to match.

If using USB application on the KWIKSTIK the following change should be made in fnConfigureUSB() in usb_application.c to allow it to use the internal clock for the USB controller:
#if defined TWR_K60N512 || defined TWR_K60F120M || defined KWIKSTIK
    tInterfaceParameters.ucClockSource = INTERNAL_USB_CLOCK;             // use system clock and dividers
    tInterfaceParameters.ucClockSource = EXTERNAL_USB_CLOCK;             // use 48MHz crystal directly as USB clock (recommended for lowest jitter)

Please note that the SW packages are protected by the corresponding project password.
To register and receive the password, simple fill out the form:
Don't be afraid - the project is free and supported for everyone; just for commerical use a small fee for premium
support is requested (donation after making their first million profit also welcomed..;-)
« Last Edit: January 25, 2017, 05:32:22 AM by mark »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2747
    • View Profile
    • uTasker
Re: KINETIS Project Code
« Reply #1 on: July 08, 2014, 04:22:15 AM »
Kinetis V1.4.7 Software: please download the attachment for the complete project including BM-loader, serial boot loader and main uTaskerV1.4 application for VisualStudio simulation, KDS (Kinetis Design Studio), Codewarrior CW10.x, IAR, Keil uVision, Rowley Crossworks, Atollic, CooCox CoIDE and standalone GCC. It supports Kinetis K, KL and KE processors and the following boards:

and gives you a wide range of powerful and proven features (OS, TCP/IP and USB stacks, utFAT and more) to get your project started and completed faster, with responsive support whenever needed.

Getting started:
See also the Kinetis landing page for more information:

The download and use of this package is completely free for non-commercial use and also commercial evaluation. Commercial users are welcomed to test what the project offers and make use of project support until it is decided whether it will be used for product development. After this time it would be appreciated if a license is purchased, which extends the support period and entitles royalty free use in sold products - see the licensing terms for full details. The fees are very fair since the package features are the result of several man years of intensive development efforts and refining, and enable professional support to be possible; either to help solve problems or aid in accelerating project progress when required or desired.

Note that by downloading this software you agree to the uTasker licensing terms as detailed at

NOTE that this attachment was deleted on 24.1.2017 and the OpenSource version is now available in the following reply.
« Last Edit: January 25, 2017, 05:04:06 AM by mark »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2747
    • View Profile
    • uTasker
Re: KINETIS Project Code
« Reply #2 on: January 25, 2017, 05:21:18 AM »
Hi All

This is the OpenSource version or the uTasker Kinetis project which is offered to the OpenSource community for use in unsupported hobby, educational, research or commercial projects.

As long as you keep the headers in each file used you may use it for your projects and change any other content as required.
You may distribute the source code as long as you also make clear to the receiver that it is based on the OpenSource uTasker project code base.

As is usual for freely available code it is given with no guarantee whatsoever for suitability, in the simple hope that it will be found useful by the user.

The OpenSource version represents a stable release which was used intensively by registered users for a certain period of time. It is about (or more that) a year behind the 'bleeding edge' state to respect the rights of commercial users - who have funded a number of man years of professional development - to have a significant advantage with regards to performance, features etc. in the current project, as well as with respect to intensive support to ensure highest efficiency in case of difficulties or urgent requirements.

The OpenSource version also doesn't include MODBUS (ASCII/RTU/TCP) master/slave support nor does it include DSP or security technologies.

If you like the project consider showing it to others. The project focuses on enabling faster development than traditional technologies and enabling real accelerated product developments by professional developers and companies, together with simplicity and high reliability. Once you get a taste for what it can do imagine what the latest version can offer and suggest to your company to take a look at licensing it to benefit also from its dedicated support, professional services and further offers:

You are still invited to request registration at the forum if you would like to request general tips or exchange information with other users. If you find a genuine problem it will be taken seriously and resolved....




Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2747
    • View Profile
    • uTasker
Re: KINETIS Project Code
« Reply #3 on: February 06, 2017, 12:24:13 PM »
Hi All

Attached is an OpenSource extension which adds Teensy 3.5 and Teensy 3.6 configurations to the project.

The zip file contains the project directory structure where new files can be found and existing configuration files are update.
It can be un-zipped directly to the root to add/overwrite to configure for the Teensy 3.6, or the files replaced manually if preferred.