Debug/Release options

Discussions and support about ChibiStudio, the free development environment for ARM.
Post Reply
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Debug/Release options

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Debug/Release options

Post 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
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: Debug/Release options

Post by Tabulous »

where is "/hal/STM32/USB_CDC" just down load the latest version and cant see it
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Debug/Release options

Post by Giovanni »

You need to checkout the repository trunk, makefiles have been improved.

Giovanni
User avatar
FXCoder
Posts: 403
Joined: Sun Jun 12, 2016 4:10 am
Has thanked: 188 times
Been thanked: 134 times

Re: Debug/Release options

Post 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/
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: Debug/Release options

Post 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
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Debug/Release options

Post by Giovanni »

Environment variables are passed to make, you may use that.

Giovanni
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: Debug/Release options

Post 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
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: Debug/Release options

Post by Tabulous »

Its ok i have it working now :-)
Post Reply