Matteo
The first thing that I see in the SREC is that your code is linked to start at 0x2800, whic is correct. Therefore I set up the uTasker FRDM-KL25Z serial loader for SREC loading at this address. I also removed the define INTERMEDIATE_PROG_BUFFER and set the serial speed to SERIAL_BAUD_19200 [the virtual COM in OpenSDA doesn't respect XON/XOFF operation so I removed this and set a slow speed to ensure that there are no overruns when programming to Flash].
Then I loaded you code:
uTasker Serial Loader
=======================
[0x00002800/0x0000c7ff]
bc = blank check
dc = delete code
ld = start load
go = start application
> bc
Checking Flash... EMPTY!
> ld
Please start S-REC download: ................................................................................................................................................................................................................................................
................................................................................................................................................................................................................................................
................................................................................................................................................................................................................................................
................................................................................................................................................................................................................................................
................................................................................................................................................................................................................................................
................................................................................................................................................................................................................................................
................................................................................................................................................................................................................................................
................................................................................................................................................................................................................................................
..................................................................................................................................................................................................................................................
Terminated - restarting...
Finally I cheked what it was doing, whereby it starts up correctly.
1. However the code fails in the routine Clock_Init()
2. I can also see that the VTOR is set to 0xfffff000 which is incorrect - if an interrupt were to fire it would cause failure.
With these two pieces of information you can probably correct your application.
Note also that there is no restriction to debugging your application together with teh serial loader - just connect the debugger (without loading) and debug code as normal.
Note also that you can also use KBOOT (instead of SREC loading) loading by simple setting the define KBOOT_LOADER. Sine KBOOT has a handshake in its protocol it doesn't have the OpenSDA XON/XOFF restriction.
Regards
Mark
Kinetis: µTasker Kinetis support
KL25: µTasker Kinetis FRDM-KL25Z support / µTasker Kinetis TWR-KL25Z48M support
For the complete "out-of-the-box" Kinetis experience and faster time to market