USB Stack v5.0- bare metal (no OS) USB Stack- no Timer interrupt

cancel
Showing results for 
Search instead for 
Did you mean: 

USB Stack v5.0- bare metal (no OS) USB Stack- no Timer interrupt

851 Views
Contributor I


I used this stack on the FRDM K64 board using GCC_ARM compiler (Modified the Makefile in the HID keyboard example to use the arm-none-eabi  gcc arm compiler). I want FRDM K64  in the Host mode.

 

When I attach the keyboard , it hangs in the while loop waiting for the timer expiry interrupt to occur.  I do not have any debugger to take a trace, but below is the sequence of operation.

 

_usb_khci_attach()  got called when key board gets attached. This further calls

 

    usb_hal_khci_set_device_addr(g_usb_instance.instance, 0);

    OS_Gpio_set_value(pin, 1);

#ifdef USBCFG_OTG

    OS_Time_delay(50);

#else

    OS_Time_delay(150); --------------------------------------------------------------> It hangs here.

#endif

    OS_Gpio_set_value(pin, 0);

 

 

I was able to reach to the conclusion after some debugging by adding additional  prints as below:

 

The timer expiry interrupt function delay_isr() never gets called even though it was installed by calling delay_init() in beginning of main(). Why the timer expiry interrupt function delay_isr() is not getting called inspite of initialising the same ?

 

 

Regards

Yogesh

Labels (1)
0 Kudos
9 Replies

95 Views
NXP Employee
NXP Employee

Hi Yohesh,

The ELF file format has lots of symbolic information to it that allows the debugger to know where your code is located, where the variables are, etc...which enables source code debugging via IDE.

The binary, s-record and hex files that you can generate from the ELF file strip away the symbolic information and give a more accurate representation of the actual image size.  The binary to most accurate.

GNU generated ELF files are huge to say the least.

Regards,

David

95 Views
Contributor I

Ok thanks David for the info.

--yogesh

0 Kudos

95 Views
Contributor I

Even the release version build has 57.9 MB (60,714,337 bytes).

Please find the build console for the demo app:

make -k all

'Building file: C:/Freescale/KSDK_1.3.0/platform/utilities/src/fsl_debug_console.c'

'Invoking: Cross ARM C Compiler'

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -D_DEBUG=0 -D_AEABI_LC_CTYPE=C -D__STRICT_ANSI__=1 -DCPU_MK64FN1M0VMD12 -DFSL_RTOS_MQX -DFRDM_K64F -DFREEDOM -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/config -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/mqx -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/mqx_stdlib -I../../../../../../../../../../platform/osa/inc -I../../../../../../../../../../rtos -I../../../../../../../../../../platform/utilities/inc -I../../../../../../../../../../platform/CMSIS/Include -I../../../../../../../../../../platform/devices -I../../../../../../../../../../platform/devices/MK64F12/include -I../../../../../../../../../../platform/devices/MK64F12/startup -I../../../../../../../.. -I../../../../../../../../../../usb/adapter/sources -I../../../../../../../../../../usb/adapter/sources/sdk -I../../../../../../../../../../usb/usb_core/device/include/MK64F12 -I../../../../../../../../../../usb/usb_core/device/include -I../../../../../../../../../../usb/usb_core/device/sources/classes/audio -I../../../../../../../../../../usb/usb_core/device/sources/classes/cdc -I../../../../../../../../../../usb/usb_core/device/sources/classes/common -I../../../../../../../../../../usb/usb_core/device/sources/classes/composite -I../../../../../../../../../../usb/usb_core/device/sources/classes/hid -I../../../../../../../../../../usb/usb_core/device/sources/classes/include -I../../../../../../../../../../usb/usb_core/device/sources/classes/include/config -I../../../../../../../../../../usb/usb_core/device/sources/classes/msd -I../../../../../../../../../../usb/usb_core/device/sources/classes/phdc -I../../../../../../../../../../usb/usb_core/device/sources/classes/video -I../../../../../../../../../../usb/usb_core/device/sources/controller/khci -I../../../../../../../../../../usb/usb_core/device/sources/controller -I../../../../../../../../../../usb/usb_core/hal -I../../../../../../../../../../usb/usb_core/host/include/MK64F12 -I../../../../../../../../../../usb/usb_core/host/include -I../../../../../../../../../../usb/usb_core/host/sources/classes/audio -I../../../../../../../../../../usb/usb_core/host/sources/classes/cdc -I../../../../../../../../../../usb/usb_core/host/sources/classes/hid -I../../../../../../../../../../usb/usb_core/host/sources/classes/hub -I../../../../../../../../../../usb/usb_core/host/sources/classes/msd -I../../../../../../../../../../usb/usb_core/host/sources/classes/phdc -I../../../../../../../../../../usb/usb_core/host/sources/classes/printer -I../../../../../../../../../../usb/usb_core/host/sources/controller/khci -I../../../../../../../../../../usb/usb_core/host/sources/controller -I../../../../../../../../../../usb/usb_core/include -I../../../../../../../../../../usb/usb_core/otg/sources/driver/khci -I../../../../../../../../../../usb/usb_core/otg/sources/driver/max3353/sdk -I../../../../../../../../../../usb/usb_core/otg/include -I../../../../../../../../../../usb/usb_core/otg/sources/otg -I../../../../../../../../../../platform/hal/inc -I../../../../../../../../../../platform/drivers/src/uart -I../../../../../../../../../../platform/drivers/src/gpio -I../../../../../../../../../../platform/drivers/src/pit -I../../../../../../../../../../platform/drivers/src/edma -I../../../../../../../../../../platform/drivers/inc -I../../../../../../../../../../platform/system/inc -I../../.. -I../../../../../../../../../../platform/drivers/src/i2c -I../../../../../../../../../../rtos/mqx/config/mcu/MK64F12 -I../../../../../../../../../../rtos/mqx/config/board/frdmk64f -I../../.. -I../../../../../../../../../../platform/devices/MK64F12/include -I../../../../../../../../../../platform/devices/MK64F12/startup -I../../../../../../../../../../platform/system/inc -I../../../../../../../../../../platform/hal/inc -I../../../../../../../../../../platform/drivers/inc -I../../../../../../../../../../platform/drivers/src/mpu -I../../../../../../../../../../platform/startup -I../../../../../../../../../../rtos/mqx/config/common -I../../../../../../../../../../rtos/mqx/mqx/source/bsp -I../../../../../../../../../../rtos/mqx/mqx/source/include -std=gnu99 -fno-strict-aliasing -Wno-format  -fno-common  -ffreestanding  -fno-builtin  -mapcs -MMD -MP -MF"utilities/fsl_debug_console.d" -MT"utilities/fsl_debug_console.o" -c -o "utilities/fsl_debug_console.o" "C:/Freescale/KSDK_1.3.0/platform/utilities/src/fsl_debug_console.c"

'Finished building: C:/Freescale/KSDK_1.3.0/platform/utilities/src/fsl_debug_console.c'

' '

'Building file: C:/Freescale/KSDK_1.3.0/platform/utilities/src/fsl_misc_utilities.c'

'Invoking: Cross ARM C Compiler'

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -D_DEBUG=0 -D_AEABI_LC_CTYPE=C -D__STRICT_ANSI__=1 -DCPU_MK64FN1M0VMD12 -DFSL_RTOS_MQX -DFRDM_K64F -DFREEDOM -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/config -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/mqx -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/mqx_stdlib -I../../../../../../../../../../platform/osa/inc -I../../../../../../../../../../rtos -I../../../../../../../../../../platform/utilities/inc -I../../../../../../../../../../platform/CMSIS/Include -I../../../../../../../../../../platform/devices -I../../../../../../../../../../platform/devices/MK64F12/include -I../../../../../../../../../../platform/devices/MK64F12/startup -I../../../../../../../.. -I../../../../../../../../../../usb/adapter/sources -I../../../../../../../../../../usb/adapter/sources/sdk -I../../../../../../../../../../usb/usb_core/device/include/MK64F12 -I../../../../../../../../../../usb/usb_core/device/include -I../../../../../../../../../../usb/usb_core/device/sources/classes/audio -I../../../../../../../../../../usb/usb_core/device/sources/classes/cdc -I../../../../../../../../../../usb/usb_core/device/sources/classes/common -I../../../../../../../../../../usb/usb_core/device/sources/classes/composite -I../../../../../../../../../../usb/usb_core/device/sources/classes/hid -I../../../../../../../../../../usb/usb_core/device/sources/classes/include -I../../../../../../../../../../usb/usb_core/device/sources/classes/include/config -I../../../../../../../../../../usb/usb_core/device/sources/classes/msd -I../../../../../../../../../../usb/usb_core/device/sources/classes/phdc -I../../../../../../../../../../usb/usb_core/device/sources/classes/video -I../../../../../../../../../../usb/usb_core/device/sources/controller/khci -I../../../../../../../../../../usb/usb_core/device/sources/controller -I../../../../../../../../../../usb/usb_core/hal -I../../../../../../../../../../usb/usb_core/host/include/MK64F12 -I../../../../../../../../../../usb/usb_core/host/include -I../../../../../../../../../../usb/usb_core/host/sources/classes/audio -I../../../../../../../../../../usb/usb_core/host/sources/classes/cdc -I../../../../../../../../../../usb/usb_core/host/sources/classes/hid -I../../../../../../../../../../usb/usb_core/host/sources/classes/hub -I../../../../../../../../../../usb/usb_core/host/sources/classes/msd -I../../../../../../../../../../usb/usb_core/host/sources/classes/phdc -I../../../../../../../../../../usb/usb_core/host/sources/classes/printer -I../../../../../../../../../../usb/usb_core/host/sources/controller/khci -I../../../../../../../../../../usb/usb_core/host/sources/controller -I../../../../../../../../../../usb/usb_core/include -I../../../../../../../../../../usb/usb_core/otg/sources/driver/khci -I../../../../../../../../../../usb/usb_core/otg/sources/driver/max3353/sdk -I../../../../../../../../../../usb/usb_core/otg/include -I../../../../../../../../../../usb/usb_core/otg/sources/otg -I../../../../../../../../../../platform/hal/inc -I../../../../../../../../../../platform/drivers/src/uart -I../../../../../../../../../../platform/drivers/src/gpio -I../../../../../../../../../../platform/drivers/src/pit -I../../../../../../../../../../platform/drivers/src/edma -I../../../../../../../../../../platform/drivers/inc -I../../../../../../../../../../platform/system/inc -I../../.. -I../../../../../../../../../../platform/drivers/src/i2c -I../../../../../../../../../../rtos/mqx/config/mcu/MK64F12 -I../../../../../../../../../../rtos/mqx/config/board/frdmk64f -I../../.. -I../../../../../../../../../../platform/devices/MK64F12/include -I../../../../../../../../../../platform/devices/MK64F12/startup -I../../../../../../../../../../platform/system/inc -I../../../../../../../../../../platform/hal/inc -I../../../../../../../../../../platform/drivers/inc -I../../../../../../../../../../platform/drivers/src/mpu -I../../../../../../../../../../platform/startup -I../../../../../../../../../../rtos/mqx/config/common -I../../../../../../../../../../rtos/mqx/mqx/source/bsp -I../../../../../../../../../../rtos/mqx/mqx/source/include -std=gnu99 -fno-strict-aliasing -Wno-format  -fno-common  -ffreestanding  -fno-builtin  -mapcs -MMD -MP -MF"utilities/fsl_misc_utilities.d" -MT"utilities/fsl_misc_utilities.o" -c -o "utilities/fsl_misc_utilities.o" "C:/Freescale/KSDK_1.3.0/platform/utilities/src/fsl_misc_utilities.c"

'Finished building: C:/Freescale/KSDK_1.3.0/platform/utilities/src/fsl_misc_utilities.c'

' '

'Building file: C:/Freescale/KSDK_1.3.0/examples/frdmk64f/demo_apps/usb/host/hid/keyboard/hidkeyboard.c'

'Invoking: Cross ARM C Compiler'

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -D_DEBUG=0 -D_AEABI_LC_CTYPE=C -D__STRICT_ANSI__=1 -DCPU_MK64FN1M0VMD12 -DFSL_RTOS_MQX -DFRDM_K64F -DFREEDOM -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/config -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/mqx -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/mqx_stdlib -I../../../../../../../../../../platform/osa/inc -I../../../../../../../../../../rtos -I../../../../../../../../../../platform/utilities/inc -I../../../../../../../../../../platform/CMSIS/Include -I../../../../../../../../../../platform/devices -I../../../../../../../../../../platform/devices/MK64F12/include -I../../../../../../../../../../platform/devices/MK64F12/startup -I../../../../../../../.. -I../../../../../../../../../../usb/adapter/sources -I../../../../../../../../../../usb/adapter/sources/sdk -I../../../../../../../../../../usb/usb_core/device/include/MK64F12 -I../../../../../../../../../../usb/usb_core/device/include -I../../../../../../../../../../usb/usb_core/device/sources/classes/audio -I../../../../../../../../../../usb/usb_core/device/sources/classes/cdc -I../../../../../../../../../../usb/usb_core/device/sources/classes/common -I../../../../../../../../../../usb/usb_core/device/sources/classes/composite -I../../../../../../../../../../usb/usb_core/device/sources/classes/hid -I../../../../../../../../../../usb/usb_core/device/sources/classes/include -I../../../../../../../../../../usb/usb_core/device/sources/classes/include/config -I../../../../../../../../../../usb/usb_core/device/sources/classes/msd -I../../../../../../../../../../usb/usb_core/device/sources/classes/phdc -I../../../../../../../../../../usb/usb_core/device/sources/classes/video -I../../../../../../../../../../usb/usb_core/device/sources/controller/khci -I../../../../../../../../../../usb/usb_core/device/sources/controller -I../../../../../../../../../../usb/usb_core/hal -I../../../../../../../../../../usb/usb_core/host/include/MK64F12 -I../../../../../../../../../../usb/usb_core/host/include -I../../../../../../../../../../usb/usb_core/host/sources/classes/audio -I../../../../../../../../../../usb/usb_core/host/sources/classes/cdc -I../../../../../../../../../../usb/usb_core/host/sources/classes/hid -I../../../../../../../../../../usb/usb_core/host/sources/classes/hub -I../../../../../../../../../../usb/usb_core/host/sources/classes/msd -I../../../../../../../../../../usb/usb_core/host/sources/classes/phdc -I../../../../../../../../../../usb/usb_core/host/sources/classes/printer -I../../../../../../../../../../usb/usb_core/host/sources/controller/khci -I../../../../../../../../../../usb/usb_core/host/sources/controller -I../../../../../../../../../../usb/usb_core/include -I../../../../../../../../../../usb/usb_core/otg/sources/driver/khci -I../../../../../../../../../../usb/usb_core/otg/sources/driver/max3353/sdk -I../../../../../../../../../../usb/usb_core/otg/include -I../../../../../../../../../../usb/usb_core/otg/sources/otg -I../../../../../../../../../../platform/hal/inc -I../../../../../../../../../../platform/drivers/src/uart -I../../../../../../../../../../platform/drivers/src/gpio -I../../../../../../../../../../platform/drivers/src/pit -I../../../../../../../../../../platform/drivers/src/edma -I../../../../../../../../../../platform/drivers/inc -I../../../../../../../../../../platform/system/inc -I../../.. -I../../../../../../../../../../platform/drivers/src/i2c -I../../../../../../../../../../rtos/mqx/config/mcu/MK64F12 -I../../../../../../../../../../rtos/mqx/config/board/frdmk64f -I../../.. -I../../../../../../../../../../platform/devices/MK64F12/include -I../../../../../../../../../../platform/devices/MK64F12/startup -I../../../../../../../../../../platform/system/inc -I../../../../../../../../../../platform/hal/inc -I../../../../../../../../../../platform/drivers/inc -I../../../../../../../../../../platform/drivers/src/mpu -I../../../../../../../../../../platform/startup -I../../../../../../../../../../rtos/mqx/config/common -I../../../../../../../../../../rtos/mqx/mqx/source/bsp -I../../../../../../../../../../rtos/mqx/mqx/source/include -std=gnu99 -fno-strict-aliasing -Wno-format  -fno-common  -ffreestanding  -fno-builtin  -mapcs -MMD -MP -MF"sources/hidkeyboard.d" -MT"sources/hidkeyboard.o" -c -o "sources/hidkeyboard.o" "C:/Freescale/KSDK_1.3.0/examples/frdmk64f/demo_apps/usb/host/hid/keyboard/hidkeyboard.c"

'Finished building: C:/Freescale/KSDK_1.3.0/examples/frdmk64f/demo_apps/usb/host/hid/keyboard/hidkeyboard.c'

' '

'Building file: C:/Freescale/KSDK_1.3.0/examples/frdmk64f/board.c'

'Invoking: Cross ARM C Compiler'

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -D_DEBUG=0 -D_AEABI_LC_CTYPE=C -D__STRICT_ANSI__=1 -DCPU_MK64FN1M0VMD12 -DFSL_RTOS_MQX -DFRDM_K64F -DFREEDOM -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/config -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/mqx -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/mqx_stdlib -I../../../../../../../../../../platform/osa/inc -I../../../../../../../../../../rtos -I../../../../../../../../../../platform/utilities/inc -I../../../../../../../../../../platform/CMSIS/Include -I../../../../../../../../../../platform/devices -I../../../../../../../../../../platform/devices/MK64F12/include -I../../../../../../../../../../platform/devices/MK64F12/startup -I../../../../../../../.. -I../../../../../../../../../../usb/adapter/sources -I../../../../../../../../../../usb/adapter/sources/sdk -I../../../../../../../../../../usb/usb_core/device/include/MK64F12 -I../../../../../../../../../../usb/usb_core/device/include -I../../../../../../../../../../usb/usb_core/device/sources/classes/audio -I../../../../../../../../../../usb/usb_core/device/sources/classes/cdc -I../../../../../../../../../../usb/usb_core/device/sources/classes/common -I../../../../../../../../../../usb/usb_core/device/sources/classes/composite -I../../../../../../../../../../usb/usb_core/device/sources/classes/hid -I../../../../../../../../../../usb/usb_core/device/sources/classes/include -I../../../../../../../../../../usb/usb_core/device/sources/classes/include/config -I../../../../../../../../../../usb/usb_core/device/sources/classes/msd -I../../../../../../../../../../usb/usb_core/device/sources/classes/phdc -I../../../../../../../../../../usb/usb_core/device/sources/classes/video -I../../../../../../../../../../usb/usb_core/device/sources/controller/khci -I../../../../../../../../../../usb/usb_core/device/sources/controller -I../../../../../../../../../../usb/usb_core/hal -I../../../../../../../../../../usb/usb_core/host/include/MK64F12 -I../../../../../../../../../../usb/usb_core/host/include -I../../../../../../../../../../usb/usb_core/host/sources/classes/audio -I../../../../../../../../../../usb/usb_core/host/sources/classes/cdc -I../../../../../../../../../../usb/usb_core/host/sources/classes/hid -I../../../../../../../../../../usb/usb_core/host/sources/classes/hub -I../../../../../../../../../../usb/usb_core/host/sources/classes/msd -I../../../../../../../../../../usb/usb_core/host/sources/classes/phdc -I../../../../../../../../../../usb/usb_core/host/sources/classes/printer -I../../../../../../../../../../usb/usb_core/host/sources/controller/khci -I../../../../../../../../../../usb/usb_core/host/sources/controller -I../../../../../../../../../../usb/usb_core/include -I../../../../../../../../../../usb/usb_core/otg/sources/driver/khci -I../../../../../../../../../../usb/usb_core/otg/sources/driver/max3353/sdk -I../../../../../../../../../../usb/usb_core/otg/include -I../../../../../../../../../../usb/usb_core/otg/sources/otg -I../../../../../../../../../../platform/hal/inc -I../../../../../../../../../../platform/drivers/src/uart -I../../../../../../../../../../platform/drivers/src/gpio -I../../../../../../../../../../platform/drivers/src/pit -I../../../../../../../../../../platform/drivers/src/edma -I../../../../../../../../../../platform/drivers/inc -I../../../../../../../../../../platform/system/inc -I../../.. -I../../../../../../../../../../platform/drivers/src/i2c -I../../../../../../../../../../rtos/mqx/config/mcu/MK64F12 -I../../../../../../../../../../rtos/mqx/config/board/frdmk64f -I../../.. -I../../../../../../../../../../platform/devices/MK64F12/include -I../../../../../../../../../../platform/devices/MK64F12/startup -I../../../../../../../../../../platform/system/inc -I../../../../../../../../../../platform/hal/inc -I../../../../../../../../../../platform/drivers/inc -I../../../../../../../../../../platform/drivers/src/mpu -I../../../../../../../../../../platform/startup -I../../../../../../../../../../rtos/mqx/config/common -I../../../../../../../../../../rtos/mqx/mqx/source/bsp -I../../../../../../../../../../rtos/mqx/mqx/source/include -std=gnu99 -fno-strict-aliasing -Wno-format  -fno-common  -ffreestanding  -fno-builtin  -mapcs -MMD -MP -MF"board/board.d" -MT"board/board.o" -c -o "board/board.o" "C:/Freescale/KSDK_1.3.0/examples/frdmk64f/board.c"

'Finished building: C:/Freescale/KSDK_1.3.0/examples/frdmk64f/board.c'

' '

'Building file: C:/Freescale/KSDK_1.3.0/examples/frdmk64f/demo_apps/usb/host/hid/keyboard/hardware_init.c'

'Invoking: Cross ARM C Compiler'

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -D_DEBUG=0 -D_AEABI_LC_CTYPE=C -D__STRICT_ANSI__=1 -DCPU_MK64FN1M0VMD12 -DFSL_RTOS_MQX -DFRDM_K64F -DFREEDOM -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/config -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/mqx -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/mqx_stdlib -I../../../../../../../../../../platform/osa/inc -I../../../../../../../../../../rtos -I../../../../../../../../../../platform/utilities/inc -I../../../../../../../../../../platform/CMSIS/Include -I../../../../../../../../../../platform/devices -I../../../../../../../../../../platform/devices/MK64F12/include -I../../../../../../../../../../platform/devices/MK64F12/startup -I../../../../../../../.. -I../../../../../../../../../../usb/adapter/sources -I../../../../../../../../../../usb/adapter/sources/sdk -I../../../../../../../../../../usb/usb_core/device/include/MK64F12 -I../../../../../../../../../../usb/usb_core/device/include -I../../../../../../../../../../usb/usb_core/device/sources/classes/audio -I../../../../../../../../../../usb/usb_core/device/sources/classes/cdc -I../../../../../../../../../../usb/usb_core/device/sources/classes/common -I../../../../../../../../../../usb/usb_core/device/sources/classes/composite -I../../../../../../../../../../usb/usb_core/device/sources/classes/hid -I../../../../../../../../../../usb/usb_core/device/sources/classes/include -I../../../../../../../../../../usb/usb_core/device/sources/classes/include/config -I../../../../../../../../../../usb/usb_core/device/sources/classes/msd -I../../../../../../../../../../usb/usb_core/device/sources/classes/phdc -I../../../../../../../../../../usb/usb_core/device/sources/classes/video -I../../../../../../../../../../usb/usb_core/device/sources/controller/khci -I../../../../../../../../../../usb/usb_core/device/sources/controller -I../../../../../../../../../../usb/usb_core/hal -I../../../../../../../../../../usb/usb_core/host/include/MK64F12 -I../../../../../../../../../../usb/usb_core/host/include -I../../../../../../../../../../usb/usb_core/host/sources/classes/audio -I../../../../../../../../../../usb/usb_core/host/sources/classes/cdc -I../../../../../../../../../../usb/usb_core/host/sources/classes/hid -I../../../../../../../../../../usb/usb_core/host/sources/classes/hub -I../../../../../../../../../../usb/usb_core/host/sources/classes/msd -I../../../../../../../../../../usb/usb_core/host/sources/classes/phdc -I../../../../../../../../../../usb/usb_core/host/sources/classes/printer -I../../../../../../../../../../usb/usb_core/host/sources/controller/khci -I../../../../../../../../../../usb/usb_core/host/sources/controller -I../../../../../../../../../../usb/usb_core/include -I../../../../../../../../../../usb/usb_core/otg/sources/driver/khci -I../../../../../../../../../../usb/usb_core/otg/sources/driver/max3353/sdk -I../../../../../../../../../../usb/usb_core/otg/include -I../../../../../../../../../../usb/usb_core/otg/sources/otg -I../../../../../../../../../../platform/hal/inc -I../../../../../../../../../../platform/drivers/src/uart -I../../../../../../../../../../platform/drivers/src/gpio -I../../../../../../../../../../platform/drivers/src/pit -I../../../../../../../../../../platform/drivers/src/edma -I../../../../../../../../../../platform/drivers/inc -I../../../../../../../../../../platform/system/inc -I../../.. -I../../../../../../../../../../platform/drivers/src/i2c -I../../../../../../../../../../rtos/mqx/config/mcu/MK64F12 -I../../../../../../../../../../rtos/mqx/config/board/frdmk64f -I../../.. -I../../../../../../../../../../platform/devices/MK64F12/include -I../../../../../../../../../../platform/devices/MK64F12/startup -I../../../../../../../../../../platform/system/inc -I../../../../../../../../../../platform/hal/inc -I../../../../../../../../../../platform/drivers/inc -I../../../../../../../../../../platform/drivers/src/mpu -I../../../../../../../../../../platform/startup -I../../../../../../../../../../rtos/mqx/config/common -I../../../../../../../../../../rtos/mqx/mqx/source/bsp -I../../../../../../../../../../rtos/mqx/mqx/source/include -std=gnu99 -fno-strict-aliasing -Wno-format  -fno-common  -ffreestanding  -fno-builtin  -mapcs -MMD -MP -MF"board/hardware_init.d" -MT"board/hardware_init.o" -c -o "board/hardware_init.o" "C:/Freescale/KSDK_1.3.0/examples/frdmk64f/demo_apps/usb/host/hid/keyboard/hardware_init.c"

'Finished building: C:/Freescale/KSDK_1.3.0/examples/frdmk64f/demo_apps/usb/host/hid/keyboard/hardware_init.c'

' '

'Building file: C:/Freescale/KSDK_1.3.0/rtos/mqx/mqx/source/bsp/init_bsp.c'

'Invoking: Cross ARM C Compiler'

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -D_DEBUG=0 -D_AEABI_LC_CTYPE=C -D__STRICT_ANSI__=1 -DCPU_MK64FN1M0VMD12 -DFSL_RTOS_MQX -DFRDM_K64F -DFREEDOM -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/config -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/mqx -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/mqx_stdlib -I../../../../../../../../../../platform/osa/inc -I../../../../../../../../../../rtos -I../../../../../../../../../../platform/utilities/inc -I../../../../../../../../../../platform/CMSIS/Include -I../../../../../../../../../../platform/devices -I../../../../../../../../../../platform/devices/MK64F12/include -I../../../../../../../../../../platform/devices/MK64F12/startup -I../../../../../../../.. -I../../../../../../../../../../usb/adapter/sources -I../../../../../../../../../../usb/adapter/sources/sdk -I../../../../../../../../../../usb/usb_core/device/include/MK64F12 -I../../../../../../../../../../usb/usb_core/device/include -I../../../../../../../../../../usb/usb_core/device/sources/classes/audio -I../../../../../../../../../../usb/usb_core/device/sources/classes/cdc -I../../../../../../../../../../usb/usb_core/device/sources/classes/common -I../../../../../../../../../../usb/usb_core/device/sources/classes/composite -I../../../../../../../../../../usb/usb_core/device/sources/classes/hid -I../../../../../../../../../../usb/usb_core/device/sources/classes/include -I../../../../../../../../../../usb/usb_core/device/sources/classes/include/config -I../../../../../../../../../../usb/usb_core/device/sources/classes/msd -I../../../../../../../../../../usb/usb_core/device/sources/classes/phdc -I../../../../../../../../../../usb/usb_core/device/sources/classes/video -I../../../../../../../../../../usb/usb_core/device/sources/controller/khci -I../../../../../../../../../../usb/usb_core/device/sources/controller -I../../../../../../../../../../usb/usb_core/hal -I../../../../../../../../../../usb/usb_core/host/include/MK64F12 -I../../../../../../../../../../usb/usb_core/host/include -I../../../../../../../../../../usb/usb_core/host/sources/classes/audio -I../../../../../../../../../../usb/usb_core/host/sources/classes/cdc -I../../../../../../../../../../usb/usb_core/host/sources/classes/hid -I../../../../../../../../../../usb/usb_core/host/sources/classes/hub -I../../../../../../../../../../usb/usb_core/host/sources/classes/msd -I../../../../../../../../../../usb/usb_core/host/sources/classes/phdc -I../../../../../../../../../../usb/usb_core/host/sources/classes/printer -I../../../../../../../../../../usb/usb_core/host/sources/controller/khci -I../../../../../../../../../../usb/usb_core/host/sources/controller -I../../../../../../../../../../usb/usb_core/include -I../../../../../../../../../../usb/usb_core/otg/sources/driver/khci -I../../../../../../../../../../usb/usb_core/otg/sources/driver/max3353/sdk -I../../../../../../../../../../usb/usb_core/otg/include -I../../../../../../../../../../usb/usb_core/otg/sources/otg -I../../../../../../../../../../platform/hal/inc -I../../../../../../../../../../platform/drivers/src/uart -I../../../../../../../../../../platform/drivers/src/gpio -I../../../../../../../../../../platform/drivers/src/pit -I../../../../../../../../../../platform/drivers/src/edma -I../../../../../../../../../../platform/drivers/inc -I../../../../../../../../../../platform/system/inc -I../../.. -I../../../../../../../../../../platform/drivers/src/i2c -I../../../../../../../../../../rtos/mqx/config/mcu/MK64F12 -I../../../../../../../../../../rtos/mqx/config/board/frdmk64f -I../../.. -I../../../../../../../../../../platform/devices/MK64F12/include -I../../../../../../../../../../platform/devices/MK64F12/startup -I../../../../../../../../../../platform/system/inc -I../../../../../../../../../../platform/hal/inc -I../../../../../../../../../../platform/drivers/inc -I../../../../../../../../../../platform/drivers/src/mpu -I../../../../../../../../../../platform/startup -I../../../../../../../../../../rtos/mqx/config/common -I../../../../../../../../../../rtos/mqx/mqx/source/bsp -I../../../../../../../../../../rtos/mqx/mqx/source/include -std=gnu99 -fno-strict-aliasing -Wno-format  -fno-common  -ffreestanding  -fno-builtin  -mapcs -MMD -MP -MF"BSP_Files/init_bsp.d" -MT"BSP_Files/init_bsp.o" -c -o "BSP_Files/init_bsp.o" "C:/Freescale/KSDK_1.3.0/rtos/mqx/mqx/source/bsp/init_bsp.c"

'Finished building: C:/Freescale/KSDK_1.3.0/rtos/mqx/mqx/source/bsp/init_bsp.c'

' '

'Building file: C:/Freescale/KSDK_1.3.0/rtos/mqx/mqx/source/bsp/mqx_main.c'

'Invoking: Cross ARM C Compiler'

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -D_DEBUG=0 -D_AEABI_LC_CTYPE=C -D__STRICT_ANSI__=1 -DCPU_MK64FN1M0VMD12 -DFSL_RTOS_MQX -DFRDM_K64F -DFREEDOM -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/config -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/mqx -I../../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/mqx_stdlib -I../../../../../../../../../../platform/osa/inc -I../../../../../../../../../../rtos -I../../../../../../../../../../platform/utilities/inc -I../../../../../../../../../../platform/CMSIS/Include -I../../../../../../../../../../platform/devices -I../../../../../../../../../../platform/devices/MK64F12/include -I../../../../../../../../../../platform/devices/MK64F12/startup -I../../../../../../../.. -I../../../../../../../../../../usb/adapter/sources -I../../../../../../../../../../usb/adapter/sources/sdk -I../../../../../../../../../../usb/usb_core/device/include/MK64F12 -I../../../../../../../../../../usb/usb_core/device/include -I../../../../../../../../../../usb/usb_core/device/sources/classes/audio -I../../../../../../../../../../usb/usb_core/device/sources/classes/cdc -I../../../../../../../../../../usb/usb_core/device/sources/classes/common -I../../../../../../../../../../usb/usb_core/device/sources/classes/composite -I../../../../../../../../../../usb/usb_core/device/sources/classes/hid -I../../../../../../../../../../usb/usb_core/device/sources/classes/include -I../../../../../../../../../../usb/usb_core/device/sources/classes/include/config -I../../../../../../../../../../usb/usb_core/device/sources/classes/msd -I../../../../../../../../../../usb/usb_core/device/sources/classes/phdc -I../../../../../../../../../../usb/usb_core/device/sources/classes/video -I../../../../../../../../../../usb/usb_core/device/sources/controller/khci -I../../../../../../../../../../usb/usb_core/device/sources/controller -I../../../../../../../../../../usb/usb_core/hal -I../../../../../../../../../../usb/usb_core/host/include/MK64F12 -I../../../../../../../../../../usb/usb_core/host/include -I../../../../../../../../../../usb/usb_core/host/sources/classes/audio -I../../../../../../../../../../usb/usb_core/host/sources/classes/cdc -I../../../../../../../../../../usb/usb_core/host/sources/classes/hid -I../../../../../../../../../../usb/usb_core/host/sources/classes/hub -I../../../../../../../../../../usb/usb_core/host/sources/classes/msd -I../../../../../../../../../../usb/usb_core/host/sources/classes/phdc -I../../../../../../../../../../usb/usb_core/host/sources/classes/printer -I../../../../../../../../../../usb/usb_core/host/sources/controller/khci -I../../../../../../../../../../usb/usb_core/host/sources/controller -I../../../../../../../../../../usb/usb_core/include -I../../../../../../../../../../usb/usb_core/otg/sources/driver/khci -I../../../../../../../../../../usb/usb_core/otg/sources/driver/max3353/sdk -I../../../../../../../../../../usb/usb_core/otg/include -I../../../../../../../../../../usb/usb_core/otg/sources/otg -I../../../../../../../../../../platform/hal/inc -I../../../../../../../../../../platform/drivers/src/uart -I../../../../../../../../../../platform/drivers/src/gpio -I../../../../../../../../../../platform/drivers/src/pit -I../../../../../../../../../../platform/drivers/src/edma -I../../../../../../../../../../platform/drivers/inc -I../../../../../../../../../../platform/system/inc -I../../.. -I../../../../../../../../../../platform/drivers/src/i2c -I../../../../../../../../../../rtos/mqx/config/mcu/MK64F12 -I../../../../../../../../../../rtos/mqx/config/board/frdmk64f -I../../.. -I../../../../../../../../../../platform/devices/MK64F12/include -I../../../../../../../../../../platform/devices/MK64F12/startup -I../../../../../../../../../../platform/system/inc -I../../../../../../../../../../platform/hal/inc -I../../../../../../../../../../platform/drivers/inc -I../../../../../../../../../../platform/drivers/src/mpu -I../../../../../../../../../../platform/startup -I../../../../../../../../../../rtos/mqx/config/common -I../../../../../../../../../../rtos/mqx/mqx/source/bsp -I../../../../../../../../../../rtos/mqx/mqx/source/include -std=gnu99 -fno-strict-aliasing -Wno-format  -fno-common  -ffreestanding  -fno-builtin  -mapcs -MMD -MP -MF"BSP_Files/mqx_main.d" -MT"BSP_Files/mqx_main.o" -c -o "BSP_Files/mqx_main.o" "C:/Freescale/KSDK_1.3.0/rtos/mqx/mqx/source/bsp/mqx_main.c"

'Finished building: C:/Freescale/KSDK_1.3.0/rtos/mqx/mqx/source/bsp/mqx_main.c'

' '

'Building target: host_hid_keyboard_mqx_frdmk64f.elf'

'Invoking: Cross ARM C Linker'

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -T ../../../../../../../../../../platform/devices/MK64F12/linker/gcc/MK64FN1M0xxx12_flash.ld -nostartfiles -Xlinker --gc-sections -Wl,-Map,"host_hid_keyboard_mqx_frdmk64f.map" -Xlinker --cref -Xlinker -z -Xlinker muldefs  -Xlinker --defsym=__ram_vector_table__=1  -Xlinker -static  -Xlinker --undefined=__isr_vector        --specs=nano.specs        -Wall  -fno-common  -ffunction-sections  -fdata-sections  -ffreestanding  -fno-builtin  -mapcs  -Xlinker -z  -Xlinker muldefs  -Xlinker --defsym=__stack_size__=0x4000  -Xlinker --defsym=__heap_size__=0x8000 -o "host_hid_keyboard_mqx_frdmk64f.elf" -Xlinker --start-group  ./utilities/fsl_debug_console.o ./utilities/fsl_misc_utilities.o ./utilities/print_scan.o  ./sources/fsl_hwtimer_pit_irq.o ./sources/hidkeyboard.o  ./board/board.o ./board/gpio_pins.o ./board/hardware_init.o ./board/pin_mux.o  ./BSP_Files/init_bsp.o ./BSP_Files/mqx_main.o  C:/Freescale/KSDK_1.3.0/examples/frdmk64f/demo_apps/usb/host/hid/keyboard/mqx/kds/../../../../../../../../../usb/usb_core/host/lib/mqx/kds/MK64F12/release/libusbh_mqx.a C:/Freescale/KSDK_1.3.0/examples/frdmk64f/demo_apps/usb/host/hid/keyboard/mqx/kds/../../../../../../../../../lib/ksdk_mqx_lib/kds/K64F12/release/libksdk_platform_mqx.a C:/Freescale/KSDK_1.3.0/examples/frdmk64f/demo_apps/usb/host/hid/keyboard/mqx/kds/../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/mqx/lib_mqx.a C:/Freescale/KSDK_1.3.0/examples/frdmk64f/demo_apps/usb/host/hid/keyboard/mqx/kds/../../../../../../../../../rtos/mqx/lib/frdmk64f.kds/release/mqx_stdlib/lib_mqx_stdlib.a -lc -lgcc -lsupc++ -lm -lg -lnosys -Xlinker --end-group

'Finished building target: host_hid_keyboard_mqx_frdmk64f.elf'

' '

12:40:02 Build Finished (took 4s.499ms)

0 Kudos

95 Views
NXP Employee
NXP Employee

Hello,

The image size for the example that you are referring to (host_hid_keyboard_mqx_frdmk64f), is 168 868 Bytes (168 kB aproximately) which fits perfectly in K64 MCU.

'Invoking: Cross ARM GNU Print Size'

arm-none-eabi-size --format=berkeley "host_hid_keyboard_mqx_frdmk64f.elf"

   text       data        bss        dec        hex    filename

111268        536      57064     168868      293a4    host_hid_keyboard_mqx_frdmk64f.elf

'Finished building: host_hid_keyboard_mqx_frdmk64f.siz'

You can print this size in console, please check this post: tip: printing codesize to console

Hope this helps!

Regards,

Isaac

0 Kudos

95 Views
Contributor I

Hi ,

Did the printing of size in console: This is how it shows

'Invoking: Cross ARM GNU Print Size'

arm-none-eabi-size --format=berkeley "host_hid_keyboard_mqx_frdmk64f.elf"

   text       data    bss    dec        hex           filename

109120    536  53780 163436  27e6c host_hid_keyboard_mqx_frdmk64f.elf

'Finished building: host_hid_keyboard_mqx_frdmk64f.siz'

This means its 163436 bytes (163 KB), but when i go to the elf file it shows as below

pastedImage_2.png

Finally i found the answer in this link https://community.nxp.com/message/473587#comment-473587

I changed the output to Create Flash image and generated a .bin file. This is of correct size 108 KB.

I dont know why it shows the .elf size as 163KB but actually it is of huge size 59 MB. Whereas .bin and srec file is generated of correct size.

--Yogesh

0 Kudos

95 Views
Contributor I

Simply put PIT0_ISR interrupt routine is not getting called using baremetal on FRDM K64 board as from the code in delay_init() called in main() the interrupt number installed is

uint32_t pit_vectors[] =

{

#if (OS_ADAPTER_ACTIVE_OS == OS_ADAPTER_MQX)

    INT_PIT0,

    INT_PIT1,

    INT_PIT2,

    INT_PIT3,

#elif (OS_ADAPTER_ACTIVE_OS == OS_ADAPTER_BM) || (OS_ADAPTER_ACTIVE_OS == OS_ADAPTER_SDK)

    PIT0_IRQn,

    PIT1_IRQn,

    PIT2_IRQn,

    PIT3_IRQn,

#endif

};

Since we use Baremetal BM, PIT0_IRQn is used as channel programmed is 0 and timer is 0 as seen in delay_init().

PIT0_ISR() will further cause delay_isr() to get called. This is not happening on FRDMK64 board.

Regards

Yogesh

0 Kudos

95 Views
NXP Employee
NXP Employee

Hello Yogesh,

Also, remember that vector number in delay_init function must be equal to Vector number (considering the 16 core vectors) and not irq number. Be sure that delay_init function is initializing the right interrupt handler.

I've tested this example on my side and it is working fine, OS_Time_delay is using PIT0 and delay_isr is being called every PIT interrupt. Also be sure that global interrupts are enabled by default.

Hope this helps!

Regards,

Isaac

0 Kudos

95 Views
Contributor I

Thanks Isaac.

As you said now i have shifted to KSDK 1.3 and use KDS version 3.00 to build my USB HID application on the K64 MCU.

I successfully built the using the KDS IDE the HID example given in the demo apps USB/Host for K64 MCU.

For this I had to first built the following libraries:

1. libksdk_platform_mqx.a

2. libksdk_platform.a

3. mqx_frdmk64f

4. mqx_stdlib_frdmk64f

5. libusbh_mqx.a

Finally i was able to build the Host HID keyboard example : host_hid_keyboard_mqx_frdmk64f.elf.

Unfortunately the size of this elf file is 58.2 MB (61,069,149 bytes).

The flash size of K64 FRDM is only 1 MB. How did it build this large size elf in debug mode ?

I cannot do drag and drop of this elf to my board because of this.

All my earlier apps which i built in the elf format (for debug) were around 500- 700 KB only (i.e. using bare metal or MQX with GCC_ARM).

Am i missing something ? How can this be corrected using KDS IDE as I plan to use KDS IDE in future also and don't plan to switch to command prompt build anymore.

--Yogesh

0 Kudos

95 Views
NXP Employee
NXP Employee

Hello Yogesh,

I would strongly suggest to use newer USB stack for K64 MCU (for example, the one that is included in Kinetis SDK either 2.0 or 1.3). This USB stack has suppor for GCC compiler and different IDEs and BM is not longer supported, sorry for this inconvenience.

Software Development Kit for Kinetis MCUs|NXP

Have you tried using this one?

Hope this helps!

Regards,

Isaac

0 Kudos