KBOOT for K64F while modify clock system

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KBOOT for K64F while modify clock system

Jump to solution
874 Views
kyleyang
Contributor IV

Hi

I found that KBOOT for K64F default clock system is 120MHz PEE mode and clock source input 50MHz.

But for bootloader typically use, default FEI and use internal reference clock source would be better idea.

I need UART and HID bootloader function, so I have to use FEI and use internal 48MHz for USB.

Original example code for K64F bootloader include a "system_MK64F12.c", but it is an old version.

I found a newer version is at "FSL_Kinetis_Bootloader_1_1_0\src\startup\MK64F12" and modify to use "CLOCK_SETUP 0".

UART for bootloader is functional but HID is not work.

Is there any idea regarding how to modify to make HID functional?

Thanks.

0 Kudos
1 Solution
569 Views
mjbcswitzerland
Specialist V

Hi Kyle

If your work is non-commercial the uTasker package is free of charge but still supported.

There is an application note about crystal-less operation which shows how to do it - search in the K64 documentation.

Basically these lines of code are required:

SIM_SOPT2 |= (SIM_SOPT2_USBSRC | SIM_SOPT2_PLLFLLSEL_IRC48M); // set the source to IRC48M

SIM_CLKDIV2 = SIM_CLKDIV2_USBDIV_1;// no divide when IRC48M is used

USB_CLK_RECOVER_IRC_EN = USB_CLK_RECOVER_IRC_EN_IRC_EN;

USB_CLK_RECOVER_CTRL = USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN

Regards

Mark

Kinetis: µTasker Kinetis support

K64: µTasker Kinetis FRDM-K64F support / µTasker Kinetis TWR-K64F120M support

For the complete "out-of-the-box" Kinetis experience and faster time to market

View solution in original post

0 Kudos
4 Replies
569 Views
mjbcswitzerland
Specialist V

Hi

You can use the crystal-less USB device mode in the K64 for USB device.

This is done in the following KBOOT compatible loaders, which additionally allow USB-MSD, Ethernet and SD card loading in parallel.

http://www.utasker.com/kinetis/FRDM-K64F.html

µTasker Kinetis TWR-K64F120M support

Note that the present KBOOT HID mode is very slow (due to errors in the operation of KinetisUdater) - UART loading is several times faster than it but USB-MSD is very fast.

Regards

Mark

Kinetis: µTasker Kinetis support

K64: µTasker Kinetis FRDM-K64F support / µTasker Kinetis TWR-K64F120M support

For the complete "out-of-the-box" Kinetis experience and faster time to market

0 Kudos
569 Views
kyleyang
Contributor IV

Hi Mark

Thanks for your reply.

I am trying to use crystal-less USB device mode, but something missed while modify the code.

I also try the uTasker, but need to pay fee for bootloader full function.

0 Kudos
570 Views
mjbcswitzerland
Specialist V

Hi Kyle

If your work is non-commercial the uTasker package is free of charge but still supported.

There is an application note about crystal-less operation which shows how to do it - search in the K64 documentation.

Basically these lines of code are required:

SIM_SOPT2 |= (SIM_SOPT2_USBSRC | SIM_SOPT2_PLLFLLSEL_IRC48M); // set the source to IRC48M

SIM_CLKDIV2 = SIM_CLKDIV2_USBDIV_1;// no divide when IRC48M is used

USB_CLK_RECOVER_IRC_EN = USB_CLK_RECOVER_IRC_EN_IRC_EN;

USB_CLK_RECOVER_CTRL = USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN

Regards

Mark

Kinetis: µTasker Kinetis support

K64: µTasker Kinetis FRDM-K64F support / µTasker Kinetis TWR-K64F120M support

For the complete "out-of-the-box" Kinetis experience and faster time to market

0 Kudos
569 Views
kyleyang
Contributor IV

Hi Mark

Thanks for your help.

After try&error, finally find the root cause.

0 Kudos