Can build Debug target but not Release target

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

Can build Debug target but not Release target

Jump to solution
737 Views
robertpoor
Senior Contributor I

As per this post on building a custom bootloader, I can compile and run the Debug target for my code.  However, switching to a Release target generates many (many) errors.  Here are some examples of the errors:

12:34:48 **** Incremental Build of configuration release for project freedom_bootloader ****

make -k all

Building file: ../src/utilities/src/fsl_assert.c

Invoking: Cross ARM C Compiler

arm-none-eabi-gcc -mcpu=cortex-m0plus -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall  -g -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" "../src/utilities/src/fsl_assert.c"

../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"

                                            ^

compilation terminated.

Building file: ../src/utilities/src/fsl_rtos_abstraction.c

Invoking: Cross ARM C Compiler

make: *** [src/utilities/src/fsl_assert.o] Error 1

arm-none-eabi-gcc -mcpu=cortex-m0plus -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall  -g -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_rtos_abstraction.d" -MT"src/utilities/src/fsl_rtos_abstraction.o" -c -o "src/utilities/src/fsl_rtos_abstraction.o" "../src/utilities/src/fsl_rtos_abstraction.c"

../src/utilities/src/fsl_rtos_abstraction.c:31:34: fatal error: utilities/fsl_assert.h: No such file or directory

#include "utilities/fsl_assert.h"

                                  ^

compilation terminated.

make: *** [src/utilities/src/fsl_rtos_abstraction.o] Error 1

Building file: ../src/usb/osa/usb_osa_bm.c

Invoking: Cross ARM C Compiler

arm-none-eabi-gcc -mcpu=cortex-m0plus -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall  -g -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/usb/osa/usb_osa_bm.d" -MT"src/usb/osa/usb_osa_bm.o" -c -o "src/usb/osa/usb_osa_bm.o" "../src/usb/osa/usb_osa_bm.c"

../src/usb/osa/usb_osa_bm.c:31:17: fatal error: usb.h: No such file or directory

#include "usb.h"

                 ^

compilation terminated.

make: *** [src/usb/osa/usb_osa_bm.o] Error 1

Building file: ../src/usb/device/class/usb_device_class.c

Invoking: Cross ARM C Compiler

arm-none-eabi-gcc -mcpu=cortex-m0plus -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall  -g -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/usb/device/class/usb_device_class.d" -MT"src/usb/device/class/usb_device_class.o" -c -o "src/usb/device/class/usb_device_class.o" "../src/usb/device/class/usb_device_class.c"

../src/usb/device/class/usb_device_class.c:31:31: fatal error: usb_device_config.h: No such file or directory

#include "usb_device_config.h"

                               ^

It appears that the include path is not set up properly.  Is there an obvious place to check on this?

0 Kudos
1 Solution
523 Views
robertpoor
Senior Contributor I

Solved.   I think.

When I set up the project, as per guidance from Erich Styger, I adjusted the Include Paths for the Debug configuration, but not for the Release configuration.  See images below:

Screen Shot 2017-08-30 at 12.50.25 PM.png

Screen Shot 2017-08-30 at 12.50.44 PM.png

Should be an easy fix...

NOTE: You may also need to update Cross ARM C Linker => General => Script Files (-T) to match the debug config as well.

View solution in original post

0 Kudos
1 Reply
524 Views
robertpoor
Senior Contributor I

Solved.   I think.

When I set up the project, as per guidance from Erich Styger, I adjusted the Include Paths for the Debug configuration, but not for the Release configuration.  See images below:

Screen Shot 2017-08-30 at 12.50.25 PM.png

Screen Shot 2017-08-30 at 12.50.44 PM.png

Should be an easy fix...

NOTE: You may also need to update Cross ARM C Linker => General => Script Files (-T) to match the debug config as well.

0 Kudos