Project Copy / Paste and then Build fails...

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

Project Copy / Paste and then Build fails...

1,184 Views
robertpoor
Senior Contributor I

I have copied a freedom_bootloader project into my workspace using these switches (note that "Search for nested projects" and "Copy projects into workspace" are unchecked):

Screen Shot 2017-08-01 at 9.49.18 AM.png

I can compile the resulting project without error.  

Now I would like to make some modifications, but want to keep the original project intact.  So in the KDS Project Explorer, I selected freedom_bootloader, did [right click] Copy and then [right click] Paste, and named the new project freedom_kl24z_bootloader.

But now when I try to build the newly copied project, I get many errors where the include file(s) are not found.  For example:

11:10:29 **** Build of configuration debug for project freedom_kl25z_bootloader ****
make -k all 
Building file: /Users/r/Projects/Sensorex/Bootloader/NXP_Kinetis_Bootloader_2_0_0/src/utilities/src/fsl_assert.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m0plus -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall  -g -DDEBUG -DNDEBUG -DUSB_STACK_BM -DCPU_MKL25Z128VLK4 -DCPU_IS_ARM_CORTEX_M0P=1 -DFREEDOM -DBL_TARGET_FLASH -I../../../src -I../../../src/startup -I../../../../../src/platform/devices/MKL25Z4 -I../../../../../src/autobaud -I../../../../../src/usb/include -I../../../../../src/usb/osa -I../../../../../src/usb/device -I../../../../../src/usb/device/class -I../../../../../src/bm_usb -I../../../../../src/include -I../../../../../src/platform -I../../../../../src/platform/devices -I../../../../../src/platform/CMSIS/Include -I../../../../../src -I../../../../../src/drivers -I../../../../../src/startup -I../../../../../src/drivers/common -std=gnu99 -flto  -fno-inline-small-functions  -fno-common  -ffreestanding  -fno-builtin  -fshort-wchar  -mapcs -MMD -MP -MF"src/utilities/src/fsl_assert.d" -MT"src/utilities/src/fsl_assert.o" -c -o "src/utilities/src/fsl_assert.o" "/Users/r/Projects/Sensorex/Bootloader/NXP_Kinetis_Bootloader_2_0_0/src/utilities/src/fsl_assert.c"
/Users/r/Projects/Sensorex/Bootloader/NXP_Kinetis_Bootloader_2_0_0/src/utilities/src/fsl_assert.c:31:44: fatal error: utilities/fsl_rtos_abstraction.h: No such file or directory
 #include "utilities/fsl_rtos_abstraction.h"
Building file: /Users/r/Projects/Sensorex/Bootloader/NXP_Kinetis_Bootloader_2_0_0/src/utilities/src/fsl_rtos_abstraction.c
                                            ^
compilation terminated.
‍‍‍‍‍‍‍‍‍‍

My guess is that the original project is using links that don't resolve properly in the copied project, or that perhaps I need to modify the include path.  

Is there an obvious solution to this?

P.S.: One additional bit of info: In my Project Explorer, I note that there a a number of question marks next to the file icons in the copied project -- these don't appear in the original project.  I'm sure they're trying to tell me something:

Screen Shot 2017-08-01 at 11.21.07 AM.png

7 Replies

832 Views
marek-trmac
NXP Employee
NXP Employee

Hi Robert,

it is possible to create "stand-alone" project from any SDK 2.x example using KDS New Project Wizard. By "stand-alone" I mean project where all source files are located (copied) in your workspace.

How to do it step-by-step:

  • main menu - File - New - Kinetis SDK 2.x Project
  • enter project name (whatever you want)
  • Select root SDK folder, where you have your SDK package; Click Next
  • Expand board and select example; Click Finish

Before starting this operation, please check you have latest version of the New Project Wizard using "main menu - Check For Updates".

Regards

Marek

Regards,
Marek
0 Kudos

832 Views
robertpoor
Senior Contributor I

Marek:

I don't think that flash-based bootloaders follows the same structure as SDK 2.x code examples.  At the very least, the bootloader that I'm starting with is NOT one of the SDK 2.x examples -- it comes from a different distribution (see Alice's comments above and also Bootloader in half-duplex (RS485) environment ).

But let me know if I'm overlooking something fundamental.  Thanks!

832 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Robert,

I was thinking about you might use the default location when pasting.

When copy&paste project, please don't use the default location, choose the

path where the original project located , on my side , it should be :

pastedImage_1.png

after click "Ok" , in the original folder, we can see the project :

pastedImage_2.png

Then build the project, there is no error :

pastedImage_3.png

Hope it helps


Have a great day,
TIC

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

832 Views
robertpoor
Senior Contributor I

Alice:

That was a BIG help, and I think it almost worked!  :smileyhappy:  

I followed Ma Hui's instruction in Bootloader in half-duplex (RS485) environment  to import the original (un-modified) freedom_bootloader project.  It builds correctly.

Then I then did a Copy on the freedom_bootloader, and pasted it according to your advice:

Screen Shot 2017-08-02 at 11.10.09 AM.png

But when I try to build the newly copied project, I get this error:

11:11:40 **** Build of configuration debug for project Copy of freedom_bootloader ****

make -k all

Building target: Copy of freedom_bootloader.elf

Invoking: Cross ARM C Linker

arm-none-eabi-gcc -mcpu=cortex-m0plus -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall  -g -T ../../../../common/linker/kds/MKL25Z4/MKL25Z128xxx4_application_0x0000.ld -Xlinker --gc-sections -Wl,-Map,"Copy of freedom_bootloader.map" -Xlinker -z  -Xlinker muldefs   -flto  -fno-inline-small-functions  --specs=nano.specs          -Wall  -fno-common  -ffunction-sections  -fdata-sections  -ffreestanding  -fno-builtin  -fshort-wchar -Wl,--no-wchar-size-warning  -mapcs  -Xlinker -static  -Xlinker --defsym=__ram_vector_table__=1 -o "Copy of freedom_bootloader.elf" -Xlinker --start-group  ./src/utilities/src/fsl_assert.o ./src/utilities/src/fsl_rtos_abstraction.o  ./src/usb/osa/usb_osa_bm.o  ./src/usb/device/calss/usb_device_class.o ./src/usb/device/calss/usb_device_hid.o ./src/usb/device/calss/usb_device_msc.o ./src/usb/device/calss/usb_device_msc_ufi.o  ./src/usb/device/usb_device_ch9.o ./src/usb/device/usb_device_dci.o ./src/usb/device/usb_device_khci.o  ./src/usb/bm_composite/composite.o ./src/usb/bm_composite/hid_bootloader.o ./src/usb/bm_composite/msc_disk.o ./src/usb/bm_composite/usb_descriptor.o  ./src/startup/crt0_gcc.o ./src/startup/startup.o ./src/startup/startup_MKL25Z4.o ./src/startup/system_MKL25Z4.o  ./src/sbloader/src/sbloader.o  ./src/property/src/property.o  ./src/packet/src/serial_packet.o  ./src/memory/src/device_memory.o ./src/memory/src/flash_memory.o ./src/memory/src/memory.o ./src/memory/src/normal_memory.o ./src/memory/src/pattern_fill_gcc.o ./src/memory/src/sram_init_cm0plus.o  ./src/drivers/watchdog/src/fsl_watchdog_cop.o  ./src/drivers/systick/src/systick.o  ./src/drivers/spi/fsl_spi.o  ./src/drivers/smc/smc.o  ./src/drivers/microseconds/src/microseconds_pit.o  ./src/drivers/lpsci/fsl_lpsci.o  ./src/drivers/i2c/src/fsl_i2c.o  ./src/drivers/gpio/fsl_gpio.o  ./src/drivers/flash/fsl_flash.o  ./src/crc/src/crc16.o ./src/crc/src/crc32.o  ./src/bootloader/src/bl_command.o ./src/bootloader/src/bl_context.o ./src/bootloader/src/bl_exception_handler.o ./src/bootloader/src/bl_main.o ./src/bootloader/src/bl_shutdown_cleanup.o ./src/bootloader/src/bl_tree_root.o ./src/bootloader/src/bl_user_entry.o ./src/bootloader/src/i2c_peripheral_interface.o ./src/bootloader/src/spi_peripheral_interface.o ./src/bootloader/src/uart0_peripheral_interface.o ./src/bootloader/src/usb_hid_msc_peripheral_interface.o  ./src/autobaud/src/autobaud_irq.o  ./kl25z4/bl_i2c_irq_config_common.o ./kl25z4/clock_config_MKL25Z4.o ./kl25z4/hardware_init_MKL25Z4.o ./kl25z4/memory_map_MKL25Z4.o ./kl25z4/peripherals_MKL25Z4.o ./kl25z4/pinmux_utility_common.o   -lm -lg -lgcc -lnosys -Xlinker --end-group

/Applications/KDS_v3.app/Contents/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld: cannot open linker script file ../../../../common/linker/kds/MKL25Z4/MKL25Z128xxx4_application_0x0000.ld: No such file or directory

collect2: error: ld returned 1 exit status

make: *** [Copy of freedom_bootloader.elf] Error 1

make: Target `all' not remade because of errors.

11:11:41 Build Finished (took 115ms)

Do I need to set some project variables before compiling?

0 Kudos

832 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Robert,

In the location path, please also add your project name:

pastedImage_3.png

On my last reply :

pastedImage_2.png

Hope it helps


Have a great day,
TIC

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

0 Kudos

832 Views
robertpoor
Senior Contributor I

Alice:

The directions you gave me allowed me to make a copy of the project, and it compiles correctly.  But there is one problem.  You will remember in my original question, I said:

>  Now I would like to make some modifications, but want to keep the original project intact.  

The directions you gave me creates links to the original files, not copies, so if I make a modification to a file in the `Copy of freedom_bootloader` project, that change also appears in `freedom_bootloader` project.  In other words, it does NOT keep the original project intact.

So I'm still trying to understand how to make a full copy of the original project in a way that will allow me to make specific modifications (e.g. using LPUART rather than UART, support KL27Z instead of KL25Z, etc) without modifying the original project.

Any suggestions would be appreciated.

0 Kudos

832 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ,

Robert,

I think the easiest way is copy the KBOOT on you PC, then open it to development.

Or create a new blank project, then copy the folder and files refer to the original project.

BR

Alice

0 Kudos