TWR-K21F120M USB host with FAT32 IAR env

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

TWR-K21F120M USB host with FAT32 IAR env

632 Views
christerjohanss
Contributor I

Hello!
I am new to this community and wat to as a couple of questions regarding the readymade sw for TWR-K21F120M.
I don't know if this is the place to put this question, but feel free to guide me to the rignt place.

I am using IAR environment and want to experiment with USB host for memory stick inclusing FAT32 before the real hardware is ready.
I downloaded Freescale code for MQX 4.2 and found interesting project in folder
Freescale_MQX_4_2\usb_v2\example\host\msd\msd_fatfs\mqx\iar\host_msd_fatfs_twrk22f120m

First of all it lacks the paths needed to be able to compile.

I tried to add paths myself byt failed to compile eventually.

I asked tech support in IAR to check it and they gave me paths but they say it still won't link correctly.

Have anyone used this project and got it running?

Best regards

Christer Johansson

Sweden

IAR path settings fron tech support:

$PROJ_DIR$/../../../../../../../usb_core/host/include/twrk22f120m

$PROJ_DIR$/../../../../../../../usb_core/host/include

$PROJ_DIR$/../../../../../../../usb_core/include

$PROJ_DIR$/../../../../../../../adapter/sources

$PROJ_DIR$/../../../../../../../adapter/sources/mqx

$PROJ_DIR$/../../../../../../../../mqx/source/include

$PROJ_DIR$/../../../../../../../../config/twrk22f120m

$PROJ_DIR$/../../../../../../../../config/common

$PROJ_DIR$/../../../../../../../../mqx/source/psp/cortex_m

$PROJ_DIR$/../../../../../../../../mqx/source/psp/cortex_m/compiler/iar

$PROJ_DIR$/../../../../../../../../mqx/source/psp/cortex_m/cpu

$PROJ_DIR$/../../../../../../../../mqx/source/bsp/twrk22f120m

$PROJ_DIR$/../../../../../../../../mqx/source/io/io_mem

$PROJ_DIR$/../../../../../../../../mqx/source/io/io_null

$PROJ_DIR$/../../../../../../../../mqx/source/io/cm

$PROJ_DIR$/../../../../../../../../mqx/source/io/lpm

$PROJ_DIR$/../../../../../../../../mqx/source/io/hwtimer

$PROJ_DIR$/../../../../../../../../mqx/source/io/flashx

$PROJ_DIR$/../../../../../../../../mqx/source/io/flashx/freescale

$PROJ_DIR$/../../../../../../../../mqx/source/io/adc/kadc

$PROJ_DIR$/../../../../../../../../mqx/source/io/adc

$PROJ_DIR$/../../../../../../../../mqx/source/io/lwadc

$PROJ_DIR$/../../../../../../../../mqx/source/io/rtc

$PROJ_DIR$/../../../../../../../../mqx/source/io/serial

$PROJ_DIR$/../../../../../../../../mqx/source/io/dma

$PROJ_DIR$/../../../../../../../../mqx/source/io/i2c

$PROJ_DIR$/../../../../../../../../mqx/source/io/spi

$PROJ_DIR$/../../../../../../../../mqx/source/io/lwgpio

$PROJ_DIR$/../../../../../../../../mqx/source/io/gpio

$PROJ_DIR$/../../../../../../../../mqx/source/io/gpio/kgpio

$PROJ_DIR$/../../../../../../../../mqx/source/io/debug

$PROJ_DIR$/../../../../../../../../mqx/source/io/sai

$PROJ_DIR$/../../../../../../../../mqx/source/io/pccard

$PROJ_DIR$/../../../../../../../../mqx/source/io/pcflash

$PROJ_DIR$/../../../../../../../../mqx/source/io/sdcard

$PROJ_DIR$/../../../../../../../../mqx/source/io/sdcard/sdcard_spi

$PROJ_DIR$/../../../../../../../../mqx/source/io/usb

$PROJ_DIR$/../../../../../../../../mqx/source/io/timer

$PROJ_DIR$/../../../../../../../../mqx/source/io/rnga

$PROJ_DIR$/../../../../../../../../mqx/source/io/enet

$PROJ_DIR$/../../../../../../../../mfs/source/include

$PROJ_DIR$/../../../../../../../usb_core/host/sources/classes/hub

$PROJ_DIR$/../../../../../../../usb_core/host/sources/classes/msd

$PROJ_DIR$/../../../../../../../../shell/source/include

$PROJ_DIR$/../../mfs

$PROJ_DIR$/../../

0 Kudos
2 Replies

414 Views
soledad
NXP Employee
NXP Employee

Hello Christer,

Before you build an example project it is necessary to build all the MQX libraries.

For MQX RTOS v4.2.0, each example/demo application comes with one workspace file, which contains the path to the example/demo project file and all dependent MQX RTOS library project files. Import the workspace file in the folder. For example, with MQX RTOS:

<mqx_install_dir>/mqx/examples/<example>/build/iar/<example>_<board_name>/<example>_<board_name>.eww

For Hello World example of MQX RTOS for FRDMK64F120M, the workspace file is located in folder:

<mqx_install_dir>/mqx/examples/hello/build/iar/hello_frdmk64f/hello_frdmk64f.eww

pastedImage_0.png

Please check more details in the attached document.


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

414 Views
christerjohanss
Contributor I

Yes, you are perfectly right there and those examples works perfectly.

However, the other example folder <mqx_install_dir>/usb_v2/example/
does not contain workspace file (*.eww) only the project (.ewp) file that is not correct.

The project file is missing include folder options to be able to compile the example.

For example, <mqx_install_dir>/usb_v2/example/host/msd/msd_fatfs/mqx/iar/
<mqx_install_dir>/usb_v2/example/host/msd/msd_cmd/mqx/iar/
and all <board_name>. All those folders are lacking the eww file.

I managed to compile the USB host example for my TWR after some trouble, but the FAT32 was missing.

NEW PROBLEM:

Now I am struggling with another problem - this is the wrong Place for it maybe...

I have made my own hardware partly based on TWR-K21F120m and partly the TWR-K22F120m.

using MK22FX512AVMC12 us mcu.
According to https://community.freescale.com/docs/DOC-102548 I should probably use header file MK22F12.h.

Where can I get this header file for my new MCU?

Thanks for replying
/Christer

0 Kudos