Hi
If using the on-board USB host connection I think that these defines will be suitable (PTC9 needs to be set high to supply 5V USB power to the bus in host mode):
#define K64_USB_ENABLE PORTC_BIT9 // active hgh to enable USB host 5V output
#define USB_HOST_POWER_CONFIG() _CONFIG_DRIVE_PORT_OUTPUT_VALUE(C, (K64_USB_ENABLE), (0), (PORT_SRE_SLOW | PORT_DSE_HIGH)) // configure output in off state
#define USB_HOST_POWER_ON() _SETBITS(C, K64_USB_ENABLE) // enable USB host 5V output to USB bus
#define USB_HOST_POWER_OFF() _CLEARBITS(C, K64_USB_ENABLE) // disable USB host 5V output
The retain input is used to keep the processor in the serial loader after it has checked for new firmware on a memory stick. Usually the same input as used to force the serial loader is used, which would be
#define RETAIN_LOADER_MODE() FORCE_BOOT()
or
#define RETAIN_LOADER_MODE() (_READ_PORT_MASK(C, SWITCH_1) == 0)
Regards
Mark
[uTasker project developer for Kinetis and i.MX RT]