To enable software tracepoints manually and collect trace data on the Kinetis target using the GCC toolchain:
- Create a stationary Kinetis project with the GCC option selected in the Language and Build Tools Options page..
- Add the sa_handler_gcc.c and sa_asm_handler_gcc.s files to your project as explained in Step 2 of Using Freescale Toolchain.
- Expand Project_Settings > Startup_Code in the CodeWarrior Projects view, and open the kinetis_sysinit.c file in the editor area.
- Edit the kinetis_sysinit.c file. Include this header file in the source code: #include "sa_handler.h". Include the definition of sa interrupt handler: extern void sa_interrupt_handler();. And add this line in the interrupt vector table: sa_interrupt_handler,.
Figure 1. Interrupt Vector Table 
- Save the kinetis_sysinit.c file.
- Edit the linker control file of your project.
- Expand Project_Settings > Linker_Files in the CodeWarrior Projects view.
- Open the <project>_ram.ld file in the editor area.
- Add this statement in the memory section: .swtp (RX) : ORIGIN = 0x20000000+32K, LENGTH = 0x400
Figure 2. Memory Section of Linker File 
Note: Make sure that you do not change the section name because the Software Analysis tool looks for this exact name when software tracepoints are installed.
- Add the .swtp section containing the following statements:
.swtp_handler: {
. = ALIGN (0x4);
PROVIDE ( _swtp_addr = . );
KEEP(*(.swtp_table))
. = . + 0x200; /* reserve space for swtp_table */
PROVIDE ( _swtp_end = . );
. = ALIGN (0x4);
} > .swtp
Figure 3. .swtp Section of Linker File When GCC is Selected 
- Save <project>_ram.ld.
- Save and build the project.
- Follow steps 9 -13 of Using Freescale Toolchain to collect trace.
This is how you set software tracepoints manually on the Kinetis architecture using the GCC toolchain.