MK22 USB Host FATfs with KSDK 1.3.0, MQX and Processor Expert

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

MK22 USB Host FATfs with KSDK 1.3.0, MQX and Processor Expert

Jump to solution
1,839 Views
MAPC
Senior Contributor I

Hello,

 

I'm running into a intriguing problem.

 

Some time ago, I could successfully help a customer, by creating an example code with Processor Expert based on KSDK MQX USB Host - FATfs demo for K64. The KSDK version was 1.2.0 yet. Now, another customer needed the same example code for MK22FN1M0. I carefully followed the same steps with KSDK 1.3.0, but it didn't work this time. I got "Error 1" build error. I have no idea what caused this error and I have spent a lot of time trying to find it out.

 

Probably I missed something.

 

Can anybody help me please?

 

My project is attached.

 

 

Thanks and best regards,

 

Marco Coelho

Applicattions Engineer

Siletec Eletronica

Original Attachment has been moved to: teste_msd_k22.zip

Labels (1)
0 Kudos
1 Solution
992 Views
isaacavila
NXP Employee
NXP Employee

Hello Marco,

I tried by using the plug-in version 2.4 instead of the new one. It compiled successfully.

Could you please try by using this version?

I hope this can help.

Best Regards,

Isaac

View solution in original post

0 Kudos
16 Replies
992 Views
MAPC
Senior Contributor I

Hello again,

I just tried to create a new Processor Expert project with a FRDM-K64F that I have here, based on demo again. But I got the same Error 1 that explains absolutely nothing! This time, I didn't use fsl_usb_framework bean. I added all SDK files and their paths manually.

We are really stuck on that now and we need urgent solution for that more than ever! Can anybody give us a helping hand?

Thanks and best regards,

Marco Coelho

0 Kudos
992 Views
isaacavila
NXP Employee
NXP Employee

Hello Marco,

I compiled your project and see that linker is failing due wrong names on .o files.

name.jpg

Please see this post  Solving the 8192 Character Command Line Limit on Windows | MCU on Eclipse.

After installing the make.exe and echo.exe in KDS files, project compiles correctly.

I hope this can help you.

Have a nice day!

Best Regards,

Isaac

----------------------------------------------------------------------------------------------------------------------------------------

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

----------------------------------------------------------------------------------------------------------------------------------------

0 Kudos
992 Views
MAPC
Senior Contributor I

Even for new projects (no matter which workpace they are at), the *.elf file is not generated anymore after the (make.exe, rm.exe and echo.exe and inclusion of sh.exe and busybox.exe) files replacement.

0 Kudos
993 Views
isaacavila
NXP Employee
NXP Employee

Hello Marco,

I tried by using the plug-in version 2.4 instead of the new one. It compiled successfully.

Could you please try by using this version?

I hope this can help.

Best Regards,

Isaac

0 Kudos
992 Views
MAPC
Senior Contributor I

Isaac,

I just found version 2.4 and I will make a new test.

0 Kudos
992 Views
MAPC
Senior Contributor I

Hello, Isaac

The problem was the version 2.6. I installed version 2.4 and replaced the files in KDS/bin folder and everything is working fine now!

I would never find it out by myself.

I'm very grateful for your great support, guys!

Best regards!

Marco Coelho

Applications Engineer

Siletec Eletronica

0 Kudos
992 Views
zhongshen
Contributor III

Hi Marco,

I used your attached project to build (update 2.4 plug in), and I got the following error.  Can you get the similar error? I have search "update_state" in the project, there is only found in os_tasks.c, that means there is not define in the project.

C:\Users\shen\Documents\myspace\teste_msd_k22\Debug/../Sources/os_tasks.c:143: undefined reference to `update_state'

makefile:96: recipe for target 'teste_msd_k22.elf' failed

collect2.exe: error: ld returned 1 exit status

make: *** [teste_msd_k22.elf] Error 1

0 Kudos
992 Views
isaacavila
NXP Employee
NXP Employee

Hello Zhong,

I think that I commented this calling in order to compile the project correctly.

Could you validate this?

Best Regards,

Isaac

0 Kudos
992 Views
zhongshen
Contributor III

Hello Isaac,

Yes, thanks.

Best regard,

Zhong Shen

0 Kudos
992 Views
MAPC
Senior Contributor I

Hi, Isaac

Where can I find this plug-in?

0 Kudos
992 Views
BlackNight
NXP Employee
NXP Employee

With the new make.exe/etc, what is the command line (console view) saying?

Maybe there is a permission problem with the new make.exe/etc.: can you try to call them from the cmd.exe (DOS shell) if you can launch them?

Otherwise it could be that your firewall/virus scanner is intercepting the calls to the commands?

Erich

0 Kudos
992 Views
MAPC
Senior Contributor I

Hello, Erich

As I told previously to Isaac, my Console View after inserting the new files, is:

09:54:19 **** Build of configuration Debug for project teste_msd_k22 ****

make all

09:54:19 Build Finished (took 94ms)

And the elf file is not generated after compiling any project in KDS anymore.

When I executed make.exe in cdm.exe (DOS shell), I got the following:

pastedImage_1.png

The dialogue box brings up a message in portuguese that says it is missing a file called intl.dll in my computer and it recommends to reinstall it. Where do I find this file to reinstall?

Executing rm.exe, echo.exe and busybox, I have:

pastedImage_2.png

"sh.exe" just prints out the money sign "$":

pastedImage_3.png

I tried to disable my Anti-Virus, but the error remains.

Thank you!

0 Kudos
992 Views
MAPC
Senior Contributor I

Hello, Isaac

I returned the old rm.exe, make.exe and echo.exe to bin folder, cleaned and rebuilt the project to see what is the console. Take a look at that:

16:56:25 **** Incremental Build of configuration Debug for project teste_msd_k22 ****

make all

'Building target: teste_msd_k22.elf'

'Invoking: Cross ARM C++ Linker'

arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall  -g3 -T "C:/Users/Marco-Siletec/workspace2.kds/teste_msd_k22/Project_Settings/Linker_Files/ProcessorExpert.ld" -Xlinker --gc-sections -L"C:/Users/Marco-Siletec/workspace2.kds/teste_msd_k22/Project_Settings/Linker_Files" -Wl,-Map,"teste_msd_k22.map" -lgcc -lc -lsupc++ -lm -specs=nosys.specs -nostartfiles -Xlinker -z -Xlinker muldefs -Xlinker -static -o "teste_msd_k22.elf"  ./Static_Code/System/PE_low_level_init.o ./Static_Code/System/Peripherals_Init.o  ./Static_Code/Peripherals/FMC_Init.o  ./Sources/fatfs/option/unicode.o  ./Sources/fatfs/diskio.o ./Sources/fatfs/ff.o  ./Sources/Events.o ./Sources/main.o ./Sources/msd_diskio.o ./Sources/msd_fat_demo.o ./Sources/os_tasks.o ./Sources/rtos_main_task.o  ./SDK/usb/usb_core/host/sources/controller/khci/host_khci_interface.o ./SDK/usb/usb_core/host/sources/controller/khci/khci.o  ./SDK/usb/usb_core/host/sources/controller/ehci/ehci_host.o ./SDK/usb/usb_core/host/sources/controller/ehci/host_ehci_interface.o  ./SDK/usb/usb_core/host/sources/controller/usb_host.o ./SDK/usb/usb_core/host/sources/controller/usb_host_ch9.o ./SDK/usb/usb_core/host/sources/controller/usb_host_common.o ./SDK/usb/usb_core/host/sources/controller/usb_host_dev_mng.o  ./SDK/usb/adapter/sources/sdk/adapter_sdk.o  ./SDK/rtos/mqx/mqx_stdlib/source/strings/strings.o  ./SDK/rtos/mqx/mqx_stdlib/source/stdio/buf_prv.o ./SDK/rtos/mqx/mqx_stdlib/source/stdio/err.o ./SDK/rtos/mqx/mqx_stdlib/source/stdio/fclose.o ./SDK/rtos/mqx/mqx_stdlib/source/stdio/fflush.o ./SDK/rtos/mqx/mqx_stdlib/source/stdio/fopen.o ./SDK/rtos/mqx/mqx_stdlib/source/stdio/fp_prv.o ./SDK/rtos/mqx/mqx_stdlib/source/stdio/fread.o ./SDK/rtos/mqx/mqx_stdlib/source/stdio/fwrite.o ./SDK/rtos/mqx/mqx_stdlib/source/stdio/get.o ./SDK/rtos/mqx/mqx_stdlib/source/stdio/pos.o ./SDK/rtos/mqx/mqx_stdlib/source/stdio/print.o ./SDK/rtos/mqx/mqx_stdlib/source/stdio/print_prv.o ./SDK/rtos/mqx/mqx_stdlib/source/stdio/put.o ./SDK/rtos/mqx/mqx_stdlib/source/stdio/scan.o ./SDK/rtos/mqx/mqx_stdlib/source/stdio/scan_prv.o ./SDK/rtos/mqx/mqx_stdlib/source/stdio/stdio.o  ./SDK/rtos/mqx/mqx/source/string/str_utos.o ./SDK/rtos/mqx/mqx/source/string/strnlen.o  ./SDK/rtos/mqx/mqx/source/psp/cortex_m/core/M4/boot.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/core/M4/dispatch.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/core/M4/support.o  ./SDK/rtos/mqx/mqx/source/psp/cortex_m/compiler/gcc_arm/comp.o  ./SDK/rtos/mqx/mqx/source/psp/cortex_m/cortex.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/int_gkis.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/int_kisr.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/int_pvta.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/int_unx.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/int_vtab.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/int_xcpt.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/ipsum.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/mem_copy.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/mem_zero.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/nvic.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_dati.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_gelms.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_hoti.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_iinit.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_mat1.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_mat2.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_mat3.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_miti.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_msti.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_mstiq.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_nsti.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_psti.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_seti.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_supp.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_tiad.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_tida.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_tihr.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_timn.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_tims.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_tinm.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_tins.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_tiol.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_tipr.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_tips.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_tise.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_tisu.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_tius.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_tkti.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/psp_usti.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/sc_irdyq.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/stack_bu.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/stack_de.o ./SDK/rtos/mqx/mqx/source/psp/cortex_m/stack_st.o  ./SDK/rtos/mqx/mqx/source/nio/src/errno.o ./SDK/rtos/mqx/mqx/source/nio/src/nio.o ./SDK/rtos/mqx/mqx/source/nio/src/nio_posix.o ./SDK/rtos/mqx/mqx/source/nio/src/nio_std_adpt.o  ./SDK/rtos/mqx/mqx/source/nio/fs/fs_supp.o  ./SDK/rtos/mqx/mqx/source/nio/drivers/nio_tty/src/nio_tty.o  ./SDK/rtos/mqx/mqx/source/nio/drivers/nio_serial/src/nio_serial.o  ./SDK/rtos/mqx/mqx/source/nio/drivers/nio_dummy/src/nio_dummy.o  ./SDK/rtos/mqx/mqx/source/kernel/event.o ./SDK/rtos/mqx/mqx/source/kernel/idletask.o ./SDK/rtos/mqx/mqx/source/kernel/inittask.o ./SDK/rtos/mqx/mqx/source/kernel/int.o ./SDK/rtos/mqx/mqx/source/kernel/klog.o ./SDK/rtos/mqx/mqx/source/kernel/log.o ./SDK/rtos/mqx/mqx/source/kernel/lwevent.o ./SDK/rtos/mqx/mqx/source/kernel/lwlog.o ./SDK/rtos/mqx/mqx/source/kernel/lwmem.o ./SDK/rtos/mqx/mqx/source/kernel/lwmsgq.o ./SDK/rtos/mqx/mqx/source/kernel/lwsem.o ./SDK/rtos/mqx/mqx/source/kernel/lwtimer.o ./SDK/rtos/mqx/mqx/source/kernel/mem.o ./SDK/rtos/mqx/mqx/source/kernel/mqx.o ./SDK/rtos/mqx/mqx/source/kernel/msg.o ./SDK/rtos/mqx/mqx/source/kernel/msgpool.o ./SDK/rtos/mqx/mqx/source/kernel/msgq.o ./SDK/rtos/mqx/mqx/source/kernel/mutex.o ./SDK/rtos/mqx/mqx/source/kernel/name.o ./SDK/rtos/mqx/mqx/source/kernel/partition.o ./SDK/rtos/mqx/mqx/source/kernel/queue.o ./SDK/rtos/mqx/mqx/source/kernel/sched.o ./SDK/rtos/mqx/mqx/source/kernel/sem.o ./SDK/rtos/mqx/mqx/source/kernel/task.o ./SDK/rtos/mqx/mqx/source/kernel/taskq.o ./SDK/rtos/mqx/mqx/source/kernel/time.o ./SDK/rtos/mqx/mqx/source/kernel/timer.o ./SDK/rtos/mqx/mqx/source/kernel/tlsf.o ./SDK/rtos/mqx/mqx/source/kernel/tlsf_adaptation.o ./SDK/rtos/mqx/mqx/source/kernel/watchdog.o  ./SDK/rtos/mqx/mqx/source/bsp/init_bsp.o  ./SDK/platform/utilities/src/fsl_debug_console.o ./SDK/platform/utilities/src/fsl_misc_utilities.o ./SDK/platform/utilities/src/print_scan.o  ./SDK/platform/system/src/interrupt/fsl_interrupt_manager.o  ./SDK/platform/system/src/hwtimer/fsl_hwtimer.o ./SDK/platform/system/src/hwtimer/fsl_hwtimer_systick.o  ./SDK/platform/system/src/clock/MK22FA12/fsl_clock_MK22FA12.o  ./SDK/platform/system/src/clock/fsl_clock_manager.o ./SDK/platform/system/src/clock/fsl_clock_manager_common.o  ./SDK/platform/osa/src/fsl_os_abstraction_mqx.o  ./SDK/platform/hal/src/uart/fsl_uart_hal.o  ./SDK/platform/hal/src/sim/MK22FA12/fsl_sim_hal_MK22FA12.o  ./SDK/platform/hal/src/rtc/fsl_rtc_hal.o  ./SDK/platform/hal/src/port/fsl_port_hal.o  ./SDK/platform/hal/src/osc/fsl_osc_hal.o  ./SDK/platform/hal/src/mpu/fsl_mpu_hal.o  ./SDK/platform/hal/src/mcg/fsl_mcg_hal.o ./SDK/platform/hal/src/mcg/fsl_mcg_hal_modes.o  ./SDK/platform/drivers/src/uart/fsl_uart_common.o ./SDK/platform/drivers/src/uart/fsl_uart_driver.o  ./SDK/platform/drivers/src/rtc/fsl_rtc_common.o  ./SDK/platform/drivers/src/mpu/fsl_mpu_common.o ./SDK/platform/drivers/src/mpu/fsl_mpu_driver.o  ./SDK/platform/devices/MK22FA12/startup/gcc/startup_MK22FA12.o  ./SDK/platform/devices/MK22FA12/startup/system_MK22FA12.o  ./SDK/platform/devices/startup.o  ./Generated_Code/SDK/usb/usb_core/host/sources/bsp/usbFmw1_host_bsp.o ./Generated_Code/SDK/usb/usb_core/host/sources/bsp/usb_host_bsp.o  ./Generated_Code/Cpu.o ./Generated_Code/MainTask.o ./Generated_Code/clockMan1.o ./Generated_Code/flash_drive.o ./Generated_Code/fsl_hwtimer1.o ./Generated_Code/fsl_mpu1.o ./Generated_Code/hardware_init.o ./Generated_Code/mqx_ksdk.o ./Generated_Code/osa1.o ./Generated_Code/pin_mux.o ./Generated_Code/uart1.o ./Generated_Code/usbFmw1.o  C:/Freescale/KSDK_1.3.0/usb/usb_core/host/lib/mqx/kds/MK22F51212/debug/libusbh_mqx.a C:/Freescale/KSDK_1.3.0/lib/ksdk_mqx_lib/kds/K22F51212/debug/libksdk_platform_mqx.a C:/Freescale/KSDK_1.3.0/rtos/mqx/lib/frdmk22f.kds/debug/mqx/lib_mqx.a C:/Freescale/KSDK_1.3.0/rtos/mqx/lib/frdmk22f.kds/debug/mqx_stdlib/lib_mqx_stdlib.a

arm-none-eabi-g++: error: C:/Freesale/KSDK_1.3.0/usb/usb_core/host/lib/mqx/kds/MK22F51212/debug/libusbh_mqx.a: No such file or directory

make: *** [teste_msd_k22.elf] Error 1

16:56:27 Build Finished (took 1s.718ms)

Notice that the error refers to a wrong name in USB Host MQX library file path. Instead of c:/Freescale..., it is looking for "C:/Freesale...". That is driving me crazy! How can I fix that?

Marco Coelho

0 Kudos
992 Views
BlackNight
NXP Employee
NXP Employee

Your problem is that you execeed the 8192 character limit on Windows.

You need to apply the following patch described here:

Solving the 8192 Character Command Line Limit on Windows | MCU on Eclipse

Windows will cut out some characters from your command line, resulting in these strange errors.

Erich

0 Kudos
992 Views
MAPC
Senior Contributor I

And now I can't generate .elf file for all other projects in the same workspace.

0 Kudos
992 Views
MAPC
Senior Contributor I

Hello, Isaac

After performing the changes you recommended, the Error 1 disappeared, but it looks like the compiler is not building the project anymore. The *.elf file is not generated and I don't see anything in Console after cleaning and building the project:

pastedImage_0.png

0 Kudos