Page 1 of 1

Debug/Release options

Posted: Tue Aug 29, 2017 1:03 pm
by Tabulous
Is it possible to pass build symbols to the make file and thus select different scatter file and compiler options ?

As you know debugging with optimization is not really good. I need to debug on a 512KB flash part, and then for release version build for 256KB with optimization.

Re: Debug/Release options

Posted: Tue Aug 29, 2017 1:34 pm
by Giovanni
You could make 2 different Makefiles and 2 build configurations in Eclipse, the result is the same.

See the new multi-target demo for an example of how to do that, under /hal/STM32/USB_CDC.

Giovanni

Re: Debug/Release options

Posted: Tue Aug 29, 2017 1:50 pm
by Tabulous
where is "/hal/STM32/USB_CDC" just down load the latest version and cant see it

Re: Debug/Release options

Posted: Tue Aug 29, 2017 2:11 pm
by Giovanni
You need to checkout the repository trunk, makefiles have been improved.

Giovanni

Re: Debug/Release options

Posted: Wed Aug 30, 2017 7:38 am
by FXCoder
It's in trunk /testhal/STM32/USB_CDC

If you are using Chibistudio RoccoMarco did a nice article on using Tortoise SVN to keep in sync with trunk.

http://www.playembedded.org/blog/en/201 ... n-chibios/

Re: Debug/Release options

Posted: Wed Aug 30, 2017 11:43 am
by Tabulous
Changing to the trunk would be a task at the moment as i've got afew bits in lower level drivers changed.

All i was thinking was maybe :

have too build configs in eclipse, i.e. Debug and Release.

Each one as different # Symbols of which are passed the makefile and then i could

Code: Select all

# Compiler options here.
ifeq ($(USE_OPT),)
  ifeq ($(RELEASE_BUILD),1)
    USE_OPT = -Os -ggdb -fomit-frame-pointer -falign-functions=16
  else
    USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16
  endif
endif

Re: Debug/Release options

Posted: Wed Aug 30, 2017 1:02 pm
by Giovanni
Environment variables are passed to make, you may use that.

Giovanni

Re: Debug/Release options

Posted: Wed Aug 30, 2017 3:25 pm
by Tabulous
Giovanni wrote:Environment variables are passed to make, you may use that.

Giovanni


please forgive my ignorance, but where in eclipse would i add these ?

C/C++ Build->Build Variables ?
C/C++ Build->Environment ?
C/C++ General->Paths and Symbols ?

Not sure you see

Re: Debug/Release options

Posted: Wed Aug 30, 2017 4:05 pm
by Tabulous
Its ok i have it working now :-)