Joe
Clock concern:
- I never had problems with the application re-configuring the clock after the boot loader had done it before; I tested on about 60 different KE, KEA, KL, K, KV, KW parts.
However it probably depends on the application initialisation code used since I have heard that MQX users sometimes have problems with the clock configuration hanging. This means that it "shouldn't" be a problem, or is certainly curable.
I know that there can be some watchdog issues when the processor is running quickly at the jump to the application since Arduino Teensy code will fail unless its watchdog code is removed (it takes too many clock cycles to perform the disable).
Flag passing:
- The uTasker project sets the initial stack pointer (in boot loader and application) to be several long words below the end of SRAM, meaning that these locations are never used by general code. They are used as a mail-box for passing information between application and/or boot loader (eg. application can post a command to tell the boot loader to do something after a reset), or to maintain a counter of the number of soft resets since a power up, etc. A flag can be located in such memory to inform the application to skip initialisation if needed, however it is probably also just as easy to check some clock settings to identify whether it has already been done or not. [Exceptions may be when very low power modes are used where parts of SRAM are powered down, and so data is not retained; otherwise SRAM content is retained across soft resets]
RTC registers:
- These should be maintained across warm resets but maybe you haven't set up the RTC enough to allow this to happen (?)
Ethernet:
- I have used the uTasker Ethernet loader and applications using Ethernet for several years, also on K64s, without any problems. This is the sequence (suitable for K64) used before the jump as reference (when USB hasn't been used, otherwise it is also best to shut down the USB regulator etc.):
SYSTICK_CSR = 0;
POWER_DOWN(4, (SIM_SCGC4_UART0 | SIM_SCGC4_UART1 | SIM_SCGC4_UART2 | SIM_SCGC4_UART3));
POWER_DOWN(1, (SIM_SCGC1_UART4 | SIM_SCGC1_UART5));
POWER_DOWN(2, SIM_SCGC2_ENET);
POWER_DOWN(3, (SIM_SCGC3_SDHC));
IRQ0_31_CER = 0xffffffff;
IRQ32_63_CER = 0xffffffff;
IRQ64_95_CER = 0xffffffff;
IRQ0_31_CPR = 0xffffffff;
IRQ32_63_CPR = 0xffffffff;
IRQ64_95_CPR = 0xffffffff;
(it just powers down various peripherals and ensures all interrupts are masked so that there can't be any pending interrupts when the peripherals are re-initialised by the application drivers).
Regards
Mark
Kinetis for professionals: http://www.utasker.com/kinetis.html