KSDK Linker Error - Command line too long

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

KSDK Linker Error - Command line too long

Jump to solution
8,347 Views
larrykoos
Contributor III

I'm using KDS 1.1.1 with MQX_KSDK 1.0.0. I've built a project with Processor Expert targeting a K64 part. After using the project successfully for several weeks, I have reached a point where I get a linker error such as:

 

arm-none-eabi-g++: error: C:/Freescale/KDS_1.1.1/eclipse//../toolchain/arm-none-eabi/lib/m4fp/v4-sp-d16/libm.a: No such file or directory

 

Through experimentation, I have determined this error is caused by a linker command line that exceeds a maximum threshold. Here is an example of the command line auto-generated by the tool:

 

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  -g3 -T "C:/Users/Larry/git/asr_v1/asr_v1/Project_Settings/Linker_Files/ProcessorExpert.ld" -Xlinker --gc-sections -L"C:/Users/Larry/git/asr_v1/asr_v1/Project_Settings/Linker_Files" -L"C:\Users\Larry\workspace.kds\xbee\Debug" -Wl,-Map,"asr_v1.map" -nostartfiles -nodefaultlibs -nostdlib -Xlinker -z -Xlinker muldefs -Xlinker -static -o "asr_v1.elf"  ./Static_Code/System/PE_low_level_init.o  ./Sources/xbee/xbee_platform_posix.o ./Sources/xbee/xbee_serial_mqx.o  ./Sources/Events.o ./Sources/asrMessaging.o ./Sources/main.o ./Sources/mqx_tasks.o ./Sources/telit.o ./Sources/uart_handler.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/string/unicode.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_inst.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/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_tfs/src/nio_tfs.o  ./SDK/rtos/mqx/mqx/source/nio/drivers/nio_serial/src/nio_serial.o  ./SDK/rtos/mqx/mqx/source/nio/drivers/nio_pipe/src/nio_pipe.o  ./SDK/rtos/mqx/mqx/source/nio/drivers/nio_null/src/nio_null.o  ./SDK/rtos/mqx/mqx/source/nio/drivers/nio_mem/src/nio_mem.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/watchdog.o  ./SDK/rtos/mqx/mqx/source/bsp/K64F12/vectors.o  ./SDK/rtos/mqx/mqx/source/bsp/init_bsp.o ./SDK/rtos/mqx/mqx/source/bsp/init_hardware.o ./SDK/rtos/mqx/mqx/source/bsp/init_nio_serial.o ./SDK/rtos/mqx/mqx/source/bsp/mqx_init.o  ./SDK/rtos/mqx/config/app_mqx.o  ./SDK/platform/utilities/src/fsl_misc_utilities.o  ./SDK/platform/system/interrupt/src/fsl_interrupt_manager.o  ./SDK/platform/system/hwtimer/src/fsl_hwtimer.o ./SDK/platform/system/hwtimer/src/fsl_hwtimer_systick.o  ./SDK/platform/system/clock/MK64F12/fsl_clock_K64F12.o  ./SDK/platform/system/clock/fsl_clock_manager.o  ./SDK/platform/startup/MK64F12/system_MK64F12.o  ./SDK/platform/osa/src/fsl_os_abstraction_mqx.o  ./SDK/platform/hal/uart/fsl_uart_hal.o  ./SDK/platform/hal/sim/MK64F12/fsl_sim_hal_K64F12.o  ./SDK/platform/hal/sim/fsl_sim_hal.o  ./SDK/platform/hal/sdhc/fsl_sdhc_hal.o  ./SDK/platform/hal/port/fsl_port_hal.o  ./SDK/platform/hal/osc/fsl_osc_hal.o  ./SDK/platform/hal/mpu/fsl_mpu_hal.o  ./SDK/platform/hal/mcg/fsl_mcg_hal.o ./SDK/platform/hal/mcg/fsl_mcg_hal_modes.o  ./SDK/platform/hal/lptmr/fsl_lptmr_hal.o  ./SDK/platform/hal/gpio/fsl_gpio_hal.o  ./SDK/platform/drivers/uart/src/fsl_uart_driver.o  ./SDK/platform/drivers/uart/common/fsl_uart_common.o  ./SDK/platform/drivers/uart/fsl_uart_irq.o  ./SDK/platform/drivers/sdhc/src/fsl_sdhc_driver.o  ./SDK/platform/drivers/sdhc/common/fsl_sdhc_common.o  ./SDK/platform/drivers/sdhc/fsl_sdhc_irq.o  ./SDK/platform/drivers/mpu/src/fsl_mpu_driver.o  ./SDK/platform/drivers/mpu/common/fsl_mpu_common.o  ./SDK/platform/drivers/gpio/src/fsl_gpio_driver.o  ./SDK/platform/drivers/gpio/common/fsl_gpio_common.o  ./SDK/platform/drivers/gpio/fsl_gpio_irq.o  ./Generated_Code/Cpu.o ./Generated_Code/fsl_hwtimer1.o ./Generated_Code/fsl_mpu1.o ./Generated_Code/fsl_uart1.o ./Generated_Code/gpio_pins.o ./Generated_Code/hardware_init.o ./Generated_Code/mqx_ksdk.o ./Generated_Code/pin_init.o ./Generated_Code/sdCard1.o ./Generated_Code/uartCom0.o ./Generated_Code/uartCom3.o  C:/Freescale/KDS_1.1.1/eclipse//../toolchain/lib/gcc/arm-none-eabi/4.8.0/m4/fp/v4-sp-d16/libgcc.a C:/Freescale/KDS_1.1.1/eclipse//../toolchain/arm-none-eabi/lib/m4/fp/v4-sp-d16/libc.a C:/Freescale/KDS_1.1.1/eclipse//../toolchain/arm-none-eabi/lib/m4/fp/v4-sp-d16/libsupc++.a C:/Freescale/KDS_1.1.1/eclipse//../toolchain/arm-none-eabi/lib/m4/fp/v4-sp-d16/libm.a -lxbee

 

 

Clearly, the right way to fix this is to make a library of MQX and link in the library to the application, but I can't figure out how to do this without breaking the Processor Expert environment. Can anyone tell me the correct process?

 

Thanks.

Labels (1)
Tags (3)
1 Solution
5,508 Views
larrykoos
Contributor III

Here is a good work-around to this problem.

First, create a textfile called makefile.defs in the project's root directory. This file is referenced in the autogenerated makefile in an include statement as shown and is provided for the developer to influence an auto-generated make.

.

.

.

ifneq ($(strip $(S_UPPER_DEPS)),)

-include $(S_UPPER_DEPS)

endif

endif

-include ../makefile.defs

# Add inputs and outputs from these tool invocations to the build variables

# All Target

.

.

.

Use this file, makefile.defs, to copy all the compiled object files and libraries into a file which we called ObjectList. The makefile script we used is:

$(shell rm ObjectList)

$(foreach obj, $(OBJS), $(shell echo $(obj) >> ObjectList))

$(shell echo $(USER_OBJS) >> ObjectList)

There is probably a more efficient script than this but I'm not a script wiz.

Finally, edit the project linker settings' Command Line Pattern to remove the reference to $(INPUTS) and replace it with @ObjectList

pastedImage_0.png

Hope this helps.

View solution in original post

27 Replies
4,944 Views
dominikneudert-
Contributor I

I had this issue with Code Warrior 10.1 writing software for a HCS08 microcontroller. My solution was to write a small Python script that writes all compiled object files to another file which is then read by the linker.

Note: The following solution works fine for my project. However, some things may need to be changed to work with other projects, targets, compilers etc.
Note: You need to install Python for Windows to make this work. Additionally, you might want to include python into your system's PATH variable.

The Python script

import sys

import os

def main(argv = None):

    if (not len(argv) == 3):

        myname = os.path.basename(argv[0])

        sys.exit("usage: {} <object file name> <linker args file>".format(myname))

       

   

    obj_arg = "-Add({}) ".format(argv[1])

    args_file_name = argv[2]

   

    try:

        if os.path.isfile(args_file_name):

            with open(args_file_name, 'r') as args_file:

                args = args_file.read()

            if not obj_arg in args:

                with open(args_file_name, 'a') as args_file:

                    args_file.write(obj_arg)

        elif not os.path.exists(args_file_name):

            with open(args_file_name, 'w+') as args_file:

                args_file.write(obj_arg)

        else:

            sys.exit("Path '{}' exists but is not a file.".format(args_file_name))

           

    except OSError as err:

        sys.exit("Error: " + err.strerror())

           

if __name__ == "__main__":

    main(sys.argv)

Changes to the build system

In the project properties under "C/C++ Build"/"Settings" on the right side I changed the invocation of linker, compiler and assembler as follows:

Under "Linker" --> "Command line pattern" (right side):

python ../scripts/append_object.py """$(MCUToolsBaseDirEnv)\lib\hc08c\lib\ansis.lib""" objlist.args & ${COMMAND} -ArgFile"objlist.args" ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT}

--> Note: I needed to link ansis.lib into the application. So I included it here. For other applications this may be different.

--> The file objlist.args contains all object files as parameters to the linker.

Under "HCS08 Compiler" --> "Command line pattern" (right side):

python ../scripts/append_object.py """${OUTPUT}""" objlist.args & ${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}

--> This writes the name of the object file compiled from a C file to objlist.args.

Under "HCS08 Assembler" --> "Command line pattern" (right side):

python ../scripts/append_object.py """${OUTPUT}""" objlist.args & ${COMMAND} ${FLAGS} -Objn${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}

--> This writes the name of the object file compiled from an assembler file to objlist.args.

Note: The only problem that I encountered was that sometimes old object files are listed if no clean is done but when source files where deleted. in this case, either do a "clean" or delete the build directory to solve this problem.

0 Kudos
5,509 Views
larrykoos
Contributor III

Here is a good work-around to this problem.

First, create a textfile called makefile.defs in the project's root directory. This file is referenced in the autogenerated makefile in an include statement as shown and is provided for the developer to influence an auto-generated make.

.

.

.

ifneq ($(strip $(S_UPPER_DEPS)),)

-include $(S_UPPER_DEPS)

endif

endif

-include ../makefile.defs

# Add inputs and outputs from these tool invocations to the build variables

# All Target

.

.

.

Use this file, makefile.defs, to copy all the compiled object files and libraries into a file which we called ObjectList. The makefile script we used is:

$(shell rm ObjectList)

$(foreach obj, $(OBJS), $(shell echo $(obj) >> ObjectList))

$(shell echo $(USER_OBJS) >> ObjectList)

There is probably a more efficient script than this but I'm not a script wiz.

Finally, edit the project linker settings' Command Line Pattern to remove the reference to $(INPUTS) and replace it with @ObjectList

pastedImage_0.png

Hope this helps.

4,215 Views
tomazsustar
Contributor I

Great tip! For me it also worked without the foreach loop, which speeds up the script a lot. I also hat to redirect the shell output to a dummy variable, otherwise the make was complaining:

makefile.defs:

DUMMY := $(shell echo $(OBJS) > ObjectList)
DUMMY := $(shell echo $(USER_OBJS) >> ObjectList)

0 Kudos
4,944 Views
davepfaltzgraff
Senior Contributor I

First THANKS for the solution! But I would like to add three points for improvement.

1. My environment is Windows 7, KDS 2.0.0, and KSDK 1.1.0. When I ran the script, I kept getting an extra line "ECHO is off." that prevented the linker from completing. Adding a period (.) to the echo command took care of this.

2. After getting a clean ObjectList file, the linker would not include the normal libraries. There may be a better way to do this, but I ended up adding hardcoding links to them at the end of the ObjectList file. So, now my makefile.defs is as attached. This works for now, but may need to be amended as the project expands.

3. My specific interest is in the combination of KDS, KSDK, PE, and MQX. It did not take a very complex project to run into this problem. I would encourage the "team" to consider a better (and permanent) fix to this problem. If it's acceptable from the overall picture, adding this file would work, but a means of handling the libraries must be put in place. An alternative that was mentioned earlier would also  work. This would be to compile and link the PE provided files into it's own library prior to performing the final link with the user's code. Unfortunately, I am too new to the Eclipse way of doing things to be able to investigate on my own.

For the time being, I am back to working with the full complement of tools.

Once again, thanks for getting me over this hurdle.

0 Kudos
4,944 Views
BlackNight
NXP Employee
NXP Employee

Good news: I have found a solution to the Windows command line (linker) lenght:

http://mcuoneclipse.com/2015/03/29/solving-the-8192-character-command-line-limit-on-windows/

I have not done extensive testing, but all my projects which failed before are building now properly :-)

I hope this helps,

Erich

4,944 Views
kena1
Contributor II

Thanks!  That worked, and after using the Processor Expert for a commercial project, I have to wonder how such a fundamental limitation was not detected by Freescale.

0 Kudos
4,944 Views
giacomopetrini
Contributor IV

ok, thanks.

Hope this will be included in next version od KDS...

0 Kudos
4,944 Views
BlackNight
NXP Employee
NXP Employee

and if not, you can apply the same thing I guess.

0 Kudos
4,952 Views
giacomopetrini
Contributor IV

Are you compiling C++ source code? If yes you need to copy the includes path that are in Project Properties->C/C++ Build->Settings->Cross ARM C Compiler->Includes and paste in the Cross ARM C++ Compiler->Includes.

Beacause PE does NOT update the C++ Includes when you generate the code.

Hope this Help

Bye Giacomo

4,952 Views
arwedspringer
Contributor II

No, I do not use any C++ source code, pleace have a look at my post I just added in the forum.

Bye Springer

Original Message processed by David.fx12

Re:  - KSDK Linker Error - Command line too long (06-Nov-2014 15:12)

From:  giacomopetrini

To:Arwed Springer

KSDK Linker Error - Command line too long

reply from giacomopetrini in Kinetis Software Development Kit - View the full discussion

Are you compiling C++ source code? If yes you need to copy the includes path that are in Project Properties->C/C++ Build->Settings->Cross ARM C Compiler->Includes and paste in the Cross ARM C++ Compiler->Includes.

Beacause PE does NOT update the C++ Includes when you generate the code.

Hope this Help

Bye Giacomo

Did your question get answered?

If so, say thanks by clicking Correct Answer in the community thread!

Reply to this message by replying to this email, or go to the message on Freescale Community

Start a new discussion in Kinetis Software Development Kit by email or at Freescale Community

Following KSDK Linker Error - Command line too long in these streams: Inbox

0 Kudos
4,952 Views
BlackNight
NXP Employee
NXP Employee

This probably only helps a little, but here a few tips to reduce the length of the command line:

a) use short paths/folder names (of course).

b) Shorten the folder for the Processor Expert generated code: there is a setting in the project properties:

pastedImage_0.png

c) Instead of "${ProjDirPath}/Project_Settings/Linker_Files/ProcessorExpert.ld" for the linker file (which will be expaneded to full path, do this:

Make the library search path relative (it is relative to the Debug/output folder):

pastedImage_2.png

Then you only specify the linker file:

That does not solve the problem itself, but maybe keeps the number of characters on the command line short enough.

Another solution would be to use a library for MQX (as already mentioned).

Or to pass the files to the linker using a file.

Erich

0 Kudos
4,952 Views
intractablesubt
Contributor III

Erich,

Can you give a step-by-step example for using MQX as a library and continue to use PE? We continue to struggle with this.

0 Kudos
4,952 Views
danielecortella
Contributor V

Same problem with kds 2.0.0, i have :

arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g3 -T ............

Linea in ingresso troppo lunga. ("input line too long")

make: *** [Test.elf] Error 255

How to solve

0 Kudos
4,952 Views
BlackNight
NXP Employee
NXP Employee

Hi Daniele,

KDS v2.0.0 does not come with different build tools or build tools integration, so this Windows limitation still applies.

So as for the solution, the points brought up earlier in this post (shorten the command line, use subst, use libraries) still apply.

Erich

0 Kudos
4,952 Views
danielecortella
Contributor V

Hi, i have move the project in c:\workspce but same error:

'Building target: Test.elf'

'Invoking: Cross ARM C++ Linker'

arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g3 -T "C:/Workspace/Test/Test/Project_Settings/Linker_Files/ProcessorExpert.ld" -Xlinker --gc-sections -L"C:/Workspace/Test/Test/Project_Settings/Linker_Files" -Wl,-Map,"Test.map" -nanolibc -o "Test.elf"  ./Sources/Events.o ./Sources/main.o ./Sources/mqx_tasks.o ./Sources/sa_mtb.o  ./Sensors/Gas_Sensor.o ./Sensors/HTU21D.o ./Sensors/Master_Sensor.o  ./SdCard/SD1.o ./SdCard/SD_kinetis.o ./SdCard/SPI_kinetis.o  ./RTC/PCF_85063.o  ./Power_Supply/PowerSupply.o  ./Page/Bluetooth.o ./Page/ClockTempBar.o ./Page/DataPage.o ./Page/GasMeasurePage.o ./Page/HomePage.o ./Page/InformationPage.o ./Page/IntervalPage.o ./Page/LanguagePage.o ./Page/OraPage.o ./Page/SettingPage.o ./Page/StartPage.o ./Page/StoricoPage.o  ./MQXLITE/psp/cortex_m/core/M0/boot.o ./MQXLITE/psp/cortex_m/core/M0/dispatch.o  ./MQXLITE/psp/cortex_m/cortex.o ./MQXLITE/psp/cortex_m/int_gkis.o ./MQXLITE/psp/cortex_m/int_inst.o ./MQXLITE/psp/cortex_m/int_kisr.o ./MQXLITE/psp/cortex_m/int_pvta.o ./MQXLITE/psp/cortex_m/int_unx.o ./MQXLITE/psp/cortex_m/int_vtab.o ./MQXLITE/psp/cortex_m/int_xcpt.o ./MQXLITE/psp/cortex_m/mem_zero.o ./MQXLITE/psp/cortex_m/psp_iinit.o ./MQXLITE/psp/cortex_m/psp_supp.o ./MQXLITE/psp/cortex_m/psp_tiad.o ./MQXLITE/psp/cortex_m/psp_tinm.o ./MQXLITE/psp/cortex_m/psp_tipr.o ./MQXLITE/psp/cortex_m/psp_tisu.o ./MQXLITE/psp/cortex_m/sc_irdyq.o ./MQXLITE/psp/cortex_m/stack_bu.o ./MQXLITE/psp/cortex_m/stack_de.o ./MQXLITE/psp/cortex_m/stack_st.o  ./MQXLITE/kernel/idletask.o ./MQXLITE/kernel/int.o ./MQXLITE/kernel/klog.o ./MQXLITE/kernel/lwevent.o ./MQXLITE/kernel/lwlog.o ./MQXLITE/kernel/lwmem.o ./MQXLITE/kernel/lwmsgq.o ./MQXLITE/kernel/lwsem.o ./MQXLITE/kernel/lwtimer.o ./MQXLITE/kernel/mqx_utils.o ./MQXLITE/kernel/mqxlite.o ./MQXLITE/kernel/mutex.o ./MQXLITE/kernel/qu_test.o ./MQXLITE/kernel/sched.o ./MQXLITE/kernel/task.o ./MQXLITE/kernel/time_ticks.o  ./MQXLITE/config/task_template_list.o  ./Initialization/Init.o  ./I2C/I2C.o ./I2C/IntI2cLdd1.o  ./Generated_Code/Generated_Code/BT_ACTIVE.o ./Generated_Code/Generated_Code/BT_RDYN.o ./Generated_Code/Generated_Code/BT_REQN.o ./Generated_Code/Generated_Code/BT_RESET.o ./Generated_Code/Generated_Code/BUTT_POWER.o ./Generated_Code/Generated_Code/BattSensGND.o ./Generated_Code/Generated_Code/BitIoLdd1.o ./Generated_Code/Generated_Code/BitIoLdd10.o ./Generated_Code/Generated_Code/BitIoLdd11.o ./Generated_Code/Generated_Code/BitIoLdd12.o ./Generated_Code/Generated_Code/BitIoLdd13.o ./Generated_Code/Generated_Code/BitIoLdd14.o ./Generated_Code/Generated_Code/BitIoLdd15.o ./Generated_Code/Generated_Code/BitIoLdd18.o ./Generated_Code/Generated_Code/BitIoLdd19.o ./Generated_Code/Generated_Code/BitIoLdd2.o ./Generated_Code/Generated_Code/BitIoLdd20.o ./Generated_Code/Generated_Code/BitIoLdd21.o ./Generated_Code/Generated_Code/BitIoLdd22.o ./Generated_Code/Generated_Code/BitIoLdd23.o ./Generated_Code/Generated_Code/BitIoLdd24.o ./Generated_Code/Generated_Code/BitIoLdd25.o ./Generated_Code/Generated_Code/BitIoLdd26.o ./Generated_Code/Generated_Code/BitIoLdd27.o ./Generated_Code/Generated_Code/BitIoLdd28.o ./Generated_Code/Generated_Code/BitIoLdd29.o ./Generated_Code/Generated_Code/BitIoLdd3.o ./Generated_Code/Generated_Code/BitIoLdd30.o ./Generated_Code/Generated_Code/BitIoLdd4.o ./Generated_Code/Generated_Code/BitIoLdd5.o ./Generated_Code/Generated_Code/BitIoLdd6.o ./Generated_Code/Generated_Code/BitIoLdd7.o ./Generated_Code/Generated_Code/BitIoLdd8.o ./Generated_Code/Generated_Code/BitIoLdd9.o ./Generated_Code/Generated_Code/BitsIoLdd1.o ./Generated_Code/Generated_Code/BitsIoLdd2.o ./Generated_Code/Generated_Code/BitsIoLdd3.o ./Generated_Code/Generated_Code/Cap1.o ./Generated_Code/Generated_Code/CaptureLdd1.o ./Generated_Code/Generated_Code/Cpu.o ./Generated_Code/Generated_Code/DB_high_1.o ./Generated_Code/Generated_Code/DB_high_2.o ./Generated_Code/Generated_Code/DB_low.o ./Generated_Code/Generated_Code/IO1_SCK.o ./Generated_Code/Generated_Code/IO2_MOSI.o ./Generated_Code/Generated_Code/IO3_MISO.o ./Generated_Code/Generated_Code/LCD_BKL.o ./Generated_Code/Generated_Code/LCD_CS.o ./Generated_Code/Generated_Code/LCD_DATA.o ./Generated_Code/Generated_Code/LCD_RD.o ./Generated_Code/Generated_Code/LCD_RST.o ./Generated_Code/Generated_Code/LCD_WR.o ./Generated_Code/Generated_Code/LTC_BUCK_ON.o ./Generated_Code/Generated_Code/LTC_BUCK_STDBY.o ./Generated_Code/Generated_Code/LTC_CHARGE.o ./Generated_Code/Generated_Code/LTC_ON.o ./Generated_Code/Generated_Code/LTC_PGOOD.o ./Generated_Code/Generated_Code/MQX1.o ./Generated_Code/Generated_Code/PE_LDD.o ./Generated_Code/Generated_Code/PIT.o ./Generated_Code/Generated_Code/PwmLdd1.o ./Generated_Code/Generated_Code/RTC_INT.o ./Generated_Code/Generated_Code/Ref_EN.o ./Generated_Code/Generated_Code/SDCard_ON.o ./Generated_Code/Generated_Code/SNS_AD1.o ./Generated_Code/Generated_Code/SNS_AD2.o ./Generated_Code/Generated_Code/SNS_AD3.o ./Generated_Code/Generated_Code/SNS_AD4.o ./Generated_Code/Generated_Code/SNS_AD5.o ./Generated_Code/Generated_Code/SNS_AD6.o ./Generated_Code/Generated_Code/SNS_IOA.o ./Generated_Code/Generated_Code/SystemTimer1.o ./Generated_Code/Generated_Code/TU1.o ./Generated_Code/Generated_Code/TU2.o ./Generated_Code/Generated_Code/TU3.o ./Generated_Code/Generated_Code/TimeDateLdd1.o ./Generated_Code/Generated_Code/TmDt1.o ./Generated_Code/Generated_Code/USB_ID.o ./Generated_Code/Generated_Code/USB_LDD.o ./Generated_Code/Generated_Code/Vectors.o ./Generated_Code/Generated_Code/WAIT.o ./Generated_Code/Generated_Code/Xmin.o ./Generated_Code/Generated_Code/Ymin.o ./Generated_Code/Generated_Code/usb_class.o ./Generated_Code/Generated_Code/usb_dci.o ./Generated_Code/Generated_Code/usb_descriptor.o ./Generated_Code/Generated_Code/usb_device.o ./Generated_Code/Generated_Code/usb_driver.o ./Generated_Code/Generated_Code/usb_framework.o ./Generated_Code/Generated_Code/usb_msc.o ./Generated_Code/Generated_Code/usb_msc_scsi.o  ./Generated_Code/BT_ACTIVE.o ./Generated_Code/BT_RDYN.o ./Generated_Code/BT_REQN.o ./Generated_Code/BT_RESET.o ./Generated_Code/BUTT_POWER.o ./Generated_Code/BattSensGND.o ./Generated_Code/BitIoLdd1.o ./Generated_Code/BitIoLdd10.o ./Generated_Code/BitIoLdd11.o ./Generated_Code/BitIoLdd12.o ./Generated_Code/BitIoLdd13.o ./Generated_Code/BitIoLdd14.o ./Generated_Code/BitIoLdd17.o ./Generated_Code/BitIoLdd18.o ./Generated_Code/BitIoLdd19.o ./Generated_Code/BitIoLdd2.o ./Generated_Code/BitIoLdd20.o ./Generated_Code/BitIoLdd21.o ./Generated_Code/BitIoLdd22.o ./Generated_Code/BitIoLdd23.o ./Generated_Code/BitIoLdd24.o ./Generated_Code/BitIoLdd25.o ./Generated_Code/BitIoLdd26.o ./Generated_Code/BitIoLdd27.o ./Generated_Code/BitIoLdd28.o ./Generated_Code/BitIoLdd29.o ./Generated_Code/BitIoLdd3.o ./Generated_Code/BitIoLdd30.o ./Generated_Code/BitIoLdd4.o ./Generated_Code/BitIoLdd5.o ./Generated_Code/BitIoLdd6.o ./Generated_Code/BitIoLdd7.o ./Generated_Code/BitIoLdd8.o ./Generated_Code/BitIoLdd9.o ./Generated_Code/BitsIoLdd1.o ./Generated_Code/BitsIoLdd2.o ./Generated_Code/BitsIoLdd3.o ./Generated_Code/Cap1.o ./Generated_Code/CaptureLdd1.o ./Generated_Code/Cpu.o ./Generated_Code/DB_high_1.o ./Generated_Code/DB_high_2.o ./Generated_Code/DB_low.o ./Generated_Code/IO1_SCK.o ./Generated_Code/IO2_MOSI.o ./Generated_Code/IO3_MISO.o ./Generated_Code/LCD_BKL.o ./Generated_Code/LCD_CS.o ./Generated_Code/LCD_DATA.o ./Generated_Code/LCD_RD.o ./Generated_Code/LCD_RST.o ./Generated_Code/LCD_WR.o ./Generated_Code/LTC_BUCK_ON.o ./Generated_Code/LTC_BUCK_STDBY.o ./Generated_Code/LTC_CHARGE.o ./Generated_Code/LTC_ON.o ./Generated_Code/LTC_PGOOD.o ./Generated_Code/MQX1.o ./Generated_Code/PE_LDD.o ./Generated_Code/PIT.o ./Generated_Code/PwmLdd1.o ./Generated_Code/RTC_INT.o ./Generated_Code/Ref_EN.o ./Generated_Code/SDCard_ON.o ./Generated_Code/SNS_AD1.o ./Generated_Code/SNS_AD2.o ./Generated_Code/SNS_AD3.o ./Generated_Code/SNS_AD4.o ./Generated_Code/SNS_AD5.o ./Generated_Code/SNS_AD6.o ./Generated_Code/SNS_IOA.o ./Generated_Code/SystemTimer1.o ./Generated_Code/TU1.o ./Generated_Code/TU2.o ./Generated_Code/TU3.o ./Generated_Code/TimeDateLdd1.o ./Generated_Code/TmDt1.o ./Generated_Code/USB_ID.o ./Generated_Code/USB_LDD.o ./Generated_Code/Vectors.o ./Generated_Code/WAIT.o ./Generated_Code/Xmin.o ./Generated_Code/Ymin.o ./Generated_Code/usb_class.o ./Generated_Code/usb_dci.o ./Generated_Code/usb_descriptor.o ./Generated_Code/usb_device.o ./Generated_Code/usb_driver.o ./Generated_Code/usb_framework.o ./Generated_Code/usb_msc.o ./Generated_Code/usb_msc_scsi.o  ./FatFs/ccsbcs.o ./FatFs/disk.o ./FatFs/ff.o  ./Errors/Error.o  ./Driver_LCD/Calibri14.o ./Driver_LCD/Calibri28.o ./Driver_LCD/Driver_ILI9340.o ./Driver_LCD/TFT_base.o ./Driver_LCD/TFT_font.o ./Driver_LCD/TFT_image.o ./Driver_LCD/TFT_object.o ./Driver_LCD/Touchscreen.o  ./Bluetooth/aci_queue.o ./Bluetooth/aci_setup.o ./Bluetooth/acilib.o ./Bluetooth/dfu.o ./Bluetooth/hal_aci_tl.o ./Bluetooth/lib_aci.o ./Bluetooth/main_ble.o  ./ADC/ADC.o 

Linea in ingresso troppo lunga.

make: *** [Test.elf] Error 255

with codewarrior no  problem

0 Kudos
4,952 Views
BlackNight
NXP Employee
NXP Employee

CodeWarrior is using a different gcc and different build system, not comparable with KDS. Can you try the solution above to shorten the path of 'Generated_Code' which should save you many characters?

Erich

0 Kudos
4,952 Views
danielecortella
Contributor V

Ok, for now it work but now i have the error : writing to APSR without specifying a bitmask is deprecated but the file is correct, in fact i have (like said here MQXLite for M0+ (MKL25Z128VLK4) fails to build):

            #ifdef __GNUC__

                msr APSR_nzcvq, r1

            #else

                msr APSR, r1

            #endif

0 Kudos
4,952 Views
giacomopetrini
Contributor IV

It won't help much, just postpone the error.

An idea could be to use the library that the demo programs use, but how?

And by the way is there some kind of tutorial to use KSDK without processor expert?

Regards

Giacomo

0 Kudos
4,952 Views
giacomopetrini
Contributor IV

tried:

new project, added ksdk_platform_lib.a to the linker path.

added (manually) all the KSDK/platform files (only the .h) putting all in the same folder ( Hal and Driver), so the includes are less. In the C and C++ compiler settings I added all the necessary path but when i compile cpp files a get an error like this:

In file included from C:\Users\jack\Dropbox\MBD\Progetti\TwingTec\Firmware\workspace\firmware\Sources\Includes\Hal/fsl_pit_hal.h:33:0,

                 from C:\Users\jack\Dropbox\MBD\Progetti\TwingTec\Firmware\workspace\firmware\Sources\Init/Cpu.h:82,

                 from C:\Users\jack\Dropbox\MBD\Progetti\TwingTec\Firmware\workspace\firmware\Sources\Init/UART3.h:69,

                 from ../Sources/SBUS.h:24,

                 from ../Sources/Futaba_sbus/FUTABA_SBUS.h:4,

                 from ../Sources/Futaba_sbus/FUTABA_SBUS.cpp:1:

C:\Users\jack\Dropbox\MBD\Progetti\TwingTec\Firmware\workspace\firmware\Sources\Includes\Hal/fsl_pit_hal.h: In function 'bool PIT_HAL_GetIntCmd(uint32_t, uint32_t)':

C:\Users\jack\Dropbox\MBD\Progetti\TwingTec\Firmware\workspace\firmware\Sources\Includes\Hal/fsl_pit_hal.h:287:22: error: 'FSL_FEATURE_PIT_TIMER_COUNT' was not declared in this scope

     assert(channel < FSL_FEATURE_PIT_TIMER_COUNT);

so it seems that it can't find the FSL_FEATURE_PIT_TIMER_COUNT #define that is in fsl_pit_features.h THAT IS IN SAME DIRECTORY AS fsl_pit_hal.h.

Any ideas?

0 Kudos
4,952 Views
giacomopetrini
Contributor IV

Ok, found. I forgot to add the CPU type to the C++ preprocessor... ("CPU_MK64FN1M0VMD12").

0 Kudos