Hi Francesco Bianchini
About the bug that you discovered in the UART freertos driver, I already check it and I report it to the developers, Thanks for telling us about it.
About USB example, we found the problem related.
The software stack is written assuming that VBUS is already present and that the USBPHY is powered with the PLL locked and ready to go. We recommend that you have power to the USBPHY anytime the processor is powered. If you are a bus-powered USB device, this is easy because the CPU power would be derived from the host VBUS.
There are two VBUS inputs to the PHY, but there is also an errata where if you use both inputs they need to be the same (see e9359 here: http://cache.nxp.com/files/32bit/doc/errata/KINETIS_K_0N65N.pdf ) So it isn't as easy as powering one VBUS so that the USBPHY has power and then using the second one for the host VBUS, due to this we recommend that you power both VBUS inputs all the time (or at least when the processor is powered up).
If you check the schematic, there is the jumper J23, and here VREG_IN0 and VREG_IN1 are powered by ELEV_USB_VBUS and ONBOARD_VBUS, and when you are running the example in FS mode ONBOARD_VBUS can be power by miniUSB_VBUS or P5V_ELEV (through Jumper J36), but when you are running the example in HS mode, ONBOARD_VBUS is not power until you connect Micro USB (depending on how you have J36).
We realized of this because If we had connected TWR_SER with TWR-K65 the problem did't happen, so we realize that with TWR_SER connected the MCU_VREGIN0 was connected with P5V_ELEV through Jumper 36, so even when we disconnected MICRO USB (J15), MCU_VREGIN0 was always powered up and the example didn't fail.
Hope this information help you.
Regards
Jorge Alcala
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------